Opsh includes a set of built-in meta commands you can run from the REPL prompt. These commands are prefixed with ! so Opsh knows not to pass them to the AI — they control session behavior directly. You can also pass several flags when launching Opsh from the command line.
Type any of these at the Opsh prompt and press Enter:
| Command | Description |
|---|
!help | Show the list of available meta commands |
!config | Open the interactive config editor and display a summary of current settings |
!history | Display the last 20 commands from the current session history |
!clear | Clear the terminal screen |
!cmd | Toggle raw command mode — bypass the AI and send input directly to your shell |
!warp | Toggle warp mode on or off |
!print on | Enable print-only mode — generated commands are shown but not executed |
!print off | Disable print-only mode and return to normal execution |
!uninstall | Remove Opsh shell integration and the installed binary |
!exit | Exit the Opsh REPL |
CLI flags
Pass these flags when running opsh from your terminal:
| Flag | Description |
|---|
--init | Run the interactive configuration wizard to set or update your AI provider, model, and preferences |
--print-only | Start Opsh in preview mode — commands are generated and displayed but never executed |
--shell <zsh or bash> | Override automatic shell detection for this session |
--init
Walks you through choosing an AI provider, entering your API key, setting your preferred model, and configuring options like warp mode. Saves the result to ~/.opsh/config.json. You can re-run --init at any time to update your configuration.
--print-only
opsh --print-only "archive the downloads folder"
Generates the command and shows the plan, but exits without running anything. Useful for reviewing what Opsh would do before committing.
--shell
opsh --shell zsh
opsh --shell bash
Forces Opsh to use the specified shell for command generation and execution. By default, Opsh detects your current shell automatically.
Use !cmd to toggle raw command mode when you want to run a shell command directly without any AI translation. For example, if you need to run a specific script exactly as written, switch into raw command mode, run it, then toggle back. Raw command mode is indicated in the prompt and affects only the current session.