Skip to main content
The 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

boolean
default:"false"
Hide the spinner during execution. Useful when you want cleaner output for scripting.Short flag: -q
boolean
default:"false"
Show detailed logs during execution. Useful for debugging.Short flag: -v
string
default:"configured default"
Model 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-20250514
  • anthropic/claude-sonnet-4-20250514
  • gpt-4o
  • openai/gpt-4o
string
default:"configured default"
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:
Run 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 --quiet or --verbose is used)
  • Tool permissions still apply (unless --yolo is used)
  • Session is not saved to history by default

Signal Handling

The command responds to interrupt signals:
  • SIGINT (Ctrl+C): Gracefully cancels the operation
  • SIGTERM: Gracefully shuts down

Differences from crush

See Also