DocsCLI

The CLI

Capture screenshots directly from your terminal. Run any preset created on the dashboard — the CLI launches a local browser and executes the opcode program deterministically.

Quick start

Get up and running in one command:

macOS / Linux

Shell
curl -fsSL https://autokap.app/install.sh | sh

Windows (PowerShell)

Shell
irm https://autokap.app/install.ps1 | iex

Or use npx for a zero-install setup:

Shell
npx autokap@latest init

Install

Install it globally via npm:

Shell
npm install -g autokap

Authenticate

Log in with your CLI key generated from the AutoKap dashboard (Settings > CLI Keys):

Shell
autokap login <your-cli-key>

Your key is stored locally in ~/.autokap/config.json. You only need to do this once.

One-step setup

Combine login and skill installation in a single command:

Shell
npx autokap@latest init --cli-key <your-cli-key> --agent claude

This authenticates your CLI and installs the AI agent skill into your project.

Run a preset

Run any preset created on the dashboard. The CLI fetches the opcode program and executes it locally — navigating, clicking, and capturing deterministically:

Shell
autokap run <preset-id>

Commands

CommandDescription
autokap initSet up AutoKap: authenticate and install the AI skill in one step
autokap login <key>Authenticate with your CLI key
autokap logoutRemove stored credentials
autokap whoamiShow the account linked to the current CLI key
autokap pingVerify CLI connection and confirm the key is still valid
autokap run <preset-id>Run a preset capture using local Playwright
autokap run <id> --headedShow the browser window for debugging
autokap skillExport the AI agent skill file for preset creation
autokap --versionShow the installed version

How it works

  1. You run a preset by its ID. The CLI fetches the execution program from the AutoKap server and launches a local Playwright browser.
  2. The CLI executes the opcode program locally — navigating pages, clicking elements, and taking screenshots across all configured variants (viewports, themes, languages). No server control at runtime.
  3. Screenshots are uploaded to AutoKap for mockup rendering and post-processing. Results appear in your dashboard.

Troubleshooting

Common errors you may encounter when using the CLI, and how to fix them.

Connection

ErrorCauseFix
connect ECONNREFUSEDThe AutoKap server is not running or unreachable.Check your internet connection. If the issue persists, the AutoKap server may be temporarily down — try again in a few minutes.
getaddrinfo ENOTFOUNDDNS resolution failed — wrong server URL.Check ~/.autokap/config.json for a correct apiBaseUrl. Re-run autokap login if needed.

Authentication

ErrorCauseFix
Invalid CLI keyThe CLI key is missing, revoked, or malformed.Generate a new CLI key in the dashboard and run autokap login '<'key'>'.
Not authenticatedNo config file found at ~/.autokap/config.json.Run autokap login '<'key'>' to authenticate.
CLI key not linkedThis machine is not linked to your account with a valid stored CLI key.Run autokap login '<'key'>' again or regenerate the CLI key from the dashboard if needed.

Version mismatch

ErrorCauseFix
CLI is too old for this serverThe server requires a newer protocol version.Run npm install -g autokap@latest to update.

Preset & project

ErrorCauseFix
Preset not foundThe preset ID does not exist in the database.Verify the ID in the dashboard — it may have been deleted.
Project not foundThe project linked to the preset no longer exists.Check the dashboard — the project may have been deleted.

Runtime

ErrorCauseFix
timeout waiting for … (60000ms)A browser command timed out.Check that the local browser is responsive. Try --headed to debug visually.
Client disconnectedThe CLI lost its connection to the server mid-capture.Check network stability and re-run the preset.