Skip to content

CLI reference

Install the CLI, connect it to a deployment, and run engagements from a terminal or a pipeline.

The CLI runs the same engine as the console. It scans a target in a sandbox and writes the findings and their evidence to the run.

Install

bash
curl --proto '=https' --tlsv1.2 -fsSL https://rokkhe.com/install.sh | sh

The installer needs curl, Python 3.12 or newer, and sha256sum or shasum. It downloads the rokkhe-agent wheel, checks it against a separately fetched SHA-256 list and refuses to install on a mismatch. It then installs with uv, pipx or pip --user, in that order, and never runs as root. To read it first, download rokkhe.com/install.sh.

From a source checkout: cd engine && uv sync, then uv run rokkhe --help.

What a local engagement needs

A container runtime (Docker or Podman) for the sandbox, and a model: set ROKKHE_LLM to a provider/model and LLM_API_KEY to its key. Platform commands such as rokkhe runs need neither.

Connect to a deployment

bash
rokkhe login --host https://your.rokkhe
rokkhe whoami
rokkhe doctor

rokkhe login uses the device authorization grant, so it works the same over SSH, in a container and on a laptop. It prints a link and a one-time code; approve the code on the deployment's /device page while signed in. The code expires after 15 minutes. Without --host it signs in to rokkhe.com.

CommandWhat it does
rokkhe loginSigns this machine in. --no-browser only prints the link. --profile names the credential set, so one machine can hold several deployments.
rokkhe whoamiShows the host, account, scopes and credential store of the current profile.
rokkhe doctorRead-only checks: Python runtime, credential store, platform session, platform reachability, model provider, container runtime and outbound TCP/443. Exits 1 only when a check fails; warnings do not fail it.
rokkhe logoutRevokes the server session, then forgets local credentials. --local-only forgets them without verified revocation.
rokkhe scan <target>Queues a scan on the deployment instead of running one locally.
rokkhe runs, rokkhe findings listReads the deployment's runs and findings.

Credentials go in the OS keychain when one is available and in an encrypted file otherwise; rokkhe doctor says which. rokkhe auth is different: it signs in to a model provider, not to a Rokkhe deployment.

Usage

bash
rokkhe (--target <target> | --target-list <path> | --mount <path>) [options]

One of the three target forms is required. Everything else is optional.

Targets

FlagTypeMeaning
--target, -tstringURL, repository, local directory, domain or IP. Repeatable.
--target-liststringFile of targets, one per line. Blank lines and # comments are ignored. Repeatable.
--mountstringBind-mount a local directory into the sandbox read-only instead of copying it in file by file.
Use --mount for large trees

A local --target directory is copied in one file at a time, which stalls on very large repositories. --mount attaches it instead. The mount is read-only so your source isn't modified by accident; treat that as a guardrail, not a security boundary.

Scope and instructions

FlagTypeMeaning
--instructionstringCustom instructions: credentials, focus areas or a specific approach.
--instruction-filestringA file with the same, for anything longer than a shell argument.
--diff-basestringBranch or commit to compare against, for example origin/main. Scopes the engagement to what changed.

Running it

FlagTypeMeaning
--non-interactive, -nbooleanHeadless, no TUI. Use it in CI.
--configstringCustom JSON config instead of ~/.rokkhe/cli-config.json.
--max-budget-usdnumberCeiling on LLM spend for the whole scan, counted across the run.
Set a budget in CI

Cost grows with the surface the engagement finds. --max-budget-usd is the only bound, and it counts across the whole run, not per step.

In a pipeline

bash
rokkhe \
  --target . \
  --diff-base origin/main \
  --non-interactive \
  --max-budget-usd 5

--diff-base keeps each pull-request run proportional to the change. Diff scope needs full Git history, so check out with fetch-depth: 0. In a CI job building a pull request, --scope-mode auto (the default) turns diff scope on by itself; --scope-mode full turns it off.

Exit codeMeaning
0The run completed and reported no vulnerabilities.
1Setup or the engagement failed: Docker, the sandbox image, the environment or diff scope.
2With --non-interactive, the run reported at least one vulnerability. Also returned for an invalid command line.
3Another process already holds this run name.

To fail a pipeline on findings, check for exit code 2. Pentesting every pull request walks through the full setup.