This directory contains various examples demonstrating different capabilities of COMandA. The examples are organized into categories based on their primary functionality.
Examples demonstrating parallel execution of independent steps:
parallel-inference.yaml- Run multiple model inferences in parallel and compare resultsparallel-model-comparison.yaml- Compare stories generated by different models in parallelparallel-data-processing.yaml- Process the same data in different ways simultaneously
# Example of parallel processing structure
parallel-process:
step_one:
input:
- NA
model: gpt-4o
action:
- write a sonnet about network cables
output:
- examples/sonnet1.txt
step_two:
input:
- NA
model: claude-3-5-sonnet-latest
action:
- write a sonnet about network cables
output:
- examples/sonnet2.txt
step_three:
input:
- examples/sonnet1.txt
- examples/sonnet2.txt
model: gpt-4o-mini
action:
- compare these two sonnets and rate them
output: STDOUTExamples demonstrating how to leverage Claude Code, Gemini CLI, and OpenAI Codex together:
architecture-planning.yaml- Parallel analysis with synthesis for comprehensive architecture designarchitecture-review.yaml- Sequential refinement where each agent improves the previous workarchitecture-decision.yaml- Voting/consensus pattern for specific architectural decisions
# Example: Parallel multi-agent analysis
parallel-process:
claude-analysis:
input: STDIN
model: claude-code
action: "Analyze system design aspects"
output: $CLAUDE_RESULT
gemini-analysis:
input: STDIN
model: gemini-cli
action: "Analyze patterns and best practices"
output: $GEMINI_RESULT
codex-analysis:
input: STDIN
model: openai-codex
action: "Analyze implementation structure"
output: $CODEX_RESULT
synthesize:
input: |
Claude: $CLAUDE_RESULT
Gemini: $GEMINI_RESULT
Codex: $CODEX_RESULT
model: claude-code
action: "Synthesize into unified recommendation"
output: STDOUTUsage:
echo "Design a real-time collaborative editor" | comanda process multi-agent/architecture-planning.yamlExamples demonstrating server functionality and STDIN input:
-
stdin-example.yaml- Shows STDIN input usage with server POST requests# Can be processed via HTTP POST with input string analyze_text: input: STDIN # Makes YAML eligible for POST requests model: gpt-4o action: "Analyze the following text and provide key insights:" output: STDOUT
Process via server:
# Using query parameter curl -X POST "http://localhost:8080/process?filename=server-examples/stdin-example.yaml&input=your text here" # Using JSON body curl -X POST \ -H "Content-Type: application/json" \ -d '{"input":"your text here"}' \ "http://localhost:8080/process?filename=server-examples/stdin-example.yaml"
This server example also demonstrates how comanda can be used as part of a comand line data pipe:
cat text.txt|comanda process stdin-example.yaml
Examples demonstrating database integration:
db-example.yaml- Database read/write operationssimpledb.sql- Sample database schema and data- Supporting files:
Dockerfilefor test environment
To start up the docker container for testing the database examples, run the following commands (after installing Docker)
cd examples/database-connections/postgres
docker build -t comanda-postgres .
docker run -d -p 5432:5432 comanda-postgresExamples demonstrating integration with different AI models:
openai-example.yaml- Basic OpenAI integration exampleollama-example.yaml- Using local Ollama modelsanthropic-pdf-example.yaml- Using Anthropic's Claude model with PDF processinggoogle-example.yaml- Integration with Google's AI modelsxai-example.yaml- X.AI model integration example
Examples of file manipulation and processing:
analyze-csv.yaml- Processing CSV databatch-processing-example.yaml- Safely processing multiple files with error handlingconsolidate-example.yaml- Combining multiple filesmulti-file-example.yaml- Working with multiple fileswildcard-example.yaml- Using wildcard patterns to process multiple files- Supporting files:
harvey1.txt,harvey2.txt,consolidated.txt,test.csv
Examples of web interaction and scraping:
scrape-example.yaml- Web scraping functionalityurl-example.yaml- Working with URLsscreenshot-example.yaml- Taking screenshots of web pagesscrape-file-example.yaml- File-based scraping configuration
Examples of working with various document formats:
xml-example.yaml- XML file handlinggoogle-xml-example.yaml- Google model XML processingmarkdown-action-example.yaml- Markdown file processingtest-action.md- Example markdown action file- Supporting files:
input.xml,output.xml,sample.pdf
Examples of image-related operations:
image-example.yaml- Basic image processing capabilities- Supporting files:
image.jpeg
Examples demonstrating shell command execution within workflows:
tool-input-example.yaml- Use shell commands as step input (ls,find,date)tool-output-example.yaml- Pipe step output through commands (jq,grep,awk)beads-workflow-example.yaml- Integration with thebd(beads) issue trackerbeads-walkthrough.yaml- Walkthrough: spec analysis → issue previewconveyor-belt-spec-to-beads.yaml- Full automation: spec → bd create executionsample-spec.md- Sample technical spec for testing
# Example: Using tools in workflows
list_issues:
input: "tool: bd list --json"
model: NA
action:
- Pass through the JSON data
output: STDOUT
tool:
allowlist: [bd]
# Example: Pipe output through jq
filter_json:
input: data.json
model: NA
action:
- Return the JSON
output: "tool: jq '.items[] | select(.active)'"
tool:
allowlist: [jq]Security: Tool execution is controlled by allowlist/denylist. Safe commands like ls, grep, jq, bd are allowed by default. Dangerous commands like rm, sudo, curl are blocked.
You can run any example using:
comanda process examples/[category]/[example-file].yamlFor instance:
comanda process examples/model-examples/openai-example.yamlEach example includes comments explaining its functionality and any specific requirements (like API keys or local model setup).
-
Basic Examples: Start with these to understand core functionality
model-examples/openai-example.yamlmodel-examples/ollama-example.yamlserver-examples/stdin-example.yaml(server POST integration)
-
Advanced Examples: Demonstrate more complex features
file-processing/consolidate-example.yaml(multi-file processing)web-scraping/screenshot-example.yaml(browser interaction)document-processing/markdown-action-example.yaml(external action files)database-connections/db-example.yaml(database operations)parallel-processing/parallel-model-comparison.yaml(parallel execution)
-
Integration Examples: Show provider-specific features
model-examples/anthropic-pdf-example.yaml(PDF processing)model-examples/google-example.yaml(Google AI integration)model-examples/xai-example.yaml(X.AI integration)
-
Multi-Agent Examples: Combine multiple agentic coding tools
multi-agent/architecture-planning.yaml(parallel analysis + synthesis)multi-agent/architecture-review.yaml(sequential refinement)multi-agent/architecture-decision.yaml(voting/consensus ADRs)
-
Data Examples: Demonstrate data processing capabilities
database-connections/postgres/db-example.yaml(database operations)parallel-processing/parallel-data-processing.yaml(parallel data analysis)
-
Server Examples: Show HTTP server functionality
server-examples/stdin-example.yaml(POST request with string input)
# Check if YAML supports POST curl "http://localhost:8080/list" # Process with POST if supported curl -X POST \ -H "Content-Type: application/json" \ -d '{"input":"analyze this text"}' \ "http://localhost:8080/process?filename=server-examples/stdin-example.yaml"
-
Tool Use Examples: Execute shell commands in workflows
tool-use/tool-input-example.yaml(use commands as input)tool-use/tool-output-example.yaml(pipe output through commands)tool-use/beads-workflow-example.yaml(integrate with external CLIs)tool-use/beads-walkthrough.yaml(spec → issues workflow)
A Docker environment is provided for testing database operations:
cd examples/database-connections/postgres
docker build -t comanda-postgres .
docker run -d -p 5432:5432 comanda-postgresThis creates a PostgreSQL database with sample customer and order data.
Feel free to add new examples! When contributing:
- Place your example in the appropriate category directory
- Include clear comments in your YAML file
- Update this README with a description of your example
- Include any necessary supporting files
