当前位置: 首页 > news >正文

fabric 是一个开源框架,用于使用 AI 增强人类能力。它提供了一个模块化框架,用于使用一组可在任何地方使用的众包人工智能提示来解决特定问题

​一、软件介绍

文末提供程序和源码下载

       fabric 是一个开源框架,用于使用 AI 增强人类能力。它提供了一个模块化框架,用于使用一组可在任何地方使用的众包人工智能提示来解决特定问题。

二、What and why 什么和为什么

自 2023 年初和 GenAI 以来,我们已经看到了大量用于完成任务的 AI 应用程序。它很强大,但要将此功能集成到我们的生活中并不容易。

In other words, AI doesn't have a capabilities problem—it has an integration problem.
换句话说,AI 没有能力问题,它有集成问题。

Fabric was created to address this by enabling everyone to granularly apply AI to everyday challenges.
Fabric 的创建是为了解决这个问题,让每个人都能精细地将 AI 应用于日常挑战。

三、Breaking problems into components将问题分解为组件

Our approach is to break problems into individual pieces (see below) and then apply AI to them one at a time. See below for some examples.
我们的方法是将问题分解成单独的部分(见下文),然后一次将 AI 应用于一个部分。有关一些示例,请参见下文。

四、Too many prompts 提示太多

Prompts are good for this, but the biggest challenge I faced in 2023——which still exists today—is the sheer number of AI prompts out there. We all have prompts that are useful, but it's hard to discover new ones, know if they are good or not, and manage different versions of the ones we like.
提示对此有好处,但我在 2023 年面临的最大挑战(今天仍然存在)是 AI 提示的绝对数量。我们都有有用的提示,但很难发现新的提示,知道它们是否好,并管理我们喜欢的不同版本。

One of fabric's primary features is helping people collect and integrate prompts, which we call Patterns, into various parts of their lives.
fabric 的主要功能之一是帮助人们收集和整合提示,我们称之为 Patterns,融入他们生活的各个方面。

Fabric has Patterns for all sorts of life and work activities, including:
Fabric 具有适用于各种生活和工作活动的 Patterns,包括:

  • Extracting the most interesting parts of YouTube videos and podcasts
    提取 YouTube 视频和播客中最有趣的部分
  • Writing an essay in your own voice with just an idea as an input
    用你自己的声音写一篇文章,只用一个想法作为输入
  • Summarizing opaque academic papers
    总结不透明的学术论文
  • Creating perfectly matched AI art prompts for a piece of writing
    为一篇文章创建完美匹配的 AI 艺术提示
  • Rating the quality of content to see if you want to read/watch the whole thing
    对内容质量进行评级,看看您是否想阅读/观看整个内容
  • Getting summaries of long, boring content
    获取冗长、无聊的内容摘要
  • Explaining code to you
    向您解释代码
  • Turning bad documentation into usable documentation
    将不良文档转化为可用的文档
  • Creating social media posts from any content input
    从任何内容输入创建社交媒体帖子
  • And a million more…
    还有一百万个...

五、Installation 安装

文末提供各系统版本下载

Using package managers 使用包管理器

NOTE: using Homebrew or the Arch Linux package managers makes fabric available as fabric-ai, so add the following alias to your shell startup files to account for this:
注意:使用 Homebrew 或 Arch Linux 包管理器可以 fabric 作为 fabric-ai 提供,因此请将以下别名添加到您的 shell 启动文件中以说明这一点:

alias fabric='fabric-ai'
macOS (Homebrew) macOS(自制软件)

brew install fabric-ai

Arch Linux (AUR) Arch Linux (AUR)

yay -S fabric-ai

From Source 从源

To install Fabric, make sure Go is installed, and then run the following command.
要安装 Fabric,请确保已安装 Go,然后运行以下命令。

# Install Fabric directly from the repo
go install github.com/danielmiessler/fabric@latest

Environment Variables 环境变量

You may need to set some environment variables in your ~/.bashrc on linux or ~/.zshrc file on mac to be able to run the fabric command. Here is an example of what you can add:
您可能需要在 linux ~/.bashrc 上设置一些环境变量,或者在 ~/.zshrc mac 上设置一些文件才能运行该 fabric 命令。以下是您可以添加的内容的示例:

For Intel based macs or linux
适用于基于 Intel 的 mac 或 linux

# Golang environment variables
export GOROOT=/usr/local/go
export GOPATH=$HOME/go# Update PATH to include GOPATH and GOROOT binaries
export PATH=$GOPATH/bin:$GOROOT/bin:$HOME/.local/bin:$PATH

for Apple Silicon based macs
适用于基于 Apple Silicon 的 mac

# Golang environment variables
export GOROOT=$(brew --prefix go)/libexec
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$HOME/.local/bin:$PATH

Setup 设置

Now run the following command
现在运行以下命令

# Run the setup to set up your directories and keys
fabric --setup

If everything works you are good to go.
如果一切正常,您就可以开始了。

Add aliases for all patterns
为所有模式添加别名

In order to add aliases for all your patterns and use them directly as commands ie. summarize instead of fabric --pattern summarize You can add the following to your .zshrc or .bashrc file.
为了为您的所有模式添加别名并将它们直接用作命令,即。 summarize 而不是 fabric --pattern summarize 您可以将以下内容添加到您的 .zshrc OR .bashrc 文件中。

# Loop through all files in the ~/.config/fabric/patterns directory
for pattern_file in $HOME/.config/fabric/patterns/*; do# Get the base name of the file (i.e., remove the directory path)pattern_name=$(basename "$pattern_file")# Create an alias in the form: alias pattern_name="fabric --pattern pattern_name"alias_command="alias $pattern_name='fabric --pattern $pattern_name'"# Evaluate the alias command to add it to the current shelleval "$alias_command"
doneyt() {if [ "$#" -eq 0 ] || [ "$#" -gt 2 ]; thenecho "Usage: yt [-t | --timestamps] youtube-link"echo "Use the '-t' flag to get the transcript with timestamps."return 1fitranscript_flag="--transcript"if [ "$1" = "-t" ] || [ "$1" = "--timestamps" ]; thentranscript_flag="--transcript-with-timestamps"shiftfilocal video_link="$1"fabric -y "$video_link" $transcript_flag
}

You can add the below code for the equivalent aliases inside PowerShell by running notepad $PROFILE inside a PowerShell window:
您可以通过在 PowerShell 窗口中运行 notepad $PROFILE ,为 PowerShell 中的等效别名添加以下代码:

# Path to the patterns directory
$patternsPath = Join-Path $HOME ".config/fabric/patterns"
foreach ($patternDir in Get-ChildItem -Path $patternsPath -Directory) {$patternName = $patternDir.Name# Dynamically define a function for each pattern$functionDefinition = @"
function $patternName {
    [CmdletBinding()]
    param(
        [Parameter(ValueFromPipeline = `$true)]
        [string] `$InputObject,        [Parameter(ValueFromRemainingArguments = `$true)]
        [String[]] `$patternArgs
    )    begin {
        # Initialize an array to collect pipeline input
        `$collector = @()
    }    process {
        # Collect pipeline input objects
        if (`$InputObject) {
            `$collector += `$InputObject
        }
    }    end {
        # Join all pipeline input into a single string, separated by newlines
        `$pipelineContent = `$collector -join "`n"        # If there's pipeline input, include it in the call to fabric
        if (`$pipelineContent) {
            `$pipelineContent | fabric --pattern $patternName `$patternArgs
        } else {
            # No pipeline input; just call fabric with the additional args
            fabric --pattern $patternName `$patternArgs
        }
    }
}
"@# Add the function to the current sessionInvoke-Expression $functionDefinition
}# Define the 'yt' function as well
function yt {[CmdletBinding()]param([Parameter()][Alias("timestamps")][switch]$t,[Parameter(Position = 0, ValueFromPipeline = $true)][string]$videoLink)begin {$transcriptFlag = "--transcript"if ($t) {$transcriptFlag = "--transcript-with-timestamps"}}process {if (-not $videoLink) {Write-Error "Usage: yt [-t | --timestamps] youtube-link"return}}end {if ($videoLink) {# Execute and allow output to flow through the pipelinefabric -y $videoLink $transcriptFlag}}
}

This also creates a yt alias that allows you to use yt https://www.youtube.com/watch?v=4b0iet22VIk to get transcripts, comments, and metadata.
这还会创建一个 yt 别名,允许您使用 yt https://www.youtube.com/watch?v=4b0iet22VIk 该别名来获取脚本、评论和元数据。

Save your files in markdown using aliases
使用别名将文件保存在 markdown 中

If in addition to the above aliases you would like to have the option to save the output to your favorite markdown note vault like Obsidian then instead of the above add the following to your .zshrc or .bashrc file:
如果除了上述别名之外,你还希望可以选择将输出保存到你最喜欢的 markdown 笔记库(如 Obsidian),那么将以下内容添加到你的 .zshrc or .bashrc 文件中,而不是上述内容:

# Define the base directory for Obsidian notes
obsidian_base="/path/to/obsidian"# Loop through all files in the ~/.config/fabric/patterns directory
for pattern_file in ~/.config/fabric/patterns/*; do# Get the base name of the file (i.e., remove the directory path)pattern_name=$(basename "$pattern_file")# Remove any existing alias with the same nameunalias "$pattern_name" 2>/dev/null# Define a function dynamically for each patterneval "
    $pattern_name() {
        local title=\$1
        local date_stamp=\$(date +'%Y-%m-%d')
        local output_path=\"\$obsidian_base/\${date_stamp}-\${title}.md\"        # Check if a title was provided
        if [ -n \"\$title\" ]; then
            # If a title is provided, use the output path
            fabric --pattern \"$pattern_name\" -o \"\$output_path\"
        else
            # If no title is provided, use --stream
            fabric --pattern \"$pattern_name\" --stream
        fi
    }
    "
done

This will allow you to use the patterns as aliases like in the above for example summarize instead of fabric --pattern summarize --stream, however if you pass in an extra argument like this summarize "my_article_title" your output will be saved in the destination that you set in obsidian_base="/path/to/obsidian" in the following format YYYY-MM-DD-my_article_title.md where the date gets autogenerated for you. You can tweak the date format by tweaking the date_stamp format.
这将允许您将模式用作别名,例如, summarize 例如 fabric --pattern summarize --stream ,如果您传入一个额外的参数, summarize "my_article_title" 则您的输出将 obsidian_base="/path/to/obsidian" 以以下格式 YYYY-MM-DD-my_article_title.md 保存在您设置的目标中,其中将为您自动生成日期。您可以通过调整 date_stamp 格式来调整日期格式。

Migration 迁移

If you have the Legacy (Python) version installed and want to migrate to the Go version, here's how you do it. It's basically two steps: 1) uninstall the Python version, and 2) install the Go version.
如果您已安装 Legacy (Python) 版本并希望迁移到 Go 版本,请按以下步骤作。它基本上是两个步骤:1) 卸载 Python 版本,以及 2) 安装 Go 版本。

# Uninstall Legacy Fabric
pipx uninstall fabric# Clear any old Fabric aliases
(check your .bashrc, .zshrc, etc.)
# Install the Go version
go install github.com/danielmiessler/fabric@latest
# Run setup for the new version. Important because things have changed
fabric --setup

Then set your environmental variables as shown above.
然后按照上面所示设置环境变量。

Upgrading 升级

The great thing about Go is that it's super easy to upgrade. Just run the same command you used to install it in the first place and you'll always get the latest version.
Go 的伟大之处在于它非常容易升级。只需运行您最初用于安装它的相同命令,您将始终获得最新版本。

go install github.com/danielmiessler/fabric@latest

Shell Completions Shell 完成

Fabric provides shell completion scripts for Zsh, Bash, and Fish shells, making it easier to use the CLI by providing tab completion for commands and options.
Fabric 为 Zsh、Bash 和 Fish shell 提供 shell 补全脚本,通过为命令和选项提供 Tab 键补全,使 CLI 的使用更加容易。

Zsh Completion Zsh 完成

To enable Zsh completion:
要启用 Zsh 补全:

# Copy the completion file to a directory in your $fpath
mkdir -p ~/.zsh/completions
cp completions/_fabric ~/.zsh/completions/# Add the directory to fpath in your .zshrc before compinit
echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc
Bash Completion Bash 补全

To enable Bash completion:
要启用 Bash 补全:

# Source the completion script in your .bashrc
echo 'source /path/to/fabric/completions/fabric.bash' >> ~/.bashrc# Or copy to the system-wide bash completion directory
sudo cp completions/fabric.bash /etc/bash_completion.d/
Fish Completion 鱼类完成

To enable Fish completion:
要启用 Fish 补全:

# Copy the completion file to the fish completions directory
mkdir -p ~/.config/fish/completions
cp completions/fabric.fish ~/.config/fish/completions/

六、Usage 用法

Once you have it all set up, here's how to use it.
设置完所有内容后,以下是如何使用它。

fabric -h
<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>
Usage:fabric [OPTIONS]Application Options:-p, --pattern=                    Choose a pattern from the available patterns-v, --variable=                   Values for pattern variables, e.g. -v=#role:expert -v=#points:30-C, --context=                    Choose a context from the available contexts--session=                    Choose a session from the available sessions-a, --attachment=                 Attachment path or URL (e.g. for OpenAI image recognition messages)-S, --setup                       Run setup for all reconfigurable parts of fabric-t, --temperature=                Set temperature (default: 0.7)-T, --topp=                       Set top P (default: 0.9)-s, --stream                      Stream-P, --presencepenalty=            Set presence penalty (default: 0.0)-r, --raw                         Use the defaults of the model without sending chat options (like temperature etc.) and use the user role instead of the system role for patterns.-F, --frequencypenalty=           Set frequency penalty (default: 0.0)-l, --listpatterns                List all patterns-L, --listmodels                  List all available models-x, --listcontexts                List all contexts-X, --listsessions                List all sessions-U, --updatepatterns              Update patterns-c, --copy                        Copy to clipboard-m, --model=                      Choose model--modelContextLength=         Model context length (only affects ollama)-o, --output=                     Output to file--output-session              Output the entire session (also a temporary one) to the output file-n, --latest=                     Number of latest patterns to list (default: 0)-d, --changeDefaultModel          Change default model-y, --youtube=                    YouTube video or play list "URL" to grab transcript, comments from it and send to chat or print it put to the console and store it in the output file--playlist                    Prefer playlist over video if both ids are present in the URL--transcript                  Grab transcript from YouTube video and send to chat (it is used per default).--transcript-with-timestamps  Grab transcript from YouTube video with timestamps and send to chat--comments                    Grab comments from YouTube video and send to chat--metadata                    Output video metadata-g, --language=                   Specify the Language Code for the chat, e.g. -g=en -g=zh-u, --scrape_url=                 Scrape website URL to markdown using Jina AI-q, --scrape_question=            Search question using Jina AI-e, --seed=                       Seed to be used for LMM generation-w, --wipecontext=                Wipe context-W, --wipesession=                Wipe session--printcontext=               Print context--printsession=               Print session--readability                 Convert HTML input into a clean, readable view--input-has-vars              Apply variables to user input--dry-run                     Show what would be sent to the model without actually sending it--serve                       Serve the Fabric Rest API--serveOllama                 Serve the Fabric Rest API with ollama endpoints--address=                    The address to bind the REST API (default: :8080)--api-key=                    API key used to secure server routes--config=                     Path to YAML config file--version                     Print current version--listextensions              List all registered extensions--addextension=               Register a new extension from config file path--rmextension=                Remove a registered extension by name--strategy=                   Choose a strategy from the available strategies--liststrategies              List all strategies--listvendors                 List all vendors--shell-complete-list         Output raw list without headers/formatting (for shell completion)Help Options:-h, --help                        Show this help message</code></span></span></span></span>

Our approach to prompting
我们的提示方法

Fabric Patterns are different than most prompts you'll see.
Fabric Patterns 与您将看到的大多数提示不同。

  • First, we use Markdown to help ensure maximum readability and editability. This not only helps the creator make a good one, but also anyone who wants to deeply understand what it does. Importantly, this also includes the AI you're sending it to!
    首先,我们使用 Markdown to 帮助确保最大的可读性和可编辑性。这不仅有助于创作者制作一个好的,而且可以帮助任何想要深入了解它的作用的人。重要的是,这还包括您要将其发送到的 AI!

Here's an example of a Fabric Pattern.
下面是 Fabric 模式的示例。

https://github.com/danielmiessler/fabric/blob/main/patterns/extract_wisdom/system.md

七、Examples 例子

The following examples use the macOS pbpaste to paste from the clipboard. See the pbpaste section below for Windows and Linux alternatives.
以下示例使用 macOS pbpaste 从剪贴板粘贴。请参阅 下面的 pbpaste 部分,了解 Windows 和 Linux 替代方案。

Now let's look at some things you can do with Fabric.
现在让我们看看您可以使用 Fabric 做的一些事情。

  1. Run the summarize Pattern based on input from stdin. In this case, the body of an article.
    summarize 根据 中的 stdin 输入运行 Pattern。在本例中,为文章的正文。

    pbpaste | fabric --pattern summarize
  2. Run the analyze_claims Pattern with the --stream option to get immediate and streaming results.
    analyze_claims 运行 Pattern 并 --stream 可选择获取即时和流式处理结果。

    pbpaste | fabric --stream --pattern analyze_claims
  3. Run the extract_wisdom Pattern with the --stream option to get immediate and streaming results from any Youtube video (much like in the original introduction video).
    extract_wisdom 运行 Pattern 并可 --stream 选择从任何 Youtube 视频获取即时和流式结果(与原始介绍视频非常相似)。

    fabric -y "https://youtube.com/watch?v=uXs-zPc63kM" --stream --pattern extract_wisdom
  4. Create patterns- you must create a .md file with the pattern and save it to ~/.config/fabric/patterns/[yourpatternname].
    创建模式 - 您必须使用该模式创建 .md 文件并将其保存到 ~/.config/fabric/patterns/[yourpatternname] .

  5. Run a analyze_claims pattern on a website. Fabric uses Jina AI to scrape the URL into markdown format before sending it to the model.
    在网站上运行 analyze_claims Pattern。Fabric 使用 Jina AI 将 URL 抓取成 markdown 格式,然后再将其发送到模型。

    fabric -u https://github.com/danielmiessler/fabric/ -p analyze_claims

Just use the Patterns 只需使用 Patterns

If you're not looking to do anything fancy, and you just want a lot of great prompts, you can navigate to the /patterns directory and start exploring!
如果您不想做任何花哨的事情,而只想要很多很棒的提示,您可以导航到 /patterns 目录并开始探索!

We hope that if you used nothing else from Fabric, the Patterns by themselves will make the project useful.
我们希望,如果你没有使用 Fabric 中的其他任何内容,那么 Patterns 本身将使项目有用。

You can use any of the Patterns you see there in any AI application that you have, whether that's ChatGPT or some other app or website. Our plan and prediction is that people will soon be sharing many more than those we've published, and they will be way better than ours.
您可以在您拥有的任何 AI 应用程序中使用您在那里看到的任何模式,无论是 ChatGPT 还是其他一些应用程序或网站。我们的计划和预测是,人们很快就会分享比我们发布的内容更多的内容,而且他们会比我们好得多。

The wisdom of crowds for the win.
群众的智慧为胜利。

Prompt Strategies 提示策略

Fabric also implements prompt strategies like "Chain of Thought" or "Chain of Draft" which can be used in addition to the basic patterns.
Fabric 还实现了 “Chain of Thought” 或 “Chain of Draft” 等提示策略,除了基本模式之外,还可以使用这些策略。

See the Thinking Faster by Writing Less paper and the Thought Generation section of Learn Prompting for examples of prompt strategies.
有关提示策略的示例,请参阅 Thinking Faster by Writing Less 论文和 Learn Prompting 的 Thought Generation 部分。

Each strategy is available as a small json file in the /strategies directory.
每个策略都以 /strategies directory 中的一个小 json 文件的形式提供。

The prompt modification of the strategy is applied to the system prompt and passed on to the LLM in the chat session.
策略的提示修改将应用于系统提示,并传递到聊天会话中的 。LLM

Use fabric -S and select the option to install the strategies in your ~/.config/fabric directory.
使用 fabric -S 并选择选项以在您的 ~/.config/fabric 目录中安装策略。

Custom Patterns 自定义模式

You may want to use Fabric to create your own custom Patterns—but not share them with others. No problem!
您可能希望使用 Fabric 创建自己的自定义 Pattern,但不要与他人共享它们。没关系!

Just make a directory in ~/.config/custompatterns/ (or wherever) and put your .md files in there.
只需在 ~/.config/custompatterns/ (或任何地方) 创建一个目录并将您的 .md 文件放入其中。

When you're ready to use them, copy them into ~/.config/fabric/patterns/
当您准备好使用它们时,请将它们复制到 ~/.config/fabric/patterns/

You can then use them like any other Patterns, but they won't be public unless you explicitly submit them as Pull Requests to the Fabric project. So don't worry—they're private to you.
然后,你可以像使用任何其他模式一样使用它们,但除非你明确地将它们作为 Pull Requests 提交到 Fabric 项目,否则它们不会是公开的。所以别担心 - 它们是您的私有文件。

Helper Apps 帮助应用程序

Fabric also makes use of some core helper apps (tools) to make it easier to integrate with your various workflows. Here are some examples:
Fabric 还利用了一些核心帮助应用程序(工具)来更轻松地与您的各种工作流程集成。以下是一些示例:

to_pdf

to_pdf is a helper command that converts LaTeX files to PDF format. You can use it like this:
to_pdf 是将 LaTeX 文件转换为 PDF 格式的辅助命令。您可以像这样使用它:

to_pdf input.tex

This will create a PDF file from the input LaTeX file in the same directory.
这将从同一目录中的输入 LaTeX 文件创建一个 PDF 文件。

You can also use it with stdin which works perfectly with the write_latex pattern:
你也可以将它与 stdin 一起使用,它与 write_latex pattern 完美配合:

echo "ai security primer" | fabric --pattern write_latex | to_pdf

This will create a PDF file named output.pdf in the current directory.
这将创建一个在当前目录中命名 output.pdf 的 PDF 文件。

to_pdf Installation  to_pdf 安装

To install to_pdf, install it the same way as you install Fabric, just with a different repo name.
要安装 to_pdf ,请按照与安装 Fabric 相同的方式进行安装,只是使用不同的存储库名称。

go install github.com/danielmiessler/fabric/plugins/tools/to_pdf@latest

Make sure you have a LaTeX distribution (like TeX Live or MiKTeX) installed on your system, as to_pdf requires pdflatex to be available in your system's PATH.
确保您的系统上安装了 LaTeX 发行版(如 TeX Live 或 MiKTeX),因为 to_pdf 需要在 pdflatex 系统的 PATH 中可用。

code_helper

code_helper is used in conjunction with the create_coding_feature pattern. It generates a json representation of a directory of code that can be fed into an AI model with instructions to create a new feature or edit the code in a specified way.
code_helper 与 create_coding_feature 模式结合使用。它生成代码目录的 json 表示形式,该目录可以馈送到 AI 模型中,并带有创建新功能或以指定方式编辑代码的指令。

See the Create Coding Feature Pattern README for details.
有关详细信息,请参阅 Create Coding Feature Pattern README。

Install it first using:
首先使用以下方法进行安装:

go install github.com/danielmiessler/fabric/plugins/tools/code_helper@latest

pbpaste PBPASTE的

The examples use the macOS program pbpaste to paste content from the clipboard to pipe into fabric as the input. pbpaste is not available on Windows or Linux, but there are alternatives.
这些示例使用 macOS 程序 pbpaste 将剪贴板中的内容粘贴到管道 fabric 中作为输入。 pbpaste 在 Windows 或 Linux 上不可用,但有其他选择。

On Windows, you can use the PowerShell command Get-Clipboard from a PowerShell command prompt. If you like, you can also alias it to pbpaste. If you are using classic PowerShell, edit the file ~\Documents\WindowsPowerShell\.profile.ps1, or if you are using PowerShell Core, edit ~\Documents\PowerShell\.profile.ps1 and add the alias,
在 Windows 上,您可以从 PowerShell 命令提示符使用 PowerShell 命令 Get-Clipboard 。如果您愿意,还可以将其别名为 pbpaste .如果您使用的是经典 PowerShell,请编辑文件 ~\Documents\WindowsPowerShell\.profile.ps1 ,或者如果您使用的是 PowerShell Core,请编辑 ~\Documents\PowerShell\.profile.ps1 并添加别名

Set-Alias pbpaste Get-Clipboard

On Linux, you can use xclip -selection clipboard -o to paste from the clipboard. You will likely need to install xclip with your package manager. For Debian based systems including Ubuntu,
在 Linux 上,您可以使用 xclip -selection clipboard -o 从剪贴板粘贴。您可能需要使用软件包管理器进行安装 xclip 。对于基于 Debian 的系统(包括 Ubuntu),

sudo apt update
sudo apt install xclip -y

You can also create an alias by editing ~/.bashrc or ~/.zshrc and adding the alias,
您还可以通过编辑 ~/.bashrc 或 ~/.zshrc 添加别名来创建别名。

alias pbpaste='xclip -selection clipboard -o'

Web Interface Web 界面

Fabric now includes a built-in web interface that provides a GUI alternative to the command-line interface and an out-of-the-box website for those who want to get started with web development or blogging. You can use this app as a GUI interface for Fabric, a ready to go blog-site, or a website template for your own projects.
Fabric 现在包括一个内置的 Web 界面,该界面为命令行界面提供了 GUI 替代方案,并为那些想要开始 Web 开发或博客的人提供了一个开箱即用的网站。您可以将此应用程序用作 Fabric 的 GUI 界面、现成的博客网站或您自己项目的网站模板。

The web/src/lib/content directory includes starter .obsidian/ and templates/ directories, allowing you to open up the web/src/lib/content/ directory as an Obsidian.md vault. You can place your posts in the posts directory when you're ready to publish.
该 web/src/lib/content 目录包括 starter .obsidian/ 和 templates/ directories,允许您将 web/src/lib/content/ 目录作为 Obsidian.md Vault 打开。当您准备发布时,您可以将文章放在 posts 目录中。

Installing 安装

The GUI can be installed by navigating to the web directory and using npm installpnpm install, or your favorite package manager. Then simply run the development server to start the app.
可以通过导航到 web 目录并使用 npm install 、 pnpm install 或您喜欢的包管理器来安装 GUI。然后,只需运行开发服务器即可启动应用程序。

You will need to run fabric in a separate terminal with the fabric --serve command.
您需要使用该 fabric --serve 命令在单独的终端中运行 Fabric。

From the fabric project web/ directory:
从 fabric 项目 web/ 目录:

npm run dev## or ##pnpm run dev## or your equivalent

Streamlit UI

To run the Streamlit user interface:
要运行 Streamlit 用户界面,请执行以下作:

# Install required dependencies
pip install -r requirements.txt# Or manually install dependencies
pip install streamlit pandas matplotlib seaborn numpy python-dotenv pyperclip# Run the Streamlit app
streamlit run streamlit.py

The Streamlit UI provides a user-friendly interface for:
Streamlit UI 为以下各项提供了用户友好的界面:

  • Running and chaining patterns
    运行模式和链接模式
  • Managing pattern outputs
    管理模式输出
  • Creating and editing patterns
    创建和编辑模式
  • Analyzing pattern results
    分析模式结果
Clipboard Support 剪贴板支持

The Streamlit UI supports clipboard operations across different platforms:
Streamlit UI 支持跨不同平台的剪贴板作:

  • macOS: Uses pbcopy and pbpaste (built-in)
    macOS:Uses pbcopy 和 pbpaste (built-in)
  • Windows: Uses pyperclip library (install with pip install pyperclip)
    Windows:使用 pyperclip 库(使用 pip install pyperclip )
  • Linux: Uses xclip (install with sudo apt-get install xclip or equivalent for your distro)
    Linux:使用 xclip (与您的发行版一起安装或 sudo apt-get install xclip 等效安装)

Meta 元

Note 注意

Special thanks to the following people for their inspiration and contributions!
特别感谢以下人员的启发和贡献!

  • Jonathan Dunn for being the absolute MVP dev on the project, including spearheading the new Go version, as well as the GUI! All this while also being a full-time medical doctor!
    Jonathan Dunn 是该项目的绝对 MVP 开发人员,包括带头开发新的 Go 版本以及 GUI!与此同时,他还是一名全职医生!
  • Caleb Sima for pushing me over the edge of whether to make this a public project or not.
    Caleb Sima 把我推到了是否将此项目设为公共项目的边缘。
  • Eugen Eisler and Frederick Ros for their invaluable contributions to the Go version
    Eugen Eisler 和 Frederick Ros 对 Go 版本的宝贵贡献
  • David Peters for his work on the web interface.
    David Peters 在 Web 界面方面的工作。
  • Joel Parish for super useful input on the project's Github directory structure..
    Joel Parish为项目的Github目录结构提供了超级有用的输入..
  • Joseph Thacker for the idea of a -c context flag that adds pre-created context in the ./config/fabric/ directory to all Pattern queries.
    Joseph Thacker 提出了一个 -c 上下文标志的想法, ./config/fabric/ 该标志将目录中预先创建的上下文添加到所有 Pattern 查询中。
  • Jason Haddix for the idea of a stitch (chained Pattern) to filter content using a local model before sending on to a cloud model, i.e., cleaning customer data using llama2 before sending on to gpt-4 for analysis.
    Jason Haddix 提出了拼接(链接模式)的想法,以便在发送到云模型之前使用本地模型过滤内容,即在发送到 gpt-4 进行分析之前使用 llama2 清理客户数据。
  • Andre Guerra for assisting with numerous components to make things simpler and more maintainable.
    Andre Guerra 协助了众多组件,使事情变得更简单、更易于维护。

八、软件下载

夸克网盘分享

本文信息来源于GitHub作者地址:https://github.com/danielmiessler/fabric

相关文章:

  • 关于CSDN和Github的操作
  • 安卓证书的申请(保姆级图文)
  • 基于递归思想的系统架构图自动化生成实践
  • 电子信息科学与技术专业生涯规划书-嵌入式方向(大一下)
  • 计算机组成原理:IEEE 754标准
  • Linux Shell 切换
  • 建筑八大员劳务员考试题及答案解析
  • 今日行情明日机会——20250527
  • 3.8.4 利用RDD实现分组排行榜
  • 国产化Word处理控件Spire.Doc教程:在 C# 中打印 Word 文档终极指南
  • C-自定义类型
  • 机器学习知识体系:从“找规律”到“做决策”的全过程解析
  • YoloV11改进策略:卷积篇-风车卷积-即插即用
  • RK3568DAYU开发板-平台驱动开发:ADC驱动
  • vpt_denoise
  • Python实例题:使用Python定制词云
  • Linux系统入门篇三
  • 流量红利的破局之道—深度解析OPPO应用商店 CPD广告运营
  • Python安装、pycharm配置和添加库下载
  • 【Bluedroid】init_stack_internal 函数全流程源码解析
  • 邢台网站推广/网络优化是干什么的
  • 制作网站哪家便宜/小网站关键词搜什么
  • 校园类网站建设/网站内容seo
  • 国家关于网站信息建设管理文件/口碑营销渠道
  • 今日最新疫情/北京seo外包 靠谱
  • 中国住房和城乡建设局官网/武汉seo首页优化公司