CLI Command Reference
This comprehensive reference documents all Rhema CLI commands with examples, options, and usage patterns.
🚀 Initialization and Discovery
Initialize New Scope
rhema init [--scope-type TYPE] [--scope-name NAME] [--auto-config]Initialize a new Rhema scope in the current directory.
Options:
--scope-type TYPE: Specify scope type (service, app, library, etc.)--scope-name NAME: Set custom scope name--auto-config: Auto-detect configuration from repository structure
Examples:
# Basic initialization
rhema init
# Initialize with specific type
rhema init --scope-type service --scope-name user-api
# Auto-configure from existing project
rhema init --auto-configList Scopes
rhema scopesList all scopes in the repository with their types and status.
Show Scope Details
rhema scope [PATH]Display detailed information about a specific scope.
Examples:
# Show current scope
rhema scope
# Show specific scope
rhema scope ./services/authShow Scope Hierarchy
rhema treeDisplay the scope hierarchy as a tree structure.
📄 Content Management
Display YAML File Content
rhema show FILE [--scope SCOPE]Display the content of a YAML file with syntax highlighting.
Examples:
# Show todos file
rhema show todos
# Show scope-specific file
rhema show decisions --scope ./services/authExecute Context Query
rhema query "CQL_QUERY" [--stats] [--format FORMAT] [--provenance] [--field-provenance]Execute a Context Query Language (CQL) query across all scopes.
Options:
--stats: Include query statistics--format FORMAT: Output format (yaml, json, table, count)--provenance: Include provenance tracking--field-provenance: Include field-level provenance
Examples:
# Basic query
rhema query "find all todos with priority high"
# Query with statistics
rhema query "find decisions where status = approved" --stats
# Query with custom format
rhema query "count todos by status" --format tableSearch Across Context Files
rhema search "TERM" [--in FILE] [--regex]Search for text across all context files.
Options:
--in FILE: Search in specific file type--regex: Use regex pattern instead of simple text search
Examples:
# Simple search
rhema search "authentication"
# Search in specific file type
rhema search "bug" --in todos
# Regex search
rhema search "TODO.*urgent" --regex✅ Validation and Health
Validate YAML Files
rhema validate [--recursive] [--json-schema] [--migrate] [--lock-file] [--lock-only] [--strict]Validate YAML files against their schemas.
Options:
--recursive: Validate recursively in subdirectories--json-schema: Show JSON schemas--migrate: Migrate schemas to latest version--lock-file: Validate against lock file--lock-only: Validate lock file only--strict: Treat warnings as errors
Examples:
# Basic validation
rhema validate
# Recursive validation
rhema validate --recursive
# Validate with lock file
rhema validate --lock-file --strictCheck Scope Health
rhema health [--scope SCOPE]Check the health and completeness of scopes.
Examples:
# Check all scopes
rhema health
# Check specific scope
rhema health --scope ./services/authShow Context Statistics
rhema statsDisplay comprehensive statistics about the context repository.
📋 Work Item Management
Todo Management
rhema todo <subcommand>Subcommands:
add "TITLE" [--priority LEVEL] [--description DESC] [--tags TAGS]list [--status STATUS] [--priority PRIORITY] [--scope SCOPE]show ID: Show todo detailsupdate ID [--title TITLE] [--status STATUS] [--priority PRIORITY]complete ID [--outcome "DESCRIPTION"]delete ID
Examples:
# Add todo
rhema todo add "Fix authentication bug" --priority high --tags "bug,security"
# List todos
rhema todo list --status todo --priority high
# Complete todo
rhema todo complete 123 --outcome "Fixed by updating JWT validation"Insight Management
rhema insight <subcommand>Subcommands:
record "INSIGHT" [--confidence LEVEL] [--tags TAGS]list [--confidence LEVEL] [--scope SCOPE]show ID: Show insight detailsupdate ID [--insight INSIGHT] [--confidence LEVEL]delete ID
Examples:
# Record insight
rhema insight record "Using Redis for session storage improves performance by 40%" --confidence high
# List insights
rhema insight list --confidence highPattern Management
rhema pattern <subcommand>Subcommands:
add "NAME" [--effectiveness LEVEL] [--description DESC] [--tags TAGS]list [--effectiveness LEVEL] [--scope SCOPE]show ID: Show pattern detailsupdate ID [--name NAME] [--effectiveness LEVEL]delete ID
Examples:
# Add pattern
rhema pattern add "Circuit Breaker" --effectiveness high --description "Prevents cascade failures"
# List patterns
rhema pattern list --effectiveness highDecision Management
rhema decision <subcommand>Subcommands:
record "TITLE" [--status STATUS] [--description DESC] [--tags TAGS]list [--status STATUS] [--scope SCOPE]show ID: Show decision detailsupdate ID [--title TITLE] [--status STATUS]delete ID
Examples:
# Record decision
rhema decision record "Use GraphQL for API" --status approved --description "Better for mobile clients"
# List decisions
rhema decision list --status approved🔗 Cross-Scope Operations
Show Dependencies
rhema dependencies [--lock-file] [--compare] [--visualize] [--conflicts] [--impact] [--format FORMAT]Show scope dependencies and relationships.
Options:
--lock-file: Analyze from lock file instead of current state--compare: Compare lock file with current state--visualize: Show dependency chain visualization--conflicts: Detect version conflicts--impact: Show detailed impact analysis--format FORMAT: Output format (text, json, yaml)
Examples:
# Show dependencies
rhema dependencies
# Show with visualization
rhema dependencies --visualize
# Check for conflicts
rhema dependencies --conflicts --impactShow Impact of Changes
rhema impact FILEShow which scopes would be affected by changes to a file.
Examples:
# Show impact of changes
rhema impact src/auth/service.rsSync Knowledge
rhema sync-knowledgeSync knowledge across scopes, updating cross-references.
🔧 Advanced Operations
Export Context Data
rhema export-context [--format FORMAT] [--output-file FILE] [--scope-filter SCOPE] [--include-protocol] [--include-knowledge] [--include-todos] [--include-decisions] [--include-patterns] [--include-conventions] [--summarize] [--ai-agent-format]Export context data in various formats.
Options:
--format FORMAT: Output format (json, yaml, markdown, text)--output-file FILE: Output file path--scope-filter SCOPE: Filter by scope--include-*: Include specific data types--summarize: Summarize data--ai-agent-format: Format for AI agent consumption
Examples:
# Export all data
rhema export-context --format json --output-file context.json
# Export for AI agent
rhema export-context --ai-agent-format --include-knowledge --include-todosGenerate Context Primer
rhema primer [--scope-name SCOPE] [--output-dir DIR] [--template-type TEMPLATE] [--include-examples] [--validate]Generate context primer files for onboarding.
Examples:
# Generate primer
rhema primer --scope-name auth-service --include-examples
# Generate with validation
rhema primer --validate --output-dir ./docsGenerate README with Context
rhema generate-readme [--scope-name SCOPE] [--output-file FILE] [--template TEMPLATE] [--include-context] [--seo-optimized] [--custom-sections SECTIONS]Generate README files with embedded context.
Examples:
# Generate README
rhema generate-readme --include-context --seo-optimized
# Generate with custom sections
rhema generate-readme --custom-sections "Installation,API,Examples"Bootstrap Context for AI Agents
rhema bootstrap-context [--use-case USE_CASE] [--output-format FORMAT] [--output-dir DIR] [--scope-filter SCOPE] [--include-all] [--optimize-for-ai] [--create-primer] [--create-readme]Bootstrap context data for AI agent consumption.
Use Cases:
code_review: Optimized for code review tasksfeature_development: Optimized for feature developmentdebugging: Optimized for debugging tasksdocumentation: Optimized for documentation tasksonboarding: Optimized for team onboarding
Examples:
# Bootstrap for code review
rhema bootstrap-context --use-case code_review --optimize-for-ai
# Bootstrap for onboarding
rhema bootstrap-context --use-case onboarding --create-primer --create-readme🔄 Migration and Schema Management
Migrate Schema Files
rhema migrate [--recursive] [--dry-run]Migrate schema files to the latest version.
Examples:
# Dry run migration
rhema migrate --dry-run
# Migrate recursively
rhema migrate --recursiveGenerate Schema Templates
rhema schema TEMPLATE_TYPE [--output-file FILE]Generate schema templates for various document types.
Template Types:
scope: Scope configuration templateknowledge: Knowledge base templatetodos: Todo items templatedecisions: Decisions templatepatterns: Patterns templateconventions: Conventions templateall: All templates
Examples:
# Generate scope template
rhema schema scope --output-file scope.yaml
# Generate all templates
rhema schema all🎯 Interactive Mode
Start Interactive Mode
rhema interactive [--config CONFIG] [--no-auto-complete] [--no-syntax-highlighting] [--no-context-aware]Start Rhema’s interactive interface for dynamic workflows.
Examples:
# Start interactive mode
rhema interactive
# Start with custom config
rhema interactive --config ./rhema-interactive.yamlStart Enhanced Interactive Mode
rhema enhanced [--config CONFIG] [--no-auto-complete] [--no-syntax-highlighting] [--no-context-aware]Start enhanced interactive mode with advanced features.
🚀 Performance Monitoring
Performance Commands
rhema performance <subcommand>Subcommands:
start: Start performance monitoringstop: Stop performance monitoringstatus: Show system performance statusreport [--hours HOURS]: Generate performance reportconfig: Show monitoring configuration
Examples:
# Start monitoring
rhema performance start
# Generate 24-hour report
rhema performance report --hours 24
# Check status
rhema performance status⚙️ Configuration Management
Configuration Commands
rhema config <subcommand>Subcommands:
show: Show current configurationset KEY VALUE: Set configuration valueget KEY: Get configuration valuereset: Reset to default configurationvalidate: Validate configuration
Examples:
# Show configuration
rhema config show
# Set configuration
rhema config set default_scope_type service
# Validate configuration
rhema config validate🤖 AI and Coordination
Prompt Management
rhema prompt <subcommand>Subcommands:
add "NAME" [--content CONTENT] [--tags TAGS]list [--tags TAGS]show ID: Show prompt detailsupdate ID [--name NAME] [--content CONTENT]delete IDtest ID: Test prompt effectiveness
Context Rules Management
rhema context-rules <subcommand>Subcommands:
add "RULE" [--priority PRIORITY] [--tags TAGS]list [--priority PRIORITY]show ID: Show rule detailsupdate ID [--rule RULE] [--priority PRIORITY]delete ID
Workflow Management
rhema workflow <subcommand>Subcommands:
add "NAME" [--description DESC] [--steps STEPS]list [--tags TAGS]show ID: Show workflow detailsrun ID: Execute workflowupdate ID [--name NAME] [--steps STEPS]delete ID
Template Management
rhema template <subcommand>Subcommands:
add "NAME" [--content CONTENT] [--tags TAGS]list [--tags TAGS]show ID: Show template detailsupdate ID [--name NAME] [--content CONTENT]delete IDshare ID: Share template
Coordination Management
rhema coordination <subcommand>Subcommands:
start: Start coordination servicestop: Stop coordination servicestatus: Show coordination statusagents: List registered agentsregister AGENT_ID: Register agentunregister AGENT_ID: Unregister agent
Intent Management (Action Protocol)
rhema intent <subcommand>Subcommands:
propose "DESCRIPTION" [--scope SCOPE]: Propose actionlist [--status STATUS]: List intentsshow ID: Show intent detailsapprove ID: Approve intentreject ID [--reason REASON]: Reject intentexecute ID: Execute approved intent
🔧 Git Integration
Git Commands
rhema git <subcommand>Subcommands:
commit [--message MESSAGE]: Create context-aware commitbranch NAME [--from BRANCH]: Create context-aware branchmerge BRANCH [--strategy STRATEGY]: Merge with context awarenessrebase BRANCH: Rebase with context preservationhooks install: Install Git hookshooks uninstall: Uninstall Git hooks
🔒 Lock File Management
Lock Commands
rhema lock <subcommand>Subcommands:
create: Create lock fileupdate: Update lock filevalidate: Validate lock filediff: Show differencesresolve: Resolve conflictsclean: Clean outdated entries
🎛️ MCP Daemon Management
Daemon Commands
rhema daemon <subcommand>Subcommands:
start [--config CONFIG]: Start MCP daemonstop: Stop MCP daemonstatus: Show daemon statusrestart: Restart daemonlogs: Show daemon logs
📊 Global Options
All commands support these global options:
--verbose, -v: Enable verbose output--quiet, -q: Suppress output--help, -h: Show help information--version: Show version information
🎯 Command Examples by Use Case
Getting Started
# Initialize project
rhema init --auto-config
# Check health
rhema health
# View structure
rhema treeDaily Workflow
# Add todo
rhema todo add "Implement user authentication" --priority high
# Record insight
rhema insight record "JWT tokens work better than sessions for mobile apps"
# Check dependencies
rhema dependencies --visualizeCode Review
# Bootstrap context for review
rhema bootstrap-context --use-case code_review --optimize-for-ai
# Check impact of changes
rhema impact src/auth/service.rs
# Validate all files
rhema validate --recursiveTeam Onboarding
# Generate primer
rhema primer --include-examples --validate
# Generate README
rhema generate-readme --include-context --seo-optimized
# Export context
rhema export-context --ai-agent-format --include-knowledgePerformance Monitoring
# Start monitoring
rhema performance start
# Check status
rhema performance status
# Generate report
rhema performance report --hours 24