Config File
Magic Shell stores configuration in ~/.magic-shell/config.json.
Location
Section titled “Location”| Platform | Path |
|---|---|
| macOS | ~/.magic-shell/config.json |
| Linux | ~/.magic-shell/config.json |
| Windows | %USERPROFILE%\.magic-shell\config.json |
Default Configuration
Section titled “Default Configuration”{ "provider": "opencode-zen", "defaultModel": "big-pickle", "safetyLevel": "moderate", "dryRunByDefault": false, "repoContext": false, "theme": "opencode", "blockedCommands": [], "confirmedDangerousPatterns": []}Options Reference
Section titled “Options Reference”provider
Section titled “provider”The AI provider to use for translations.
| Value | Description |
|---|---|
"opencode-zen" | OpenCode Zen (default, has free models) |
"openrouter" | OpenRouter |
{ "provider": "opencode-zen"}defaultModel
Section titled “defaultModel”The model ID to use for translations.
{ "defaultModel": "big-pickle"}Run msh --models to see available models for your provider.
safetyLevel
Section titled “safetyLevel”Controls when commands require confirmation.
| Value | Description |
|---|---|
"strict" | Confirm all potentially risky commands |
"moderate" | Confirm high and critical severity (default) |
"relaxed" | Only block critical severity |
{ "safetyLevel": "moderate"}dryRunByDefault
Section titled “dryRunByDefault”When true, always show commands without executing them.
{ "dryRunByDefault": false}repoContext
Section titled “repoContext”When true, Magic Shell detects your project type and available commands. This sends minimal, non-sensitive information (script names, not contents) to the AI for better context.
Detected project types:
- Node.js: Reads
package.jsonscripts and detects package manager (npm, bun, yarn, pnpm) - Makefile: Extracts make targets
- Rust: Knows standard cargo commands
- Python: Detects pyproject.toml, setup.py, requirements.txt
- Go: Detects go.mod
{ "repoContext": true}Enable via CLI:
msh --repo-context # Enable permanentlymsh -r "run tests" # Use for single commandColor theme for TUI mode and CLI output.
Available themes:
"opencode"(default)"tokyonight""catppuccin""gruvbox""nord""dracula""one-dark""matrix"
{ "theme": "opencode"}blockedCommands
Section titled “blockedCommands”Array of command patterns to always block.
{ "blockedCommands": [ "DROP TABLE", "TRUNCATE", "format c:" ]}confirmedDangerousPatterns
Section titled “confirmedDangerousPatterns”Patterns you’ve previously confirmed as safe for your use case.
{ "confirmedDangerousPatterns": [ "rm -rf node_modules", "docker system prune" ]}Example Configurations
Section titled “Example Configurations”Strict Mode for Production
Section titled “Strict Mode for Production”{ "provider": "opencode-zen", "defaultModel": "big-pickle", "safetyLevel": "strict", "dryRunByDefault": true, "theme": "nord"}Relaxed Mode for Development
Section titled “Relaxed Mode for Development”{ "provider": "opencode-zen", "defaultModel": "big-pickle", "safetyLevel": "relaxed", "dryRunByDefault": false, "theme": "dracula"}OpenRouter with Premium Model
Section titled “OpenRouter with Premium Model”{ "provider": "openrouter", "defaultModel": "claude-sonnet-4.5", "safetyLevel": "moderate", "dryRunByDefault": false, "theme": "catppuccin"}Editing the Config
Section titled “Editing the Config”Via CLI
Section titled “Via CLI”Most settings can be changed via CLI options:
msh --provider openroutermsh --model claude-sonnet-4.5msh --theme tokyonightManually
Section titled “Manually”Edit the file directly:
# Open in your editor$EDITOR ~/.magic-shell/config.jsonVia TUI
Section titled “Via TUI”In TUI mode, use Ctrl+X C to view config and various shortcuts to change settings.
Config Directory
Section titled “Config Directory”The ~/.magic-shell/ directory also contains:
| File | Description |
|---|---|
config.json | Main configuration |
history.json | Command history (if enabled) |
Resetting Configuration
Section titled “Resetting Configuration”To reset to defaults, delete the config file:
rm ~/.magic-shell/config.jsonA new default config will be created on next run.