# pwnkit-cli (npm launcher)

This package is a thin launcher for **pwnkit**, an autonomous AI pentesting
framework. From v0.10.0 onwards `pwnkit-cli` ships as a tiny launcher
that downloads the standalone binary on first run, caches it under
`~/.pwnkit/cache/v<version>/`, and re-execs the user's arguments against
it. Subsequent runs are an instant exec from the cache.

```
$ npx pwnkit-cli scan --target https://example.com
[pwnkit] first-run setup — downloading pwnkit-darwin-arm64 (~75 MB)…
[pwnkit] cached at /Users/you/.pwnkit/cache/v0.10.0/pwnkit-darwin-arm64

  pwnkit v0.10.0
    scanning target https://example.com
…
```

The binary has the Bun runtime baked in, so the full OpenTUI mission
control + live scan view works even when invoked under Node via npx.

## Install paths

The launcher works through any of these:

```bash
npx pwnkit-cli scan --target https://example.com    # one-shot, no install
bunx pwnkit-cli scan --target https://example.com   # same, faster cold start

npm i -g pwnkit-cli   &&  pwnkit-cli scan ...       # global install
bun add -g pwnkit-cli &&  pwnkit-cli scan ...       # global install via bun
```

If you'd rather skip the launcher entirely and install the binary
directly (zero Node, zero Bun, zero `node_modules`), run:

```bash
curl -fsSL https://raw.githubusercontent.com/0sec-labs/pwnkit/main/install.sh | bash
```

That drops a single binary into `~/.pwnkit/bin/`.

## Supported platforms

The launcher picks the right binary at runtime from the v`<version>`
GitHub Release:

- `pwnkit-darwin-arm64` — Apple Silicon
- `pwnkit-linux-x64`
- `pwnkit-linux-arm64`
- `pwnkit-windows-x64.exe`

Intel Mac (`darwin-x64`) is intentionally not shipped — Apple stopped
selling them in 2022 and our self-hosted macos-13 pool is unreliable.
Install Bun and compile from source (`scripts/bun-compile.sh`) on those.

## Env knobs

- `PWNKIT_BINARY` — explicit path to a binary; bypasses cache + download
- `PWNKIT_NO_DOWNLOAD=1` — never download; print install.sh URL and exit 1
- `PWNKIT_DOWNLOAD_TIMEOUT_MS` — per-attempt download timeout (default 120000)

## Source

<https://github.com/0sec-labs/pwnkit>
