This directory contains various examples demonstrating different capabilities of COMandA. The examples are organized into categories based on their primary functionality.
Examples 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:
Dockerfile
for 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-postgres
Examples 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 dataconsolidate-example.yaml
- Combining multiple filesmulti-file-example.yaml
- Working with 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
You can run any example using:
comanda process examples/[category]/[example-file].yaml
For instance:
comanda process examples/model-examples/openai-example.yaml
Each 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.yaml
model-examples/ollama-example.yaml
server-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)
-
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)
-
Data Examples: Demonstrate data processing capabilities
- 'database-connections/postgres/db-example.yaml' (database operations)
-
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"
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-postgres
This 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