Docs
Reference
Every command, flag, environment variable, exit code and output file, in one place.
Commands
| Command | What it does |
|---|---|
mikoshi -t TARGET [options] | Run a scan. Opens the terminal UI unless -n is given or no terminal is attached. |
mikoshi view [RUN] | Open a run in the local web dashboard. Options: --host, --port, --no-open. |
mikoshi blue RUN | Regenerate the blue-team report. Options: --logs PATH, --output-dir DIR, --format md|json|all. |
mikoshi pr-comment RUN | Post a finished run to a GitHub pull request. Options: --repo, --pr, --sha, --token-env, --api-url, --fail-on, --request-changes, --dry-run. |
mikoshi completions zsh|bash|fish | Print a shell completion script, e.g. source <(mikoshi completions zsh). |
mikoshi --version | Print the installed version. |
mikoshi --update | Update the standalone binary, or print the upgrade command for pipx and source installs. |
Scan options
Targets
| Option | Description |
|---|---|
-t, --target | Directory, repository URL, web URL, domain, IP, CIDR, API spec file, or postman://ID. Repeatable. |
--target-list PATH | File of targets, one per line; # starts a comment. Repeatable. |
--target-type host | Treat every target as a host or network (IP, CIDR or hostname with optional :ports). |
--workspace-file PATH[:DEST] | Copy a file into /workspace in the sandbox. Repeatable. |
Behaviour
| Option | Description |
|---|---|
-m, --scan-mode | quick, standard or deep (default deep). |
--scope-mode | auto (default), diff or full. |
--diff-base REF | Branch or commit to compare against for diff scope. |
--instruction TEXT | Credentials, focus areas and exclusions for the agents. |
--instruction-file PATH | The same, from a file. |
--skills a,b | Skills to load into the root agent at the start. |
--skills-dir DIR | Extra skills directory. Repeatable. |
--mcp-config PATH | MCP server list (default ~/.mikoshi/mcp-servers.json). |
--mcp-server NAME / --mcp-exclude NAME | Use only, or skip, named MCP servers. Repeatable. |
--config PATH | Config file to use instead of ~/.mikoshi/cli-config.json. |
-r, --resume [RUN] | Continue an earlier run; without a name, pick from a list. |
Limits and output
| Option | Description |
|---|---|
-n, --non-interactive | Headless mode for CI and scripts. |
--max-budget USD | Stop when model spend reaches this amount across all agents. |
--max-turns N | Maximum turns per agent (default 500). |
--fail-on SEVERITY | Headless only. Exit 2 only for findings at or above critical, high, medium, low or info. |
--pr-comments | Headless only. Post findings to the GitHub pull request. |
--pr-request-changes | With --pr-comments: request changes when findings meet --fail-on. |
--blue / --no-blue | Write the blue-team report at the end (on by default). |
--blue-logs PATH | Log file to check detection coverage against. Repeatable. |
Environment variables
Any of these can also go in the env block of ~/.mikoshi/cli-config.json. Variables set in the shell take precedence.
Model
| Variable | Description |
|---|---|
MIKOSHI_LLM | Required. Model id in LiteLLM format, e.g. openrouter/z-ai/glm-5.3. |
LLM_API_KEY | Provider API key. Not needed for local models, Bedrock or Vertex auth. |
LLM_API_BASE | Custom endpoint for gateways and local servers. |
LLM_EXTRA_HEADERS | JSON object of headers sent with every model request. |
LLM_EXTRA_BODY | JSON object merged into every model request body. |
MIKOSHI_EFFORT_LLMS | Comma-separated sub-agent models, lowest to highest effort. |
MIKOSHI_DEDUPE_MODEL | Model for finding de-duplication (defaults to MIKOSHI_LLM). |
MIKOSHI_REASONING_EFFORT | none, minimal, low, medium, high (default), xhigh or max. |
MIKOSHI_API_TYPE | responses or chat_completions, for OpenAI-compatible endpoints. |
MIKOSHI_LLM_INPUT_COST_PER_MTOK | USD per million input tokens, for models LiteLLM can’t price. |
MIKOSHI_LLM_OUTPUT_COST_PER_MTOK | USD per million output tokens. |
LLM_TIMEOUT | Seconds per model request (default 300). |
LLM_PREFLIGHT_TIMEOUT | Seconds the start-up model check waits (default 30). |
MIKOSHI_PAUSE_ON_PROVIDER_QUOTA | Pause instead of failing when the provider account runs out of credit. |
Sandbox and runtime
| Variable | Description |
|---|---|
MIKOSHI_IMAGE | Sandbox image (default ghcr.io/usemikoshi/mikoshi-sandbox:1.4.2). |
DOCKER_HOST | Docker daemon to use. Defaults to the current docker context. |
MIKOSHI_PROXY_BACKEND | Intercepting proxy in the sandbox: mitmproxy (default) or caido (optional extra). |
MIKOSHI_MCP_CONFIG | Path to the MCP server list. |
MIKOSHI_SKILLS_DIR | Extra skills directories, separated by :. |
MIKOSHI_BLUE_TEAM | false turns off the blue-team report by default. |
Optional services
| Variable | Description |
|---|---|
EXA_API_KEY | Web search and page reading through Exa (preferred). |
PERPLEXITY_API_KEY | Web search through Perplexity. |
MIKOSHI_WEB_SEARCH_PROVIDER | auto (default), exa or perplexity. |
POSTMAN_API_KEY | Fetch Postman collections and environments by id. |
TRACELOOP_BASE_URL / TRACELOOP_API_KEY | Export OpenTelemetry traces to your own collector. |
GITHUB_TOKEN | Token for --pr-comments (needs pull-requests: write). |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Headless: no findings, or none at or above --fail-on. Interactive runs always exit 0. |
| 1 | Error before or during the scan: missing settings, Docker unavailable, invalid config, diff-scope failure. |
| 2 | Headless: vulnerabilities found, at or above --fail-on if set. |
Files
| Path | Contents |
|---|---|
~/.mikoshi/bin/ | The CLI, when installed with the script. |
~/.mikoshi/cli-config.json | Saved settings (owner-only permissions). |
~/.mikoshi/mcp-servers.json | MCP servers for agents (optional). |
mikoshi_runs/RUN/penetration_test_report.md | Full report. |
mikoshi_runs/RUN/vulnerabilities/ | One Markdown write-up per finding. |
mikoshi_runs/RUN/vulnerabilities.json | Findings as JSON. |
mikoshi_runs/RUN/vulnerabilities.csv | Findings as CSV. |
mikoshi_runs/RUN/findings.sarif | Findings as SARIF 2.1.0. |
mikoshi_runs/RUN/blue_team_report.md | Detections and hardening; data in blue_team.json, rules in detections/. |
mikoshi_runs/RUN/run.json | Status, targets, cost, PR-comment and blue-team outcomes. |