🫵 fabric

Reusable AI patterns for automating everyday text tasks

aider curl fabric fzf gh Copilot jq ollama ripgrep sgpt tmux

What Is fabric?

fabric is an open-source framework created by Daniel Miessler that solves a specific problem: you keep writing the same prompts over and over. Summarize this. Extract the key points. Write this up as a report. fabric turns those repeated prompts into reusable patterns — named, shareable, version-controlled prompt templates that you pipe text through like any other Unix tool.

The core idea is deeply Unix: do one thing well, compose with pipes. Each fabric pattern is a focused prompt that takes input from stdin and produces structured output to stdout. Chain them together, automate them with cron, wrap them in bash scripts — fabric is designed to live in your existing workflows.

For a Linux SysAdmin, fabric is most useful for the text-heavy parts of the job: summarizing documentation, extracting action items from meeting notes, drafting incident reports, analyzing log output, and building repeatable AI-assisted reporting pipelines.

"fabric's philosophy is that AI should augment your existing tools, not replace them. Patterns are just well-crafted prompts that behave like Unix filters."

💰 Cost & Licensing

fabric itself is free and open source (MIT license). Like the other tools in this series, the cost comes from the AI API backend:

Note: fabric patterns tend to be text-in, text-out operations. Token costs per run are modest — typically a few cents per pattern execution for cloud APIs.

🔧 Installation

fabric is written in Go. The easiest install for most Linux systems:

# Install via Go (requires Go 1.21+) go install github.com/danielmiessler/fabric@latest # Verify Go is installed go version # If Go is not installed (RHEL/Rocky) sudo dnf install golang # If Go is not installed (Debian/Ubuntu) sudo apt install golang

After install, run the setup to configure your API keys and default model:

fabric --setup

This walks you through entering your API key(s) and selecting a default model. Settings are stored in ~/.config/fabric/.

Install patterns

fabric ships with a large library of community patterns. Pull them all down:

fabric --updatepatterns

This populates ~/.config/fabric/patterns/ with hundreds of ready-to-use patterns.

Tip: Run fabric --listpatterns after updating to see everything available. There are patterns for summarization, extraction, analysis, writing assistance, security review, and much more.

💻 Basic Usage

The core syntax is simple — pipe text into fabric and specify a pattern:

echo "your text here" | fabric --pattern pattern_name # Or pipe from a file cat meeting-notes.txt | fabric --pattern extract_action_items # Or pipe from a command curl -s https://example.com/article | fabric --pattern summarize

Commonly useful patterns for SysAdmins

summarize

Condenses long text into key points. Useful for long documentation, RFCs, or vendor release notes.

cat /usr/share/doc/httpd/README | fabric --pattern summarize

extract_action_items

Pulls actionable tasks out of meeting notes, emails, or ticket descriptions.

cat meeting-notes.txt | fabric --pattern extract_action_items

write_essay

Turns bullet points or rough notes into polished prose. Useful for incident post-mortems or knowledge base articles.

cat incident-notes.txt | fabric --pattern write_essay

analyze_logs

Examines log output for patterns, anomalies, and recommendations.

tail -200 /var/log/messages | fabric --pattern analyze_logs

create_report

Structures raw information into a formatted report. Good for change management documentation.

cat change-request-notes.txt | fabric --pattern create_report

🧵 Writing Your Own Patterns

The real power of fabric is creating patterns tailored to your specific workflows. A pattern is just a directory with a system.md file containing your prompt.

# Create a custom pattern directory mkdir -p ~/.config/fabric/patterns/summarize_syslog # Write the pattern cat > ~/.config/fabric/patterns/summarize_syslog/system.md <<'EOF' # IDENTITY AND PURPOSE You are an expert Linux systems administrator analyzing syslog output. # STEPS - Read the provided syslog entries carefully - Identify errors, warnings, and critical events - Group related events together - Note any recurring patterns or sequences that suggest a root cause # OUTPUT - Start with a one-paragraph executive summary - List CRITICAL and ERROR events with timestamps - List WARNING events separately - Call out any repeated events and their frequency - End with recommended next investigation steps # OUTPUT FORMAT Use plain text with clear section headers. Be concise and technical. Assume the reader is an experienced SysAdmin. EOF

Use your new pattern immediately:

tail -500 /var/log/messages | fabric --pattern summarize_syslog
Tip: Store your custom patterns in a git repo. They are plain text files — version control them alongside your scripts and documentation.

🔄 Pipeline Automation

Because fabric is pipe-friendly, it drops naturally into shell pipelines and cron jobs.

Daily log digest via cron

# /usr/local/bin/daily-log-digest.sh #!/bin/bash DATE=$(date +%Y-%m-%d) REPORT_DIR=/var/reports/ai-digests mkdir -p "$REPORT_DIR" # Pull last 24h of errors, summarize, save report journalctl --since "24 hours ago" --priority=err \ | fabric --pattern summarize_syslog \ > "$REPORT_DIR/syslog-digest-${DATE}.txt" # Optional: mail it mail -s "Daily Log Digest $DATE" admin@example.edu \ < "$REPORT_DIR/syslog-digest-${DATE}.txt" # Add to crontab 0 6 * * * /usr/local/bin/daily-log-digest.sh

Incident post-mortem generator

#!/bin/bash # Generate a post-mortem draft from rough notes cat "$1" \ | fabric --pattern extract_action_items \ | fabric --pattern write_essay \ > "postmortem-draft-$(date +%Y%m%d).txt" echo "Draft saved."

Pipe YouTube transcripts through fabric

fabric includes a yt helper that pulls transcripts from YouTube videos:

# Summarize a conference talk yt --transcript "https://youtube.com/watch?v=..." | fabric --pattern summarize # Extract key technical points yt --transcript "https://youtube.com/watch?v=..." | fabric --pattern extract_wisdom

✅ Strengths & Limitations

Works Well

  • Reusable, shareable prompt patterns
  • Pure Unix pipe philosophy
  • Large built-in pattern library
  • Custom patterns are plain text files
  • Cron and automation friendly
  • Incident reports and post-mortems
  • Log summarization pipelines
  • Multiple AI backend support

Watch Out For

  • Go install requirement may be unfamiliar
  • Community patterns vary in quality
  • Large log files hit context limits
  • Output format depends on model behavior
  • Not for interactive back-and-forth (use sgpt)
  • Not for file editing (use aider)
  • Automation + AI = review your outputs

📊 Craig's Take

Of the four tools in this series, fabric is the most distinctly Unix in its philosophy. Patterns are files. Input comes from stdin. Output goes to stdout. Chain them with pipes. Automate them with cron. That's a mental model every SysAdmin already has.

The custom pattern capability is where it gets genuinely valuable for institutional work. Writing a summarize_syslog or bu_change_request pattern once means every future run uses the same carefully crafted prompt — consistent output, reproducible results, shareable with the team.

The automated daily log digest use case alone is worth the install. Getting a readable AI-generated summary of overnight errors in your inbox every morning — without writing a complex parsing script — is the kind of practical efficiency gain that justifies the tool immediately.

fabric pairs well with the other tools in this series: sgpt for interactive questions, aider for file editing, Copilot for script writing, and fabric for automating the text-processing workflows that tie everything together.

"fabric is the glue. It turns AI from something you interact with into something that works for you in the background — on your schedule, with your prompts, in your pipelines."

🔗 Resources