crush run command executes a single prompt in non-interactive mode, making it perfect for scripting, automation, and piping data.
Usage
Description
Run a single prompt in non-interactive mode and exit. The prompt can be provided as command-line arguments or piped from stdin. This is ideal for:- One-off queries and commands
- Shell scripting and automation
- Processing piped data
- CI/CD pipelines
- Output redirection to files
Flags
Hide the spinner during execution. Useful when you want cleaner output for scripting.Short flag:
-qShow detailed logs during execution. Useful for debugging.Short flag:
-vModel to use for this run. Accepts either
model or provider/model format to disambiguate models with the same name across providers.Short flag: -mExamples:claude-sonnet-4-20250514anthropic/claude-sonnet-4-20250514gpt-4oopenai/gpt-4o
Small model to use for auxiliary tasks. If not provided, uses the default small model for the provider.
Global Flags
All global flags are also available:--debug, --yolo, --cwd, --data-dir
Input Methods
Command-line Arguments
Provide the prompt directly as arguments:Stdin (Pipe)
Pipe data into the prompt:File Redirection
Read from a file using shell redirection:Combined Input
When piping data,crush run prepends the stdin content to your prompt:
Output Redirection
Redirect Crush’s output to files:Examples
Scripting Examples
Automated Code Review
CI/CD Integration
Batch Processing
Behavior
Provider Configuration
The command requires at least one provider to be configured. If no providers are set up, you’ll see:crush without arguments to configure providers interactively.
Non-Interactive Mode
In non-interactive mode:- No TUI is displayed
- Output goes directly to stdout
- A spinner shows progress (unless
--quietor--verboseis used) - Tool permissions still apply (unless
--yolois used) - Session is not saved to history by default
Signal Handling
The command responds to interrupt signals:SIGINT(Ctrl+C): Gracefully cancels the operationSIGTERM: Gracefully shuts down
Differences from crush
| Feature | crush | crush run |
|---|---|---|
| Mode | Interactive TUI | Non-interactive |
| Output | Terminal UI | Plain text to stdout |
| Session | Saved to history | One-off execution |
| Input | Chat interface | Command-line args or stdin |
| Use case | Development sessions | Scripting, automation |
| Exit | Manual (Ctrl+C) | Automatic after completion |
See Also
crush- Interactive modecrush models- List available models- Configuration - Configure Crush for your needs