Skip to main content

CLI.

The AppVet CLI lets you run scans, check usage, and manage authentication from your terminal. It works great in CI/CD pipelines with non-zero exit codes for failing scans.

Installation

      npm install -g appvet
    

Verify the installation:

      appvet --version
# appvet/1.0.0
    

Authentication

The CLI reads your API key from (in order of precedence):

  1. --api-key flag
  2. APPVET_API_KEY environment variable
  3. ~/.appvet/config.json config file

Interactive login

The login command opens the dashboard in your browser to create a key, then saves it to the config file:

      appvet login
# Opens https://appvet.dev/dashboard#api-keys in your browser
# Paste your API key when prompted
# Key saved to ~/.appvet/config.json
    

Commands

appvet scan

Run a scan against a URL.

      appvet scan https://example.com --type security
    

Flags

Flag Default Description
--type security Scan type: security, performance, accessibility, seo
--wait true Wait for scan to complete before exiting. Use --no-wait to submit and exit immediately.
--format text Output format: text, json
--min-score none Exit with code 1 if score is below this threshold (e.g., --min-score 70).
--api-key from env/config API key to use for this request.

Examples

      # Security scan with JSON output
appvet scan https://example.com --type security --format json

# Accessibility scan, fail if score < 80
appvet scan https://example.com --type accessibility --min-score 80

# Performance scan, don't wait
appvet scan https://example.com --type performance --no-wait

# Specify API key inline
appvet scan https://example.com --api-key avk_live_your_key_here
    

appvet usage

Show current usage and credit balance.

      appvet usage
# Billing:   Credit Packs
# Free:      3 / 5 used this month
# Credits:   23 remaining
    

appvet login

Log in with email and a 6-digit code. Auto-creates an API key and saves it.

      appvet login
# Email: dev@example.com
# ✓ Code sent to dev@example.com
# Enter the 6-digit code: 482901
# ✓ Logged in as dev@example.com
# ✓ API key saved to ~/.appvet/config
    

appvet whoami

Show current user, billing mode, and credit balance.

      appvet whoami
# Email:    dev@example.com
# Billing:  Credit Packs
# Free:     3 / 5 used
# Credits:  23
    

appvet keys

Manage API keys — list, create, and revoke.

      appvet keys list
appvet keys create --name "github-actions"
appvet keys revoke avk_a1b2
    

appvet billing

Show billing details — credit balance, metered usage, and pack purchase history.

appvet buy [pack]

Buy credit packs. Opens Stripe Checkout in your browser.

      appvet buy
# micro      $5    →   5 scans   ($1.00/scan)
# starter    $10   →  12 scans   ($0.83/scan)
# growth     $25   →  35 scans   ($0.71/scan)
# pro        $50   →  80 scans   ($0.63/scan)
# business   $100  → 200 scans   ($0.50/scan)

appvet buy starter
# Opening Stripe Checkout in your browser...
    

CI/CD integration

Use the --min-score flag to fail your build when the score drops below a threshold. Here is a GitHub Actions example:

# .github/workflows/appvet.yml
name: AppVet Scan
on:
  push:
    branches: [main]
  pull_request:

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - name: Install AppVet CLI
        run: npm install -g appvet

      - name: Run security scan
        env:
          APPVET_API_KEY: ${{ secrets.APPVET_API_KEY }}
        run: appvet scan https://staging.example.com --type security --min-score 70

      - name: Run accessibility scan
        env:
          APPVET_API_KEY: ${{ secrets.APPVET_API_KEY }}
        run: appvet scan https://staging.example.com --type accessibility --min-score 80

Store your API key as a GitHub Actions secret named APPVET_API_KEY. The scan command returns a non-zero exit code when the score is below --min-score, which fails the workflow step.

Exit codes

Code Meaning
0 Scan completed successfully (and score met --min-score if set).
1 Scan completed but score was below --min-score threshold.
2 Scan failed (target unreachable, invalid URL, etc.).
3 Authentication error (missing or invalid API key).
4 Rate limited or quota exceeded.

Next steps