vanta-cli
v0.1.0
Published
Vanta Systems command-line interface
Downloads
23
Readme
vanta-cli
The official command-line interface for Vanta Systems. Manage projects, authenticate, stream logs, and check usage — all from your terminal.
Installation · Quick Start · Commands · Configuration · Development
Installation
macOS / Linux
curl -fsSL https://vanta.systems/install.sh | bashWindows (PowerShell)
irm https://vanta.systems/install.ps1 | iexnpm
npm install -g vanta-cliVerify the install:
vanta --versionQuick Start
# 1. Authenticate
vanta login
# 2. Create a project
vanta init my-app
cd my-app
# 3. Check status
vanta statusGet your API key from vantasystems.org/dashboard/api-keys.
Commands
vanta login
Authenticate with your Vanta account. Validates your API key and stores credentials at ~/.vanta/credentials.
vanta login
vanta login --api-key vsk_live_...vanta logout
Clear stored credentials.
vanta logoutvanta init [name]
Scaffold a new Vanta project.
vanta init my-project
vanta init my-project --template blank --dry-run| Option | Description |
|---|---|
| --template <name> | Project template (default: blank) |
| --skip-git | Skip git repo initialization |
| --dry-run | Preview without creating files |
Creates: vanta.config.json, .env.example, README.md
vanta status
Display account status, plan, and current usage.
vanta status
vanta status --jsonShows: account name, email, plan, masked API key, usage progress, and days until next billing cycle.
vanta logs
Stream and search event logs.
vanta logs --tail 50
vanta logs --search "error"
vanta logs --from 2h
vanta logs --format json > events.json| Option | Description |
|---|---|
| -n, --tail <count> | Show last N logs (default: 20) |
| -f, --follow | Follow logs in real-time (coming soon) |
| -s, --search <query> | Filter logs by keyword |
| --from <duration> | Logs from N ago (e.g. 1h, 30m) |
| --format <format> | Output format: text or json |
vanta config
Manage global CLI configuration.
vanta config list
vanta config get api_url
vanta config set api_url https://api.example.com
vanta config reset| Key | Default | Description |
|---|---|---|
| api_url | https://api.vantasystems.org/v1 | Vanta API base URL |
| debug | false | Enable debug logging |
vanta deploy
Deploy project configuration to Vanta.
vanta deploy
vanta deploy --dry-run
vanta deploy --forceReads vanta.config.json, validates it, and pushes settings to the Vanta API.
Configuration
File Structure
~/.vanta/
├── credentials # API key & auth token — keep out of Git!
├── config.json # Global CLI settings
├── logs/ # Temporary log files
└── cache/ # Cache dataEnvironment Variables
VANTA_API_KEY=vsk_live_... # API key (overrides stored login)
VANTA_API_URL=https://... # Custom API URL
VANTA_CONFIG_DIR=~/.vanta # Config directory
VANTA_DEBUG=true # Enable debug loggingProject Config — vanta.config.json
{
"name": "my-project",
"version": "0.1.0",
"apiKey": "vsk_live_...",
"apiUrl": "https://api.vantasystems.org",
"webhooks": []
}Development
Prerequisites
- Bun (or Node.js 18+)
Setup
git clone https://github.com/vantasys/vanta-cli
cd vanta-cli
bun installRun
bun run src/cli.ts login # Run a command in dev mode
bun run build # Build for production
bun run compile # Compile to standalone binary (./vanta)Project Structure
src/
├── cli.ts # Entry point
├── commands/ # Command implementations
│ ├── login.ts
│ ├── logout.ts
│ ├── init.ts
│ ├── status.ts
│ ├── logs.ts
│ ├── config.ts
│ └── deploy.ts
├── api/
│ └── client.ts # HTTP client
├── config/
│ ├── paths.ts # File path helpers
│ └── store.ts # Config manager
├── utils/
│ └── logger.ts # Formatted output
└── types/
└── index.ts # TypeScript interfacesSecurity
Never commit your API key to Git. Credentials stored by vanta login are saved at ~/.vanta/credentials with 0600 permissions.
# Safe alternative: use environment variable
export VANTA_API_KEY=vsk_live_...Troubleshooting
"API key is invalid" — Get a new key at vantasystems.org/dashboard/api-keys and run vanta login again.
"Cannot connect to Vanta API" — Check your connection or set a custom URL: vanta config set api_url https://your-api.com
"Not authenticated" — Run vanta login first.
Debug mode — VANTA_DEBUG=true vanta status
Support
- Docs: docs.vantasystems.org/cli
- Issues: github.com/vantasys/vanta-cli/issues
- Email: [email protected]
License
MIT — see LICENSE
