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

Meta commands

Type any of these at the Opsh prompt and press Enter:
CommandDescription
!helpShow the list of available meta commands
!configOpen the interactive config editor and display a summary of current settings
!historyDisplay the last 20 commands from the current session history
!clearClear the terminal screen
!cmdToggle raw command mode — bypass the AI and send input directly to your shell
!warpToggle warp mode on or off
!print onEnable print-only mode — generated commands are shown but not executed
!print offDisable print-only mode and return to normal execution
!uninstallRemove Opsh shell integration and the installed binary
!exitExit the Opsh REPL

CLI flags

Pass these flags when running opsh from your terminal:
FlagDescription
--initRun the interactive configuration wizard to set or update your AI provider, model, and preferences
--print-onlyStart Opsh in preview mode — commands are generated and displayed but never executed
--shell <zsh or bash>Override automatic shell detection for this session

--init

opsh --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.
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.