@eaglekit/cli
v0.1.0
Published
EagleKit CLI — scaffold and manage your analytics
Readme
CLI Reference — eaglekit
Installation
# Use without installing (recommended for init):
npx eaglekit init
# Or install globally:
npm install -g @eaglekit/cliEnvironment variables
The CLI reads these from your shell environment. Set them in .env or export before running:
export EAGLEKIT_COLLECTOR_URL=https://your-collector.vercel.app
export EAGLEKIT_API_KEY=eaglekit_live_your_dashboard_keyCommands
eaglekit init
Scaffold EagleKit into an existing project. Detects src/ directory automatically.
npx eaglekit init
# Non-interactive:
npx eaglekit init \
--framework next \
--collector-url https://your-collector.vercel.app \
--project-key eagelkit_live_xxxxOptions:
| Flag | Description |
|---|---|
| --framework | next | react | vue | svelte | vanilla |
| --collector-url | Your collector base URL |
| --project-key | API key from dashboard |
Creates:
eaglekit.config.ts— config file at project rootsrc/eaglekit-setup.ts— framework-specific integration snippet
eaglekit status
Check if your collector is online.
eaglekit status✔ Collector online: https://your-collector.vercel.appRequires EAGLEKIT_COLLECTOR_URL.
eaglekit flags list
List all feature flags for a project.
eaglekit flags list --project <project-id>Feature flags:
● on new-checkout-flow 50% [treatment]
● on dark-mode
○ off beta-exporteaglekit flags create
Create a new feature flag.
eaglekit flags create new-checkout-flow \
--project <project-id> \
--rollout 50 \
--variant treatmentOptions:
| Flag | Description | Default |
|---|---|---|
| --project | Project ID (required) | — |
| --rollout | Rollout percent 0–100 | 100 |
| --variant | Variant name | — |
eaglekit flags enable
Enable a flag (instant, no deploy needed).
eaglekit flags enable new-checkout-flow --project <project-id>eaglekit flags disable
Disable a flag — kill switch. Takes effect within 60 seconds (SDK cache TTL).
eaglekit flags disable new-checkout-flow --project <project-id>eaglekit deploy
Prints the Vercel one-click deploy URL for your collector.
eaglekit deployCI/CD usage
# .github/workflows/deploy.yml
- name: Disable flag on rollback
run: npx @eaglekit/cli flags disable risky-feature --project $PROJECT_ID
env:
EAGLEKIT_COLLECTOR_URL: ${{ secrets.EAGLEKIT_COLLECTOR_URL }}
EAGLEKIT_API_KEY: ${{ secrets.EAGLEKIT_API_KEY }}Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Auth error, API error, or missing env vars |
