diff --git a/src/cmdforge/web/docs_content.py b/src/cmdforge/web/docs_content.py index 150f4aa..b246b4d 100644 --- a/src/cmdforge/web/docs_content.py +++ b/src/cmdforge/web/docs_content.py @@ -2414,6 +2414,822 @@ application that lets you create, edit, and manage tools with a visual interface ("next-up", "Next Up"), ], }, + + "registry-usage": { + "title": "Discovering Community Tools", + "description": "Find, install, and use tools created by the community", + "content": """ +
Why build everything from scratch? The CmdForge Registry is a treasure trove of +ready-to-use tools built by developers just like you. In minutes, you can have a fully-equipped +command line without writing a single line of YAML.
+ +What You'll Learn
+Think of the registry as an app store for your terminal. Every tool has been reviewed, tested, +and is ready to use. There are two ways to explore:
+ +Visual Builder
+Run cmdforge and click Registry
+ in the sidebar. Browse by category, search by keyword, and install with one click.
Command Line
+Use cmdforge registry search for quick
+ lookups when you know what you want.
# Search by keyword
+cmdforge registry search "code review"
+
+# Browse a category
+cmdforge registry search --category Developer
+
+# Find popular tools
+cmdforge registry search --sort downloads
+
+# Combine filters
+cmdforge registry search "translate" --category Text --sort downloads
+
+Each result shows you the tool name, author, description, and download count—everything you need to decide if it's right for you.
+ +Found something you like? Installation is one command:
+ +# Install a tool
+cmdforge registry install official/summarize
+
+# Install a specific version
+cmdforge registry install official/summarize@1.2.0
+
+# Install multiple tools at once
+cmdforge registry install official/summarize official/translate official/fix-grammar
+
+That's it. The tool is now available as a command. Try it:
+ +# Use your newly installed tool
+echo "The quick brown fox jumps over the lazy dog" | summarize
+
+What Just Happened?
+CmdForge downloaded the tool config to ~/.cmdforge/summarize/
+ and created a wrapper script in ~/.local/bin/. The tool is now part of your system
+ just like grep or cat.
Not sure what a tool does? Peek inside before you commit:
+ +# View tool details
+cmdforge registry info official/explain-code
+
+# See what you'll get:
+# - Description
+# - Available arguments
+# - Required providers
+# - Version history
+# - Download count
+
+In the Visual Builder, just click on any tool to see its full details in the right panel.
+ +Every installed tool works like a Unix command. The universal pattern:
+ +# Pipe input
+cat file.txt | toolname
+
+# Pass a file directly
+toolname file.txt
+
+# Use arguments
+cat file.txt | toolname --flag value
+
+# Chain tools together
+cat article.txt | summarize | translate --lang Spanish
+
+Every tool comes with built-in help:
+ +# See what arguments a tool accepts
+summarize --help
+
+# Output:
+# Usage: summarize [OPTIONS] [INPUT]
+#
+# Summarize text using AI
+#
+# Options:
+# --max-length TEXT Maximum summary length in words [default: 200]
+# --provider TEXT Override the AI provider
+# --help Show this message
+
+# See everything you have installed
+cmdforge list
+
+# Filter by category
+cmdforge list --category Developer
+
+# Check for updates
+cmdforge registry check-updates
+
+# Update a specific tool
+cmdforge registry install official/summarize@latest
+
+# Update all tools (coming soon)
+cmdforge registry update-all
+
+# Remove a tool you no longer need
+cmdforge delete summarize
+
+Registry tools specify which AI provider they use. If you don't have that provider configured, +you have two options:
+ +Option 1: Configure the Provider
+Follow our Providers Guide + to set up the required provider.
+Option 2: Override at Runtime
+Use a provider you already have:
+ cat file.txt | summarize --provider ollama
Not sure where to begin? Install our curated starter pack:
+ +# Install the essentials
+cmdforge collections install starter
+
+This gives you:
+ +| Tool | +What It Does | +
|---|---|
summarize |
+ Condense long text into key points | +
translate |
+ Translate to any language | +
fix-grammar |
+ Fix spelling and grammar issues | +
explain-error |
+ Decode cryptic error messages | +
commit-msg |
+ Generate commit messages from diffs | +
Now that you've got tools from the registry:
+ +Here's a secret that changes everything: tools can call other tools. That
+summarize command you installed from the registry? You can use it as a building
+block inside your own creations. It's like having LEGO bricks that already do something cool.
What You'll Learn
+tool step type and when to use itLet's say you want a tool that:
+You could write three prompt steps from scratch. Or you could stand on the shoulders +of giants and reuse tools that already exist:
+ +name: spanish-summary
+version: "1.0.0"
+description: Summarize text and translate to Spanish
+
+steps:
+ - type: tool
+ tool: summarize
+ output_var: summary
+
+ - type: tool
+ tool: translate
+ input: "{summary}"
+ args:
+ lang: Spanish
+ output_var: translated
+
+ - type: tool
+ tool: fix-grammar
+ input: "{translated}"
+ output_var: final
+
+output: "{final}"
+
+Three lines per step. Each one leverages a battle-tested tool from the registry. The prompts, +the edge cases, the provider configs—all handled.
+ +The Power of Composition
+When the summarize tool gets updated with better prompts,
+ your tool automatically benefits. You're not copying code—you're building on it.
A tool step has four parts:
+ +- type: tool # This is a tool step
+ tool: owner/name # Which tool to call (or just "name" for local tools)
+ input: "{variable}" # What to send as input (optional, defaults to {input})
+ args: # Arguments to pass (optional)
+ flag-name: value
+ output_var: result # Where to store the output
+
+| Field | +Required | +Description | +
|---|---|---|
type |
+ Yes | +Must be tool |
+
tool |
+ Yes | +Tool name or owner/name for registry tools |
+
input |
+ No | +Input template (defaults to {input}) |
+
args |
+ No | +Key-value pairs for tool arguments | +
output_var |
+ Yes | +Variable name to store the result | +
The input field supports variable substitution, just like prompt templates:
steps:
+ # Step 1: Use original input
+ - type: tool
+ tool: extract-keywords
+ input: "{input}" # The original stdin input
+ output_var: keywords
+
+ # Step 2: Use output from step 1
+ - type: tool
+ tool: expand-topic
+ input: "{keywords}" # Output from previous step
+ output_var: expanded
+
+ # Step 3: Combine multiple variables
+ - type: tool
+ tool: write-article
+ input: |
+ Topic: {keywords}
+
+ Research:
+ {expanded}
+ output_var: article
+
+Most tools accept arguments. Pass them through the args field:
- type: tool
+ tool: translate
+ input: "{input}"
+ args:
+ lang: French # --lang French
+ formal: "true" # --formal true
+ output_var: french_text
+
+Variable Arguments
+Arguments can use variables too! This is incredibly powerful:
+args:
+ lang: "{target_language}" # From a previous step or tool argument
+You can call both your own tools and registry tools:
+ +steps:
+ # Call a local tool (in your ~/.cmdforge/)
+ - type: tool
+ tool: my-custom-extractor
+ output_var: extracted
+
+ # Call a registry tool
+ - type: tool
+ tool: official/summarize
+ input: "{extracted}"
+ output_var: summary
+
+Chain tools in sequence, each transforming the output of the last:
+ +name: polish-writing
+description: Clean up rough drafts
+
+steps:
+ - type: tool
+ tool: fix-grammar
+ output_var: fixed
+
+ - type: tool
+ tool: simplify
+ input: "{fixed}"
+ args:
+ level: "high school"
+ output_var: simple
+
+ - type: tool
+ tool: tone-shift
+ input: "{simple}"
+ args:
+ tone: professional
+ output_var: polished
+
+output: "{polished}"
+
+Send the same input to multiple tools, then combine results:
+ +name: multi-perspective
+description: Get analysis from different angles
+
+steps:
+ - type: tool
+ tool: summarize
+ output_var: summary
+
+ - type: tool
+ tool: extract-keywords
+ input: "{input}" # Same original input
+ output_var: keywords
+
+ - type: tool
+ tool: sentiment-analysis
+ input: "{input}" # Same original input
+ output_var: sentiment
+
+ - type: prompt
+ provider: claude
+ prompt: |
+ Combine these analyses into a report:
+
+ Summary: {summary}
+ Keywords: {keywords}
+ Sentiment: {sentiment}
+ output_var: report
+
+output: "{report}"
+
+Use code steps to route data to different tools:
+ +name: smart-translate
+description: Only translate if not already in English
+
+steps:
+ - type: tool
+ tool: detect-language
+ output_var: detected_lang
+
+ - type: code
+ code: |
+ needs_translation = detected_lang.strip().lower() != "english"
+ output_vars: [needs_translation]
+
+ - type: tool
+ tool: translate
+ input: "{input}"
+ args:
+ lang: English
+ output_var: translated
+ # Note: Tool runs but you can use code to choose output
+
+ - type: code
+ code: |
+ if needs_translation:
+ result = translated
+ else:
+ result = input
+ output_vars: [result]
+
+output: "{result}"
+
+Need to use a different AI provider than what the tool specifies? Override it:
+ +- type: tool
+ tool: summarize
+ provider: ollama # Use local Ollama instead of cloud
+ output_var: summary
+
+When things go wrong, test each tool step individually:
+ +# Test the first tool manually
+echo "your input" | summarize
+
+# Check what's going into step 2
+echo "your input" | summarize | cat
+
+# Then test step 2
+echo "output from step 1" | translate --lang Spanish
+
+Or use the Testing Sandbox in the Visual Builder to step through each tool interactively.
+ +There's nothing worse than deploying a tool and watching it fail on real data. +The Testing Sandbox lets you run individual steps, inspect variables, and squash bugs—all +without burning through API credits or waiting for full pipeline runs.
+ +What You'll Learn
+Imagine a 5-step tool that's failing. Is it step 1? Step 4? The output template? Running +the whole thing over and over is slow and expensive. Step-by-step testing lets you:
+ +Isolate Problems
+Test one step at a time
+Save Money
+Only call APIs when ready
+Iterate Fast
+Quick feedback loops
+The Testing Sandbox is built into the Visual Builder. Here's how to access it:
+ +cmdforgeThe Testing Sandbox dialog opens with everything you need:
+ +Input Section
+Output Section
+Prompt steps call your AI provider. Here's how to test one:
+ +In the input text area, enter the text you want to process:
+ +The quick brown fox jumps over the lazy dog.
+This is a sample sentence for testing purposes.
+
+If your prompt uses variables like {language} or {max_length},
+fill them in the variables table:
| Variable | +Value | +
|---|---|
input |
+ (auto-filled from test input) | +
language |
+ Spanish | +
max_length |
+ 100 | +
Select which provider to use for this test. You can:
+mock for testing without API callsClick Run Test and watch the magic happen. You'll see:
+ +output_varCode steps run Python. The sandbox lets you verify your logic:
+ +Code steps often depend on outputs from previous steps. Enter those values manually:
+ +| Variable | +Value | +
|---|---|
emails_raw |
+ john@example.com, jane@example.com, invalid-email | +
count |
+ 3 | +
After running, you'll see every variable your code step creates:
+ +emails = ['john@example.com', 'jane@example.com']
+unique_count = 2
+is_valid = True
+
+Debugging Tip
+If your code step isn't working, add temporary print()
+ statements. The output will appear in the error/output section, helping you trace what's happening.
Tool steps call other tools. Testing them works the same way:
+ +This is incredibly useful for debugging composed tools—you can verify each tool in the chain +is receiving and producing the right data.
+ +Don't want to burn through API credits while iterating? Use the mock provider:
+ +Select mock from the provider dropdown before running your test.
Add a mock provider that returns realistic test data:
+ +# In ~/.cmdforge/providers.yaml
+providers:
+ - name: mock
+ command: 'echo "This is a mock response for testing"'
+
+ - name: mock-json
+ command: 'echo "{\"status\": \"ok\", \"count\": 42}"'
+
+ - name: mock-summary
+ command: 'echo "This is a summary of the input text."'
+
+Pro Tip: Echo the Input
+For testing variable flow, create a mock that echoes its input:
+- name: echo-mock
+ command: 'cat' # Just returns whatever is piped in
+Check these in order:
+output_var matches what you're using){varname} not $varname)Verify:
+~/.cmdforge/providers.yaml?echo "test" | claude -pThe error message shows the Python exception. Common causes:
+Here's how the pros do it:
+ +