Overview
Dakora provides a comprehensive CLI for managing templates, executing prompts, and comparing model outputs without writing any Python code.
Installation
The CLI is automatically available after installing Dakora:
Verify installation:
Commands
dakora init
Initialize a new Dakora project in the current directory.
Creates:
dakora.yaml - Project configuration file
prompts/ - Directory for template files
prompts/summarizer.yaml - Example template to get started
dakora list
List all available templates in the project.
Output:
summarizer
greeting
code-reviewer
dakora get
Display the raw template content for a specific template.
Example:
Output:
Summarize the following into exactly 3 bullet points:
{{ input_text }}
dakora run
Execute a template against a single LLM model.
dakora run <template-id> --model <model> [OPTIONS]
Required Arguments:
<template-id> - ID of the template to execute
--model, -m - Model to use (e.g., gpt-4, claude-3-opus)
- Template-specific inputs as flags (e.g.,
--input-text "...")
Optional Arguments:
--config - Config file path (default: dakora.yaml)
--temperature, -t - Sampling temperature (0.0-2.0)
--max-tokens - Maximum tokens to generate
--top-p - Nucleus sampling probability
--json - Output raw JSON result
--quiet, -q - Only output response text
Examples:
Basic execution:
dakora run summarizer \
--model gpt-4 \
--input-text "Long article text here..."
With LLM parameters:
dakora run summarizer \
--model gpt-4 \
--input-text "Article..." \
--temperature 0.7 \
--max-tokens 150
JSON output:
dakora run summarizer \
--model gpt-4 \
--input-text "Article..." \
--json
Output (default):
╭─────────────────────────────────────╮
│ Model: gpt-4 (openai) │
│ Cost: $0.0045 USD │
│ Latency: 1,234 ms │
│ Tokens: 150 → 80 │
╰─────────────────────────────────────╯
The article discusses the recent advances...
dakora compare
Compare template execution across multiple LLM models in parallel.
dakora compare <template-id> --models <model1>,<model2>,... [OPTIONS]
Required Arguments:
<template-id> - ID of the template to execute
--models, -m - Comma-separated list of models
- Template-specific inputs as flags
Optional Arguments:
--config - Config file path (default: dakora.yaml)
--temperature, -t - Sampling temperature (applies to all models)
--max-tokens - Maximum tokens to generate
--top-p - Nucleus sampling probability
--json - Output raw JSON result
--verbose, -v - Show full responses (not truncated)
Examples:
Basic comparison:
dakora compare summarizer \
--models gpt-4,claude-3-opus,gemini-pro \
--input-text "Article to summarize..."
With temperature control:
dakora compare summarizer \
--models gpt-4,claude-3-opus \
--input-text "Article..." \
--temperature 0.3
Verbose output (full responses):
dakora compare summarizer \
--models gpt-4,claude-3-opus \
--input-text "Article..." \
--verbose
JSON output:
dakora compare summarizer \
--models gpt-4,claude-3-opus \
--input-text "Article..." \
--json
Output (default):
─────────────────────────────────────────────────────────────────────────
Model │ Response (preview) │ Cost │ ...
─────────────────────────────────────────────────────────────────────────
✅gpt-4 │ The article discusses recent AI... │ $0.0045 │ ...
✅claude-3-opus │ This article explores cutting-edge... │ $0.0038 │ ...
✅gemini-pro │ A comprehensive overview of modern... │ $0.0012 │ ...
─────────────────────────────────────────────────────────────────────────
Total Cost: $0.0095 | Total Tokens: 450 → 237 | Success: 3/3
Output (verbose):
✅ gpt-4 (openai)
Cost: $0.0045 | Latency: 1,234 ms | Tokens: 150 → 80
The article discusses the recent advances in artificial intelligence...
(full response text)
────────────────────────────────────────────────────────────────────
✅ claude-3-opus (anthropic)
Cost: $0.0038 | Latency: 856 ms | Tokens: 150 → 75
This article explores cutting-edge developments in AI and ML...
(full response text)
────────────────────────────────────────────────────────────────────
Total Cost: $0.0083
Total Tokens: 300 → 155
Success Rate: 2/2
The compare command handles partial failures gracefully. If one model fails (e.g., API key missing), others continue execution.
dakora bump
Increment the semantic version of a template.
dakora bump <template-id> [OPTIONS]
Options:
--patch - Increment patch version (default: 1.0.0 → 1.0.1)
--minor - Increment minor version (1.0.0 → 1.1.0)
--major - Increment major version (1.0.0 → 2.0.0)
Examples:
dakora bump greeting --patch # 1.0.0 → 1.0.1
dakora bump greeting --minor # 1.0.0 → 1.1.0
dakora bump greeting --major # 1.0.0 → 2.0.0
dakora watch
Watch the prompts directory for changes and automatically reload templates.
Useful during development to see template changes immediately without restarting your application.
Press Ctrl+C to stop watching.
dakora config
Check which API keys are configured for LLM providers.
Options:
--provider - Check specific provider (e.g., openai, anthropic)
Examples:
# Check all providers
dakora config
# Check specific provider
dakora config --provider openai
Output:
✓ OPENAI_API_KEY found
✗ ANTHROPIC_API_KEY not set
✗ GOOGLE_API_KEY not set
dakora playground
Launch the interactive web playground for developing and testing templates.
dakora playground [OPTIONS]
Options:
--port - Port to run on (default: 3000)
--host - Host to bind to (default: localhost)
--config - Config file path (default: dakora.yaml)
--dev - Development mode with auto-reload
--demo - Demo mode (read-only, session isolation)
--no-build - Skip building the UI
--no-browser - Don’t open browser automatically
Examples:
# Start playground (opens browser)
dakora playground
# Custom port
dakora playground --port 8080
# Development mode
dakora playground --dev
# Demo mode (read-only)
dakora playground --demo
The playground automatically:
- 🔨 Builds the React UI (first run only)
- 🚀 Starts the FastAPI server
- 🌐 Opens your browser
Tips & Best Practices
Dynamic Arguments
Both run and compare commands support dynamic template inputs:
# Any --<input-name> flag is passed to the template
dakora run my-template \
--model gpt-4 \
--custom-input "value" \
--another-input "value2"
LLM Parameters
Pass any LiteLLM-supported parameter directly:
dakora run summarizer \
--model gpt-4 \
--input-text "..." \
--temperature 0.7 \
--max-tokens 100 \
--top-p 0.9 \
--frequency-penalty 0.5
Error Handling
The CLI provides clear error messages:
❌ API key error: OPENAI_API_KEY not found
💡 Set the required environment variable (e.g., OPENAI_API_KEY)
❌ Template 'nonexistent' not found
💡 Run 'dakora list' to see available templates
Piping and Scripting
Use --json for programmatic access:
# Capture JSON output
result=$(dakora run summarizer --model gpt-4 --input-text "..." --json)
# Extract specific fields with jq
echo $result | jq '.output'
echo $result | jq '.cost_usd'
Use --quiet for simple text output:
# Only the response text
dakora run summarizer --model gpt-4 --input-text "..." --quiet
Next Steps