Skip to main content

CLI Reference (kfl)

Complete reference for the Keyflare command-line interface.

Installation

Or use directly with npx:

Global Options

Commands

kfl init

Deploy or update Keyflare on your Cloudflare account.
Authentication:
  • Reuses existing Wrangler session when available
  • Falls back to CLOUDFLARE_API_TOKEN environment variable
  • Prompts for OAuth browser login or API token if neither available
Preflight Check: Before creating a new bootstrap key, kfl init checks your local configuration:
  • If the new API URL differs from your stored URL, you’ll see a warning
  • If credentials exist locally and a new bootstrap key would be created, you’ll be prompted to confirm
If you decline the prompt:
  • The worker is still deployed/updated
  • Bootstrap is skipped (someone else can run it)
  • Your local config and credentials are preserved
Use -y to auto-accept all prompts. Multiple Instances: You can deploy multiple Keyflare instances by using different names:
Using an Existing D1 Database: To bind Keyflare to an existing D1 database (e.g., for migration or disaster recovery):
This skips database creation and binds the worker to the specified database. Migrations will run against it on first deploy.

kfl login

Log in to an existing Keyflare deployment.
Interactive prompts for:
  1. Keyflare API URL
  2. API key
Saves credentials to ~/.config/keyflare/.

kfl projects

Manage projects.

kfl environments (alias: env)

Manage environments.

kfl secrets

Manage secrets.
Upload replaces ALL existing secrets in the target environment.
Legacy aliases are still available but deprecated: kfl upload, kfl download.

kfl run

Run a command with secrets injected as environment variables. Commands are executed directly (argv-preserving), so quoting works reliably for cases like node -e '...'. If you need shell features ($VAR expansion, pipes, redirects, &&), run an explicit shell command such as sh -c 'echo $MYSECRET | cut -d@ -f2'.
Examples:

kfl keys

Manage API keys.

Exit Codes