FabricPrompt is a simple and effective command-line tool written in Go that serves as a wrapper for Fabric, an open-source framework for augmenting human capabilities using AI.
FabricPrompt simplifies interaction with Fabric by offering a user-friendly interface to select and run Fabric patterns directly from the terminal. It supports input from both standard input and clipboard, making it flexible for various use cases. And most important, allows you to choose pattern with a fuzzyfinder instead of forcing you to know them by heart.
- Run Fabric patterns directly from the command line
- Support for input from stdin or directly inputting a prompt
- Interactive pattern selector with fuzzy search
- Ability to add extra context from a file
- Option to save output to a file
- Real-time streaming of results
- Easy integration with other command-line tools
You can find tha latest built versions here: https://github.com/ndit-dev/FabricPrompt/actions/workflows/build.yml
To build FabricPrompt from source, follow these steps:
-
Clone the repository:
git clone https://github.com/ndit-dev/FabricPrompt.git cd FabricPrompt
-
Build the binary: Make sure you have Go installed on your system. You can download and install it from the official Go website.
go build -o fabricp
-
Move the binary to your PATH: Move the compiled binary to a directory that is in your system's PATH. For example, you can move it to
/usr/local/bin
:sudo mv fabricp /usr/local/bin/
-
Verify the installation: Ensure that the binary is accessible from your terminal by running:
fabricp --help
You should see the help message for FabricPrompt.
- Ensure you have Fabric installed and properly configured on your system.
type fabricp
in your console after installation
You can pipe text directly to FabricPrompt, and it will use the piped text as input instead of prompting for user input or using the clipboard, just as you do with fabric normally. For example:
echo "your text here" | fabricp
This is the best way to pipe your clipboard to fabricp since it's inputfield is very simple and limitied.
pbpaste | fabricp
By doing this you are still able to benefin from the fuzzy finder in fabricp as well as the the rest of the interface
FabricPrompt uses configuration files from Fabric. Make sure you have Fabric properly configured on your system.
Contributions to FabricPrompt are welcome! However, at this stage, I am not sure if I will actively develop this further. I created this tool to make my everyday interaction with Fabric smoother. Ideally, this serves as inspiration for the original Fabric project, where similar functionality could be incorporated as a switch or similar feature.
But please follow these steps if you would like to contribute:
- Fork the repository
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Here are some additional features I'm considering for future updates:
- Add an option for users to save output directly to the clipboard.
- Provide an option to display output using
batcat
,mdcat
, or natively within this Go program for better markdown readability. - Extend support for more of Fabric's switched options.
- Implement a configuration file or environment variables to allow users to define default options and the default path for Fabric patterns.
- Avoid hardcoding the path to Fabric patterns; instead, dynamically determine their installation path and use it.
This project is licensed under the MIT License.
This project is built upon the amazing Fabric by Daniel Miessler. If you ended up here without knowing what Fabric is, you should start by looking at that project. This is merely a wrapper to make everyday usage more convenient.