Skip to content
Documentation sections

CLI and website

Connect your terminal

Connect once to send future CLI scan results to your Krythiq dashboard. You approve the connection in your browser.

Renewal and named connections require CLI 0.3.0 or newer and the updated server. Install with npm install -g krythiq@latest, or use npx krythiq@latest.

1. Start from your project

npx krythiq connect --name my-laptop

A browser page opens and your terminal shows a short code. Keep the terminal open while you finish the next step.

2. Approve the terminal

  1. 1.Sign in to Krythiq if asked.
  2. 2.Check that the browser code matches the terminal code.
  3. 3.Select Authorize terminal.

After approval, the browser waits for the terminal to claim its connection. Keep the terminal open until both confirm success. Then use krythiq token for the live balance; the browser does not display a guessed balance.

3. Run a scan

npx krythiq scan .

The static scan runs locally and costs 0 Tokens. It stays in your terminal unless you choose to save it.

npx krythiq scan . --save

--save adds the result to Recent Scans in the Krythiq Web UI. Saving a static terminal scan also costs 0 Tokens and requires a connected CLI session.

Use account Tokens for hosted AI

krythiq review src/auth.ts
krythiq ask "Explain the auth flow" --file src/auth.ts

Review costs 15 Tokens and a question costs 10 Tokens, using the website balance and refund rules. Each command prompts before uploading selected files; use --yes in scripts. Provider failures refund the charge. Reuse the printed --request-id with unchanged input after an interrupted response to avoid paying twice. These commands require the 0.3.0 CLI and updated server.

krythiq tokens --history

Check or remove the connection

See which account is signed in and verify the session

npx krythiq whoami

This checks the saved session with Krythiq.dev and shows the account, Token balance, CLI scans, and scan Tokens used. For new sessions, access renews automatically before expiry and once after an authentication failure. A revoked or expired terminal authorization requires browser sign-in again. Temporary outages retain the saved connection.

Check Tokens left

npx krythiq token

This performs a live balance check for the connected account. Static scans and saving them with --save remain free.

Show connection and Token balance

npx krythiq connect --status

Revoke this terminal and remove its local connection

npx krythiq connect --disconnect

You can also revoke a terminal from Settings → CLI. CLI settings are always available, including after a terminal expires or is revoked. The page refreshes every 30 seconds and when you return to the tab. Expired or revoked sessions do not count as authorized.

Renewal and troubleshooting

krythiq connect --refresh

New 0.3.0 connections use one-hour access credentials and a 90-day authorization. Access renews automatically within that window; the authorization deadline never extends silently. Existing durable credentials remain valid until revoked, but need one new browser connection to enable renewal.

The CLI resolves the production hostname to www.krythiq.dev before sending credentials, avoiding false expiration from redirects. If KRYTHIQ_CLI_TOKEN is set, it overrides browser credentials and cannot auto-renew. Unset it before browser sign-in, or update it explicitly. Changing dashboard URLs requires a connection to that same origin, preventing saved credentials from being sent elsewhere.

If disconnect cannot reach the server, it clears local credentials and reports that remote revocation is unconfirmed. Use Settings → CLI to finish revocation. Usage totals include all CLI history on both sides; the UI scan list shows the latest 100.

Local website or remote terminal

If Krythiq is running on your computer, point the CLI to that address:

KRYTHIQ_DASHBOARD_URL=http://localhost:3000 npx krythiq connect

If the terminal cannot open a browser, print the link and open it yourself:

npx krythiq connect --no-browser