fabric crowd sources prompts, gptel is a versatile LLM client for emacs. I wanted fabric prompts to be usable via gptel.
- pickup the fabric patterns subdirectory via a no-cone sparse checkout
- filter patterns that have a system prompt available based on a “system.md exists” predicate
- a completing read then allows to hit gptel-send with the selected pattern, without altering your existing custom gptel-message
In your packages.el, after your gptel fetch:
(package! fabric-gpt.el
:recipe (:host github :repo "/rajp152k/fabric-gpt.el"))
In your config.el, after your gptel config:
(use-package! fabric-gpt.el
:after gptel
:config
(setq fabric-gpt.el-root "<root dir to cache fabric patterns>")
(fabric-gpt.el-sync-patterns))
This is the primary exposure for utilizing fabric patterns.
I would recommend you bind (fabric-gptel-send)
to something handy, I use “leader i g f f” as it is mnemonically aligned with what gptel exposes via “leader i g [hsm]”
Upon invocation, a completing read will ask for the desired pattern (with all the bells and whistles of your favourite completion engine (I’m using vertico))
I bind (fabric-gpt.el-sync-patterns)
to “leader i g f s” to fetch any new patterns from the fabric upstream
These are pulled into your <fabric-gpt.el-root>/fabric
- better documentation
- youtube tutorial
- testing and polishing the edges
- suggestions, ideas, bug reports, PRs welcome
- I do need to refine this a lot