Skip to content
Mikoshi

Docs

Reference

Every command, flag, environment variable, exit code and output file, in one place.

Commands

CommandWhat 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 RUNRegenerate the blue-team report. Options: --logs PATH, --output-dir DIR, --format md|json|all.
mikoshi pr-comment RUNPost 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|fishPrint a shell completion script, e.g. source <(mikoshi completions zsh).
mikoshi --versionPrint the installed version.
mikoshi --updateUpdate the standalone binary, or print the upgrade command for pipx and source installs.

Scan options

Targets

OptionDescription
-t, --targetDirectory, repository URL, web URL, domain, IP, CIDR, API spec file, or postman://ID. Repeatable.
--target-list PATHFile of targets, one per line; # starts a comment. Repeatable.
--target-type hostTreat 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

OptionDescription
-m, --scan-modequick, standard or deep (default deep).
--scope-modeauto (default), diff or full.
--diff-base REFBranch or commit to compare against for diff scope.
--instruction TEXTCredentials, focus areas and exclusions for the agents.
--instruction-file PATHThe same, from a file.
--skills a,bSkills to load into the root agent at the start.
--skills-dir DIRExtra skills directory. Repeatable.
--mcp-config PATHMCP server list (default ~/.mikoshi/mcp-servers.json).
--mcp-server NAME / --mcp-exclude NAMEUse only, or skip, named MCP servers. Repeatable.
--config PATHConfig 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

OptionDescription
-n, --non-interactiveHeadless mode for CI and scripts.
--max-budget USDStop when model spend reaches this amount across all agents.
--max-turns NMaximum turns per agent (default 500).
--fail-on SEVERITYHeadless only. Exit 2 only for findings at or above critical, high, medium, low or info.
--pr-commentsHeadless only. Post findings to the GitHub pull request.
--pr-request-changesWith --pr-comments: request changes when findings meet --fail-on.
--blue / --no-blueWrite the blue-team report at the end (on by default).
--blue-logs PATHLog 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

VariableDescription
MIKOSHI_LLMRequired. Model id in LiteLLM format, e.g. openrouter/z-ai/glm-5.3.
LLM_API_KEYProvider API key. Not needed for local models, Bedrock or Vertex auth.
LLM_API_BASECustom endpoint for gateways and local servers.
LLM_EXTRA_HEADERSJSON object of headers sent with every model request.
LLM_EXTRA_BODYJSON object merged into every model request body.
MIKOSHI_EFFORT_LLMSComma-separated sub-agent models, lowest to highest effort.
MIKOSHI_DEDUPE_MODELModel for finding de-duplication (defaults to MIKOSHI_LLM).
MIKOSHI_REASONING_EFFORTnone, minimal, low, medium, high (default), xhigh or max.
MIKOSHI_API_TYPEresponses or chat_completions, for OpenAI-compatible endpoints.
MIKOSHI_LLM_INPUT_COST_PER_MTOKUSD per million input tokens, for models LiteLLM can’t price.
MIKOSHI_LLM_OUTPUT_COST_PER_MTOKUSD per million output tokens.
LLM_TIMEOUTSeconds per model request (default 300).
LLM_PREFLIGHT_TIMEOUTSeconds the start-up model check waits (default 30).
MIKOSHI_PAUSE_ON_PROVIDER_QUOTAPause instead of failing when the provider account runs out of credit.

Sandbox and runtime

VariableDescription
MIKOSHI_IMAGESandbox image (default ghcr.io/usemikoshi/mikoshi-sandbox:1.4.2).
DOCKER_HOSTDocker daemon to use. Defaults to the current docker context.
MIKOSHI_PROXY_BACKENDIntercepting proxy in the sandbox: mitmproxy (default) or caido (optional extra).
MIKOSHI_MCP_CONFIGPath to the MCP server list.
MIKOSHI_SKILLS_DIRExtra skills directories, separated by :.
MIKOSHI_BLUE_TEAMfalse turns off the blue-team report by default.

Optional services

VariableDescription
EXA_API_KEYWeb search and page reading through Exa (preferred).
PERPLEXITY_API_KEYWeb search through Perplexity.
MIKOSHI_WEB_SEARCH_PROVIDERauto (default), exa or perplexity.
POSTMAN_API_KEYFetch Postman collections and environments by id.
TRACELOOP_BASE_URL / TRACELOOP_API_KEYExport OpenTelemetry traces to your own collector.
GITHUB_TOKENToken for --pr-comments (needs pull-requests: write).

Exit codes

CodeMeaning
0Headless: no findings, or none at or above --fail-on. Interactive runs always exit 0.
1Error before or during the scan: missing settings, Docker unavailable, invalid config, diff-scope failure.
2Headless: vulnerabilities found, at or above --fail-on if set.

Files

PathContents
~/.mikoshi/bin/The CLI, when installed with the script.
~/.mikoshi/cli-config.jsonSaved settings (owner-only permissions).
~/.mikoshi/mcp-servers.jsonMCP servers for agents (optional).
mikoshi_runs/RUN/penetration_test_report.mdFull report.
mikoshi_runs/RUN/vulnerabilities/One Markdown write-up per finding.
mikoshi_runs/RUN/vulnerabilities.jsonFindings as JSON.
mikoshi_runs/RUN/vulnerabilities.csvFindings as CSV.
mikoshi_runs/RUN/findings.sarifFindings as SARIF 2.1.0.
mikoshi_runs/RUN/blue_team_report.mdDetections and hardening; data in blue_team.json, rules in detections/.
mikoshi_runs/RUN/run.jsonStatus, targets, cost, PR-comment and blue-team outcomes.