danielmiessler/Fabric
fabric
fabric is an open-source framework for augmenting humans using AI.
Updates • What and Why • Philosophy • Installation • Usage • Examples • Just Use the Patterns • Custom Patterns • Helper Apps • Meta

What and why
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.
In other words, AI doesn't have a capabilities problem—it has an integration problem.
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!
Intro videos
Keep in mind that many of these were recorded when Fabric was Python-based, so remember to use the current install instructions below.
Navigation
fabric- What and why
- Intro videos
- Navigation
- Updates
- Philosophy
- Installation
- Usage
- Our approach to prompting
- Examples
- Just use the Patterns
- Custom Patterns
- Helper Apps
- pbpaste
- Web Interface
- Meta
Updates
[!NOTE]
June 17, 2025
Fabric now supports Perplexity AI. Configure it by using
fabric -Sto add your Perplexity AI API Key, and then try:
1fabric -m sonar-pro "What is the latest world news?"June 11, 2025
- Fabric’s YouTube transcription now needs
yt-dlpto be installed. Make sure to install the latest version (2025.06.09 as of this note). The YouTube API key is only needed for comments (the--commentsflag) and metadata extraction (the--metadataflag).
Philosophy
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.
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.
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.
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:
- Extracting the most interesting parts of YouTube videos and podcasts
- 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
- 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
To install Fabric, you can use the latest release binaries or install it from the source.
Get Latest Release Binaries
Windows
https://github.com/danielmiessler/fabric/releases/latest/download/fabric-windows-amd64.exe
macOS (arm64)
curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-darwin-arm64 > fabric && chmod +x fabric && ./fabric --version
macOS (amd64)
curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-darwin-amd64 > fabric && chmod +x fabric && ./fabric --version
Linux (amd64)
curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-linux-amd64 > fabric && chmod +x fabric && ./fabric --version
Linux (arm64)
curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-linux-arm64 > fabric && chmod +x fabric && ./fabric --version
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:
|
|
macOS (Homebrew)
brew install fabric-ai
Arch Linux (AUR)
yay -S fabric-ai
From Source
To install Fabric, make sure Go is installed, and then run the following command.
|
|
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:
For Intel based macs or linux
|
|
for Apple Silicon based macs
|
|
Setup
Now run the following command
|
|
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.
|
|
You can add the below code for the equivalent aliases inside PowerShell by running notepad $PROFILE inside a PowerShell window:
|
|
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.
Save your files in markdown using aliases
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:
|
|
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.
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.
|
|
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.
|
|
Shell Completions
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.
Zsh Completion
To enable Zsh completion:
|
|
Bash Completion
To enable Bash completion:
|
|
Fish Completion
To enable Fish completion:
|
|
Usage
Once you have it all set up, here’s how to use it.
|
|
|
|
Our approach to prompting
Fabric Patterns are different than most prompts you’ll see.
- First, we use
Markdownto 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!
Here’s an example of a Fabric Pattern.
|
|
-
Next, we are extremely clear in our instructions, and we use the Markdown structure to emphasize what we want the AI to do, and in what order.
-
And finally, we tend to use the System section of the prompt almost exclusively. In over a year of being heads-down with this stuff, we’ve just seen more efficacy from doing that. If that changes, or we’re shown data that says otherwise, we will adjust.
Examples
The following examples use the macOS
pbpasteto paste from the clipboard. See the pbpaste section below for Windows and Linux alternatives.
Now let’s look at some things you can do with Fabric.
-
Run the
summarizePattern based on input fromstdin. In this case, the body of an article.1pbpaste | fabric --pattern summarize -
Run the
analyze_claimsPattern with the--streamoption to get immediate and streaming results.1pbpaste | fabric --stream --pattern analyze_claims -
Run the
extract_wisdomPattern with the--streamoption to get immediate and streaming results from any Youtube video (much like in the original introduction video).1fabric -y "https://youtube.com/watch?v=uXs-zPc63kM" --stream --pattern extract_wisdom -
Create patterns- you must create a .md file with the pattern and save it to
~/.config/fabric/patterns/[yourpatternname]. -
Run a
analyze_claimspattern on a website. Fabric uses Jina AI to scrape the URL into markdown format before sending it to the model.1fabric -u https://github.com/danielmiessler/fabric/ -p analyze_claims
Just use the 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!
We hope that if you used nothing else from Fabric, the Patterns by themselves will make the project useful.
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.
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.
See the Thinking Faster by Writing Less paper and the Thought Generation section of Learn Prompting for examples of prompt strategies.
Each strategy is available as a small json file in the /strategies directory.
The prompt modification of the strategy is applied to the system prompt and passed on to the LLM in the chat session.
Use fabric -S and select the option to install the strategies in your ~/.config/fabric directory.
Custom Patterns
You may want to use Fabric to create your own custom Patterns—but not share them with others. No problem!
Just make a directory in ~/.config/custompatterns/ (or wherever) and put your .md files in there.
When you’re ready to use them, copy them into ~/.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.
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:
to_pdf
to_pdf is a helper command that converts LaTeX files to PDF format. You can use it like this:
|
|
This will create a PDF file from the input LaTeX file in the same directory.
You can also use it with stdin which works perfectly with the write_latex pattern:
|
|
This will create a PDF file named output.pdf in the current directory.
to_pdf Installation
To install to_pdf, install it the same way as you install Fabric, just with a different repo name.
|
|
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.
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.
See the Create Coding Feature Pattern README for details.
Install it first using:
|
|
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.
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,
|
|
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,
|
|
You can also create an alias by editing ~/.bashrc or ~/.zshrc and adding the alias,
|
|
Web Interface
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.
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.
Installing
The GUI can be installed by navigating to the web directory and using npm install, pnpm install, or your favorite package manager. Then simply run the development server to start the app.
You will need to run fabric in a separate terminal with the fabric --serve command.
From the fabric project web/ directory:
|
|
Streamlit UI
To run the Streamlit user interface:
|
|
The Streamlit UI provides a user-friendly interface for:
- 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:
- macOS: Uses
pbcopyandpbpaste(built-in) - Windows: Uses
pypercliplibrary (install withpip install pyperclip) - Linux: Uses
xclip(install withsudo apt-get install xclipor equivalent for your Linux distribution)
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!
- Caleb Sima for pushing me over the edge of whether to make this a public project or not.
- Eugen Eisler and Frederick Ros for their invaluable contributions to the Go version
- David Peters for his work on the web interface.
- Joel Parish for super useful input on the project’s Github directory structure..
- Joseph Thacker for the idea of a
-ccontext flag that adds pre-created context in the./config/fabric/directory to all Pattern queries. - 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
llama2before sending on togpt-4for analysis. - Andre Guerra for assisting with numerous components to make things simpler and more maintainable.
Primary contributors
Contributors
Made with contrib.rocks.
fabric was created by Daniel Miessler in January of 2024.