@logvault/cli
v0.2.3
Published
LogVault CLI - Audit logging setup in 2 minutes
Maintainers
Readme
LogVault CLI
Official CLI for LogVault — Audit-Log-as-a-Service for B2B SaaS.
Setup audit logging in 2 minutes, not 45.
Installation
# Run directly with npx (recommended)
npx @logvault/cli init
# Or install globally
npm install -g @logvault/cli
logvault initQuick Start
# 1. Authenticate and get your API key
npx @logvault/cli init
# 2. Check your setup
npx @logvault/cli doctor
# 3. List your API keys
npx @logvault/cli keysCommands
logvault init
Authenticate with LogVault and retrieve your API key.
npx @logvault/cli initWhat it does:
- Opens your browser for authentication
- Fetches your API key
- Displays the key for you to copy to
.env - Points you to the Dashboard Config Generator
Options:
--no-browser- Print URL instead of opening browser (for SSH/headless)--json- Output JSON (for CI/CD pipelines)
logvault doctor
Diagnose common setup issues.
npx @logvault/cli doctorChecks:
- ✓ Node.js version (>= 18.0.0)
- ✓
LOGVAULT_API_KEYenvironment variable - ✓ API key format validation
- ✓ API connectivity
- ✓ Organization info
- ✓ Events quota
logvault keys
List your API keys (requires authentication).
npx @logvault/cli keysPhilosophy: Simple CLI, Smart Dashboard
We follow the shadcn philosophy: the CLI does one thing well.
Instead of auto-detecting frameworks, parsing .env files, and generating config files (which leads to 30% maintenance time on edge cases), we:
- CLI: Handles authentication only
- Dashboard: Generates framework-specific config
- You: Copy the config to your project
This means you understand exactly what's happening, and we don't break when you use a non-standard setup.
Next Steps After init
Copy the API key to your
.envfile:LOGVAULT_API_KEY=lv_live_abc123...Install the SDK:
npm install @logvault/clientGenerate your config at: logvault.app/dashboard/config-generator
Start logging:
import { Client } from "@logvault/client"; const client = new Client(process.env.LOGVAULT_API_KEY!); await client.log({ action: "user.login", userId: "user_123", resource: "auth", });
Requirements
- Node.js 18+
- A LogVault account (sign up free)
Links
License
MIT — see LICENSE for details.
