The project's README from github.com/danielmiessler/Fabric. As one markdown file: README.md.
Updates • What and Why • Philosophy • Installation • Usage • REST API • Examples • Just Use the Patterns • Custom Patterns • Helper Apps • Meta
Since the start of modern AI in late 2022 we've seen an extraordinary number of AI applications for accomplishing tasks. There are thousands of websites, chat-bots, mobile apps, and other interfaces for using all the different AI out there.
It's all really exciting and powerful, but it's not easy to integrate this functionality into our lives.
Fabric was created to address this by creating and organizing the fundamental units of AI—the prompts themselves!
Fabric organizes prompts by real-world task, allowing people to create, collect, and organize their most important AI solutions in a single place for use in their favorite tools. And if you're command-line focused, you can use Fabric itself as the interface!
For a deep dive into Fabric and its internals, read the documentation in the docs folder. There is also the extremely useful and regularly updated DeepWiki for Fabric.
Dear Users,
We've been doing so many exciting things here at Fabric, I wanted to give a quick summary here to give you a sense of our development velocity!
Below are the new features and capabilities we've added (newest first):
azurecommon package./swagger/index.html with comprehensive REST API documentation, enhanced developer guides, and improved endpoint discoverability for easier integration.create_conceptmap pattern for visual knowledge representation using Vis.js, introduces WELLNESS category with psychological analysis patterns, and upgrades to Claude Sonnet 4.5openai-go/azure SDK with improved authentication and default API version support--transcribe-file, --transcribe-model, and --split-media-file flags.These features represent our commitment to making Fabric the most powerful and flexible AI augmentation framework available!
Keep in mind that many of these were recorded when Fabric was Python-based, so remember to use the current install instructions below.
fabricFabric is evolving rapidly.
Stay current with the latest features by reviewing the CHANGELOG for all recent changes.
AI isn't a thing; it's a magnifier of a thing. And that thing is human creativity.
We believe the purpose of technology is to help humans flourish, so when we talk about AI we start with the human problems we want to solve.
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.
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.
One of fabric's primary features is helping people collect and integrate prompts, which we call Patterns, into various parts of their lives.
Fabric has Patterns for all sorts of life and work activities, including:
Unix/Linux/macOS:
curl -fsSL https://raw.githubusercontent.com/danielmiessler/fabric/main/scripts/installer/install.sh | bash
Windows PowerShell:
iwr -useb https://raw.githubusercontent.com/danielmiessler/fabric/main/scripts/installer/install.ps1 | iex
See scripts/installer/README.md for custom installation options and troubleshooting.
The latest release binary archives and their expected SHA256 hashes can be found at https://github.com/danielmiessler/fabric/releases/latest
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:
alias fabric='fabric-ai'
brew install fabric-ai
yay -S fabric-ai
Use the official Microsoft supported Winget tool:
winget install danielmiessler.Fabric
scoop install fabric-ai
To install Fabric, make sure Go is installed, and then run the following command.
# Install Fabric directly from the repo
go install github.com/danielmiessler/fabric/cmd/fabric@latest
Run Fabric using pre-built Docker images:
# Use latest image from Docker Hub
docker run --rm -it kayvan/fabric:latest --version
# Use specific version from GHCR
docker run --rm -it ghcr.io/ksylvan/fabric:v1.4.305 --version
# Run setup (first time)
mkdir -p $HOME/.fabric-config
docker run --rm -it -v $HOME/.fabric-config:/home/appuser/.config/fabric kayvan/fabric:latest --setup
# Use Fabric with your patterns
docker run --rm -it -v $HOME/.fabric-config:/home/appuser/.config/fabric kayvan/fabric:latest -p summarize
# Run the REST API server (see REST API Server section)
docker run --rm -it -p 8080:8080 -v $HOME/.fabric-config:/home/appuser/.config/fabric kayvan/fabric:latest --serve
Images available at:
See scripts/docker/README.md for building custom images and advanced configuration.
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:
For Intel based macs or 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
# Golang environment variables
export GOROOT=$(brew --prefix go)/libexec
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$HOME/.local/bin:$PATH
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.
Fabric supports a wide range of AI providers:
Native Integrations:
OpenAI-Compatible Providers:
Run fabric --setup to configure your preferred provider(s), or use fabric --listvendors to see all available vendors.
You can configure specific models for individual patterns using environment variables
like FABRIC_MODEL_PATTERN_NAME=vendor|model
This makes it easy to maintain these per-pattern model mappings in your shell startup files.
In order to add aliases for all your patterns and use them directly as commands, for example, summarize instead of fabric --pattern summarize
You can add the following to your .zshrc or .bashrc file. You
can also optionally set the FABRIC_ALIAS_PREFIX environment variable
before, if you'd prefer all the fabric aliases to start with the same prefix.
# 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")"
alias_name="${FABRIC_ALIAS_PREFIX:-}${pattern_name}"
# Create an alias in the form: alias pattern_name="fabric --pattern pattern_name"
alias_command="alias $alias_name='fabric --pattern $pattern_name'"
# Evaluate the alias command to add it to the current shell
eval "$alias_command"
done
yt() {
if [ "$#" -eq 0 ] || [ "$#" -gt 2 ]; then
echo "Usage: yt [-t | --timestamps] youtube-link"
echo "Use the '-t' flag to get the transcript with timestamps."
return 1
fi
transcript_flag="--transcript"
if [ "$1" = "-t" ] || [ "$1" = "--timestamps" ]; then
transcript_flag="--transcript-with-timestamps"
shift
fi
local 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:
# Path to the patterns directory
$patternsPath = Join-Path $HOME ".config/fabric/patterns"
foreach ($patternDir in Get-ChildItem -Path $patternsPath -Directory) {
# Prepend FABRIC_ALIAS_PREFIX if set; otherwise use empty string
$prefix = $env:FABRIC_ALIAS_PREFIX ?? ''
$patternName = "$($patternDir.Name)"
$aliasName = "$prefix$patternName"
# Dynamically define a function for each pattern
$functionDefinition = @"
function $aliasName {
[CmdletBinding()]
param(
[Parameter(ValueFromPipeline = `$true)]
[string] `$InputObject,
[Parameter(ValueFromRemainingArguments = `$true)]
[String[]] `$patternArgs
)
begin {
# Initialize an array to collect