Skip to content
shellvoidePublic

About

KLUE CLI - Manage your pentests from Command Line

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

klue

Continuous pentesting from your terminal and your CI

The command-line interface for KLUE, Shellvoide's AI security engineer.
Run pentests, application, code and APK scans, follow them live, fail the build on what they find,
and triage findings without leaving the shell.


CI Latest release License: Apache-2.0 Platforms Built with Rust

Install · Quick start · CI/CD · Commands · Security · FAQ


klue creating a code scan, following it to completion, listing its findings and failing the build on high-severity issues

Highlights

  • 🔐 Browser sign-in, no copied secrets. klue auth login shows a one-time code and you approve it in KLUE with your usual login and 2FA. The key goes into your operating system's keychain and expires after 90 days.
  • 🎯 Every scan type, one binary. Pentests, application scans, code scans and APK scans share the same commands: run, watch, logs, continue, cancel and the rest.
  • 🚦 Built for pipelines. run --wait --fail-on high creates a scan, follows it to the end and exits with code 10 when it found anything high or critical.
  • 🧩 Scriptable. --json passes KLUE's JSON through untouched, create prints only the new ID, and klue api reaches any endpoint of the developer API.
  • 🛡️ Careful by default. HTTPS only, redirects never followed, nothing sent outside the API, and text from scanned targets can't smuggle escape sequences into your terminal.
  • 💻 Everywhere you work. macOS, Linux and Windows: a single binary with no runtime to install, which updates itself with klue upgrade.

Install

macOS and Linux

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/shellvoide/klue-cli/releases/latest/download/klue-cli-installer.sh | sh

Windows (PowerShell)

powershell -ExecutionPolicy Bypass -c "irm https://github.com/shellvoide/klue-cli/releases/latest/download/klue-cli-installer.ps1 | iex"

The installer puts klue in ~/.local/bin (on Windows %USERPROFILE%\.local\bin) and adds that folder to your PATH. klue upgrade updates it later.

Prebuilt archives

Download one from the latest release, unpack it and put klue anywhere on your PATH.

Platform Archive
macOS, Apple silicon klue-cli-aarch64-apple-darwin.tar.xz
macOS, Intel klue-cli-x86_64-apple-darwin.tar.xz
Linux, x86_64 klue-cli-x86_64-unknown-linux-gnu.tar.xz
Linux, arm64 klue-cli-aarch64-unknown-linux-gnu.tar.xz
Windows, x86_64 klue-cli-x86_64-pc-windows-msvc.zip

The Linux builds are made on Ubuntu 22.04 and need a glibc that recent. On older distributions or Alpine, build from source.

Build from source

You need rustup. The Rust version is pinned in rust-toolchain.toml, and rustup installs it on the first build. On Windows, rustup's installer also offers the Visual Studio C++ build tools that Rust needs to link.

cargo install --git https://github.com/shellvoide/klue-cli --locked
Verify a download

Every release file comes with a SHA-256 checksum and a GitHub build attestation, so you can check that it was built from this repository by its release workflow:

gh attestation verify klue-cli-x86_64-unknown-linux-gnu.tar.xz --repo shellvoide/klue-cli
Shell completions
klue completion bash > ~/.local/share/bash-completion/completions/klue
klue completion zsh > "${fpath[1]}/_klue"
klue completion fish > ~/.config/fish/completions/klue.fish
klue completion powershell >> $PROFILE

Quick start

You need a KLUE account with developer API access: an active Starter or Pro plan, or a Developer account.

1. Sign in. klue shows a one-time code and opens KLUE in your browser. Check that the page shows the same code, choose the permissions and approve.

$ klue auth login
Your one-time code: WDJB-MJHT
Press Enter to open https://klue.shellvoide.com/dashboard/cli?code=WDJB-MJHT in your browser…
Check that the page shows the same code, then approve. If KLUE asks you to log in first, open the link again afterwards.
Waiting for approval… (Ctrl-C to cancel)
✓ Signed in to https://klue.shellvoide.com as Ada Lovelace (ada@acme-fintech.example)
Key "KLUE CLI · dev-laptop" (api:read, api:write), expires 2027-02-28 14:40 (in 89d). Saved in the OS keychain.

2. Run a scan. run creates the scan and starts it; --wait follows it until it finishes, as in the recording above.

klue code-scan run --name "payments-service @ main" \
  --repo https://github.com/acme-fintech/payments-service --wait

3. Triage what it found.

klue finding list --severity critical,high --status open
klue finding view <finding-id>
klue finding status <finding-id> resolved
klue finding comment add <finding-id> "Fix deployed in release 2026.11.2"

Use it in CI

In CI, skip klue auth login. Create a key in KLUE under Settings → Developer API, store it as a secret, and pass it in KLUE_TOKEN. --fail-on high turns findings into a failing job:

# .github/workflows/security.yml
name: Security
on:
  push:
    branches: [main]

jobs:
  klue:
    runs-on: ubuntu-latest
    steps:
      - name: Install klue
        run: |
          curl --proto '=https' --tlsv1.2 -LsSf https://github.com/shellvoide/klue-cli/releases/latest/download/klue-cli-installer.sh | sh
          echo "$HOME/.local/bin" >> "$GITHUB_PATH"
      - name: KLUE code scan
        env:
          KLUE_TOKEN: ${{ secrets.KLUE_TOKEN }}
        run: >
          klue code-scan run
          --name "${{ github.repository }} @ ${{ github.ref_name }}"
          --repo "https://github.com/${{ github.repository }}"
          --branch "${{ github.ref_name }}"
          --wait --fail-on high

Code scans read public GitHub repositories. To test what you deployed instead, run an application scan or a pentest against its URL.

GitLab CI: scan the staging deployment

Add KLUE_TOKEN as a masked CI/CD variable, then:

klue:
  stage: test
  image: ubuntu:24.04
  script:
    - apt-get update -qq && apt-get install -y -qq curl ca-certificates xz-utils
    - curl --proto '=https' --tlsv1.2 -LsSf https://github.com/shellvoide/klue-cli/releases/latest/download/klue-cli-installer.sh | sh
    - export PATH="$HOME/.local/bin:$PATH"
    - klue app-scan run --name "staging @ $CI_COMMIT_SHORT_SHA" --target "$STAGING_URL" --wait --fail-on high
Exit code Meaning
0 Success
1 Error, network failure, KLUE server error, or a scan that failed or was cancelled while you waited
2 Usage error
3 Not signed in, or the key was refused (revoked, expired, missing a permission)
4 Not allowed by your plan: a feature or credits
5 Not found
6 Invalid request, or the scan is in the wrong state, such as editing a running scan
7 Too many requests, or no free scan slot, after retrying
10 --fail-on matched

Commands

Command What it does
klue auth login, status, logout
klue pentest Penetration tests
klue app-scan Application scans of web apps and APIs
klue code-scan Code scans of GitHub repositories
klue apk-scan APK scans of Android apps, including uploading the APK
klue finding Findings from every scan type
klue api Call any developer API endpoint and print the response
klue config Show and change settings
klue completion Print a shell completion script
klue upgrade Update to the latest release

klue <command> --help lists every subcommand and flag, with examples.

Scans

All four scan types share the same core commands. Some add their own:

pentest app-scan code-scan apk-scan
list view create run edit start continue cancel delete ✓ ✓ ✓ ✓
watch logs console transcript ✓ ✓ ✓ ✓
intel: the test cases the agent planned and ran ✓ ✓ ✓
files: the source files KLUE kept ✓
screenshots ✓
requests and answer: input the pentest asks you for ✓
spec set and spec remove: API spec files ✓ ✓
upload, attach and detach: the APK ✓
klue code-scan list --status running,queued
klue code-scan view <scan-id>
klue code-scan watch <scan-id> --fail-on high
klue code-scan logs <scan-id> --all
klue code-scan continue <scan-id> --budget 60 --directive "Dig deeper into the payments flow" --wait
klue code-scan console <scan-id> -o console.log
Creating each kind of scan

Code scans read a public GitHub repository. --mode picks the audit: general (the default), smart-contract or cve-research.

klue code-scan run --name "payments-service @ main" \
  --repo https://github.com/acme-fintech/payments-service --branch main --wait

Application scans test a web app, an API or both (--kind web-app | api | web-api), optionally guided by an API spec.

klue app-scan run --name "Customer portal (staging)" \
  --target https://staging.portal.acme-fintech.io --wait

klue app-scan run --name "Public API" --target https://api.acme-fintech.io --kind api \
  --spec-type openapi --spec-url https://api.acme-fintech.io/openapi.json --wait

Pentests need a --mode (web-api, red-team or bug-bounty) and the test areas they may cover in --scope. The KLUE API docs list the dashboard's standard scope items for each mode.

klue pentest run --name "Customer portal pentest" \
  --target https://portal.acme-fintech.io --mode web-api --environment staging \
  --scope subdomains,auth_bypass,session_management,idor,sqli,xss,ssrf --wait

With --human-loop, a pentest can ask you for things only a person has, such as a one-time code:

klue pentest requests <scan-id>
klue pentest answer <scan-id> <request-id> --value -    # reads the answer from stdin

APK scans upload the app first. Large files go up in 8 MB chunks with progress, and a chunk that fails is sent again.

klue apk-scan run --name "Acme Wallet 3.8.1" --apk acme-wallet-3.8.1.apk --wait

Every create and run also takes --budget MINUTES, --notes TEXT and --aggressive. Any other API field goes in with --set key=value or a JSON file with --body scan.json.

Findings

klue finding list --severity critical,high --status open --type code-scan --days 30
klue finding view <finding-id>
klue finding activity <finding-id>
klue finding status <finding-id> in-progress
klue finding comment add <finding-id> "Fix deployed in release 2026.11.2"
klue finding delete <finding-id>

Anything else

klue api calls any developer API endpoint with your key and prints the response as it is:

klue api GET /findings -q severity=critical,high
klue api PATCH /findings -f id=<finding-id> -f status=resolved
klue api POST /scans/code-scans --input scan.json

Scripting

  • --json prints KLUE's JSON response as it is, ready for jq.
  • Results go to stdout; progress, warnings and errors go to stderr.
  • create prints just the new scan's ID on stdout.
  • Deleting asks for confirmation. --yes answers it, and is required when there is no terminal to ask on.
  • -v shows each request and its status on stderr.
# Titles of open critical findings
klue finding list --severity critical --status open --json | jq -r '.vulns[].title'

# Create now, start later
id=$(klue code-scan create --name nightly --repo https://github.com/acme-fintech/payments-service)
klue code-scan start "$id" --wait

# React to the outcome
klue code-scan watch "$id" --fail-on high
case $? in
  0)  echo "clean" ;;
  10) echo "high or critical findings" ;;
  *)  echo "the scan or klue failed" ;;
esac

Keep secrets, such as a test account's password or a one-time code, off the command line, where your shell history keeps them: put them in the --body file or use --set key=@file, and answer pentest requests with --value -.

Configuration

Environment variable Meaning
KLUE_TOKEN Developer API key to use instead of the one klue auth login saved
KLUE_HOST The KLUE to talk to, same as --host
KLUE_CONFIG_DIR Folder for settings and saved keys
NO_COLOR Turn off colours, same as --no-color

Settings live in ~/.config/klue (or $XDG_CONFIG_HOME/klue) on Linux and macOS, and in %APPDATA%\klue on Windows. klue config path prints the folder. It holds config.toml (settings), hosts.toml (who you are signed in as on each host, no secrets) and, only with --insecure-storage, credentials.toml.

Another KLUE. klue talks to https://klue.shellvoide.com unless you pick another deployment with --host, KLUE_HOST or klue config set host klue.example.com. Each host has its own sign-in, and klue auth status lists the others.

Security

  • Keys stay out of your shell and your files. The browser sign-in or --with-token (which reads stdin) puts the key in the macOS Keychain, the Windows Credential Manager or the Secret Service on Linux. --insecure-storage keeps it in an owner-only file instead, for machines without a keychain.
  • Short-lived, least privilege. Keys made by the CLI expire after 90 days and can read and write; ask for --scopes read,write,delete only when you need to delete. Signing in again revokes the CLI's previous key, and klue auth logout revokes the current one. Every key shows up in Settings → Developer API.
  • Talks only to the API. HTTPS only (plain HTTP just for localhost), redirects are never followed, and no request can leave <host>/api/v1. Only requests that are safe to repeat are retried: reads, scan starts and APK upload chunks. Creates, edits and deletes are never sent twice.
  • Terminal-safe output. Findings, logs and source files can contain text from the scanned targets. On a terminal klue removes control characters from it, so it can't rewrite your screen or your clipboard. Pipes and files get the data unchanged.
  • Verifiable releases. Every release file has a checksum and a GitHub build attestation (how to check).
How sign-in works

klue auth login uses the OAuth device flow (RFC 8628). The CLI never sees your password, and a code that isn't approved within 15 minutes expires.

sequenceDiagram
    autonumber
    participant CLI as klue
    participant KLUE
    actor You as You, in the browser
    CLI->>KLUE: Start a sign-in
    KLUE-->>CLI: One-time code and link
    CLI->>You: Show the code, open the link
    You->>KLUE: Log in (2FA), check the code, approve
    loop Every 5 seconds until approved
        CLI->>KLUE: Ask for the key
    end
    KLUE-->>CLI: Developer key (90 days, the permissions you chose)
    CLI->>CLI: Save it in the OS keychain
Loading

Only approve a sign-in you started yourself: whoever started it gets the key. The approval page warns you when the sign-in came from a different network than your browser.

Found a vulnerability? Please email info@shellvoide.com rather than opening a public issue.

FAQ

Which KLUE accounts can use the CLI?

Accounts with developer API access: an active Starter or Pro plan, or a Developer account. KLUE won't approve a sign-in for other accounts.

The browser is on another machine, such as over SSH.

Run klue auth login --no-browser. It prints the link, and you can approve on any device where you are logged in to KLUE.

"Couldn't save the key in the OS keychain."

Servers and containers often have no keychain. Use klue auth login --insecure-storage to keep the key in an owner-only file, or set KLUE_TOKEN.

Commands fail with exit code 3.

The key was refused: it was revoked, it expired, it lacks the permission the command needs, or your plan doesn't include that scan type. klue auth status shows the key's permissions and expiry; klue auth login gets a new one.

run created the scan but couldn't start it.

The scan stays as a draft and klue prints its ID. Start it later with klue <type> start <scan-id>, for example once a scan slot is free or credits are back.

How do I update or uninstall?

klue upgrade updates a copy from the installer; reinstall copies made with cargo the same way. To uninstall, run klue auth logout, delete the klue binary (~/.local/bin/klue, or %USERPROFILE%\.local\bin\klue.exe on Windows) and the folder klue config path prints.

Development

cargo build
cargo fmt
cargo clippy --all-targets -- -D warnings
cargo test

CI runs the same checks on Linux, macOS and Windows for every pull request and every push to main.

src/
├── main.rs        entry point
├── cli.rs         the command tree (clap)
├── error.rs       errors and the exit codes they map to
├── api/           HTTP client: retries, timeouts, the /api/v1 guard
├── commands/
│   ├── auth.rs    browser sign-in (device flow), status, logout
│   ├── finding.rs findings
│   ├── scan/      pentest, app-scan, code-scan and apk-scan
│   └── …          api, config, completion, upgrade
├── config/        settings, signed-in hosts, keychain storage
├── json.rs        reading and cleaning KLUE's JSON
└── output.rs      tables, colours, terminal-safe printing

Releases are built by dist (dist-workspace.toml, .github/workflows/release.yml): set the version in Cargo.toml, then push a tag such as v0.1.0. The workflow builds every target, the installers, checksums and attestations, and publishes the GitHub release.

Bug reports and pull requests are welcome.

License

Apache-2.0


About

KLUE CLI - Manage your pentests from Command Line

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages