Convert natural language descriptions into executable CLI commands with safety validation and confirmation prompts.
The exec command bridges the gap between what you want to accomplish and the exact command syntax needed. Describe your goal in plain language, and Rawi will generate and optionally execute the appropriate command.
rawi exec [description] [options]
echo "description" | rawi exec [options]
rawi exec [options] # Interactive mode
description (optional)
Natural language description of what you want to accomplish. If not provided, Rawi will:
- Read from stdin if available (piped input)
- Prompt interactively if running in a terminal
- Show help if no input is available
-p, --profile <profile>
Use a specific configuration profile for AI provider settings.
rawi exec "list running processes" --profile work--dry-run
Show the generated command without executing it. Useful for learning and validation.
rawi exec "backup my home directory" --dry-run--timeout <seconds>
Set maximum execution time for the generated command (default: 30 seconds).
rawi exec "compile large project" --timeout 300--verbose
Show detailed information including provider type, model used, and execution steps.
rawi exec "system diagnostics" --verbose--confirm
Always prompt for confirmation before executing commands, even for safe operations.
rawi exec "restart service" --confirm--copy-command
Copy the generated command itself to clipboard before execution (enabled by default).
rawi exec "list all processes" --copy-commandAll platforms (Windows, macOS, Linux) support:
- Full Execution: Commands are generated and executed with appropriate safety checks
- Confirmation Prompts: Potentially dangerous commands require user confirmation
- Interactive Support: TTY-based commands work in interactive mode
- Safety Features: Command validation and timeout protection
# Simple file operations
rawi exec "list all files in current directory"
rawi exec "show disk usage for home directory"
rawi exec "find all Python files"
# System operations
rawi exec "show running processes"
rawi exec "check memory usage"
rawi exec "display network interfaces"# From other commands
echo "compress all log files" | rawi exec
printf "backup database\n" | rawi exec --dry-run
# In scripts
TASK="monitor CPU usage for 30 seconds"
echo "$TASK" | rawi exec --timeout 60# Start interactive prompt
rawi exec
# Will prompt: "What would you like to do?"
# Enter: "find files modified in last 24 hours"# Development tasks
rawi exec "start development server on port 3000"
rawi exec "run tests in watch mode"
rawi exec "build production bundle"
# System administration
rawi exec "check disk space on all mounted drives"
rawi exec "show last 50 system log entries"
rawi exec "list active network connections"# Preview dangerous operations
rawi exec "delete old log files" --dry-run
# Force confirmation for system changes
rawi exec "restart network service" --confirm
# Use specific provider for consistent results
rawi exec "complex git operation" --profile production- Server Management: Generate commands for service control, monitoring, and maintenance
- File Operations: Create complex find, grep, and file manipulation commands
- Network Diagnostics: Generate networking and connectivity troubleshooting commands
- Build & Deploy: Generate commands for compilation, testing, and deployment
- Git Operations: Create complex git commands for version control
- Environment Setup: Generate commands for development environment configuration
- Log Analysis: Generate commands for log parsing and analysis
- File Processing: Create commands for data transformation and processing
- Monitoring: Generate commands for system and application monitoring
- Command Discovery: Learn new CLI tools and their proper usage
- Best Practices: See recommended command patterns and options
- Documentation: Generate commands with proper flags and syntax
- Syntax Checking: Generated commands are validated for proper syntax
- Safety Analysis: Potentially dangerous operations are flagged
- Context Awareness: Commands are generated with awareness of current system state
- Dry Run Mode: Preview commands before execution
- Confirmation Prompts: User approval required for execution
- Timeout Protection: Automatic termination of long-running commands
- Command History: All generated commands are logged for review
- Execution Results: Command output and exit codes are recorded
- Session Management: Commands are organized by session for easy tracking
# View exec command history
rawi history exec
# Search for specific commands
rawi history exec --search "docker"
# View exec sessions from specific profile
rawi history exec --profile production# Use different providers for different tasks
rawi exec "server deployment" --profile production
rawi exec "development setup" --profile personalWhile exec doesn't directly use act templates, you can combine them:
# Use ask with template, then exec the result
rawi ask --act devops "What command should I use to monitor disk I/O?"
# Then use the suggestion with exec
rawi exec "monitor disk I/O in real-time"✅ Good Examples:
- "list all files modified in the last 24 hours"
- "show running Docker containers with their resource usage"
- "backup the database to timestamped file"
❌ Avoid:
- "do something with files" (too vague)
- "ls -la" (already a command, describe the goal instead)
- "help" (use --help instead)
- Use
--dry-runfirst for unfamiliar operations - Be specific about what you want to accomplish
- Review generated commands before execution
- Use
--confirmfor system-critical operations - Check command history to track what was executed
- Use different profiles for different environments (dev, staging, prod)
- Configure appropriate models for different complexity levels
- Set up dedicated profiles for specific use cases (security, development, etc.)
"Command not found" errors
- The generated command uses tools not installed on your system
- Install required tools or specify alternatives in your description
Timeout errors
- Increase timeout with
--timeout <seconds> - Use
--dry-runto check if the command is appropriate
Permission denied
- Generated command requires elevated privileges
- Consider if
sudois needed or use a different approach
- Be specific about your environment and requirements
- Mention constraints like operating system or available tools
- Use appropriate profiles configured for your use case
- Provide context about what you're trying to achieve
ask- For general AI questions and explanationschat- For interactive problem-solving sessionshistory- To review and manage exec command historyconfigure- To set up AI providers and profiles
rawi exec "find all JavaScript files larger than 1MB"
rawi exec "compress all log files older than 30 days"
rawi exec "copy all photos to backup directory"rawi exec "show top 10 processes by CPU usage"
rawi exec "monitor memory usage every 5 seconds"
rawi exec "check network connectivity to specific host"rawi exec "run TypeScript compiler in watch mode"
rawi exec "start Docker container with port mapping"
rawi exec "create new Git branch for feature development"rawi exec "extract specific columns from CSV file"
rawi exec "count lines in all Python files"
rawi exec "search for pattern in log files from last week"