Skip to content

Config File

Magic Shell stores configuration in ~/.magic-shell/config.json.

PlatformPath
macOS~/.magic-shell/config.json
Linux~/.magic-shell/config.json
Windows%USERPROFILE%\.magic-shell\config.json
{
"provider": "opencode-zen",
"defaultModel": "big-pickle",
"safetyLevel": "moderate",
"dryRunByDefault": false,
"repoContext": false,
"theme": "opencode",
"blockedCommands": [],
"confirmedDangerousPatterns": []
}

The AI provider to use for translations.

ValueDescription
"opencode-zen"OpenCode Zen (default, has free models)
"openrouter"OpenRouter
{
"provider": "opencode-zen"
}

The model ID to use for translations.

{
"defaultModel": "big-pickle"
}

Run msh --models to see available models for your provider.

Controls when commands require confirmation.

ValueDescription
"strict"Confirm all potentially risky commands
"moderate"Confirm high and critical severity (default)
"relaxed"Only block critical severity
{
"safetyLevel": "moderate"
}

When true, always show commands without executing them.

{
"dryRunByDefault": false
}

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.json scripts 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:

Terminal window
msh --repo-context # Enable permanently
msh -r "run tests" # Use for single command

Color theme for TUI mode and CLI output.

Available themes:

  • "opencode" (default)
  • "tokyonight"
  • "catppuccin"
  • "gruvbox"
  • "nord"
  • "dracula"
  • "one-dark"
  • "matrix"
{
"theme": "opencode"
}

Array of command patterns to always block.

{
"blockedCommands": [
"DROP TABLE",
"TRUNCATE",
"format c:"
]
}

Patterns you’ve previously confirmed as safe for your use case.

{
"confirmedDangerousPatterns": [
"rm -rf node_modules",
"docker system prune"
]
}
{
"provider": "opencode-zen",
"defaultModel": "big-pickle",
"safetyLevel": "strict",
"dryRunByDefault": true,
"theme": "nord"
}
{
"provider": "opencode-zen",
"defaultModel": "big-pickle",
"safetyLevel": "relaxed",
"dryRunByDefault": false,
"theme": "dracula"
}
{
"provider": "openrouter",
"defaultModel": "claude-sonnet-4.5",
"safetyLevel": "moderate",
"dryRunByDefault": false,
"theme": "catppuccin"
}

Most settings can be changed via CLI options:

Terminal window
msh --provider openrouter
msh --model claude-sonnet-4.5
msh --theme tokyonight

Edit the file directly:

Terminal window
# Open in your editor
$EDITOR ~/.magic-shell/config.json

In TUI mode, use Ctrl+X C to view config and various shortcuts to change settings.

The ~/.magic-shell/ directory also contains:

FileDescription
config.jsonMain configuration
history.jsonCommand history (if enabled)

To reset to defaults, delete the config file:

Terminal window
rm ~/.magic-shell/config.json

A new default config will be created on next run.