Configuration
API Key Setup
Section titled “API Key Setup”Magic Shell requires an API key from one of the supported providers. Run the setup wizard:
msh --setupThe setup wizard guides you through:
- Selecting a provider: OpenCode Zen, OpenRouter, Vercel AI Gateway, Cloudflare AI Gateway, Workers AI, or custom models.
- Entering your API key.
- Choosing a default model.
Keys stored in the system keychain through msh --setup take precedence over environment variables.
Custom Models
Section titled “Custom Models”Magic Shell supports local or remote OpenAI-compatible endpoints, including LM Studio and Ollama.
msh --add-modelThe wizard prompts for:
- Model ID
- Display name
- API model ID
- Base URL
- Optional API key
- Category:
fast,smart, orreasoning
Manage custom models from the CLI:
msh --list-custommsh --model my-local-llamamsh --remove-model my-local-llamaConfig File
Section titled “Config File”Magic Shell stores configuration in ~/.magic-shell/config.json:
On startup, Magic Shell checks saved built-in model IDs against the model catalog shipped with the installed version. If an update removes or disables your default model, Magic Shell selects an enabled default from the same provider and saves the corrected ID. Valid selections and custom models are preserved.
{ "provider": "opencode-zen", "defaultModel": "deepseek-v4-flash-free", "safetyLevel": "moderate", "dryRunByDefault": false, "theme": "opencode"}| Key | Description | Default |
|---|---|---|
provider |
AI provider | opencode-zen |
defaultModel |
Default model ID | deepseek-v4-flash-free |
safetyLevel |
Safety strictness: strict, moderate, or relaxed |
moderate |
dryRunByDefault |
Always show commands without executing | false |
theme |
Color theme name | opencode |
CLI Configuration
Section titled “CLI Configuration”msh --provider openroutermsh --model claude-sonnet-4-6msh --theme tokyonightmsh --modelsmsh --themesTUI Configuration
Section titled “TUI Configuration”In TUI mode (mshell), use the palettes:
Ctrl+Popens the command palette./opens slash commands from the prompt.Ctrl+X Mor/modelsopens the model picker.Ctrl+X Tor/themesopens the theme picker.Ctrl+Yor/safetyopens the safety picker.Ctrl+Tor/thinkingopens the thinking picker.EscandCtrl+Cclose the active modal.
Debug Mode
Section titled “Debug Mode”Enable API response debugging:
DEBUG_API=1 msh "your query"This shows the full API request and response, useful for troubleshooting.