Skip to main content

CLI Commands Reference

Complete reference for all available commands in the Superflag CLI.

Quick Commands

Optimized for automation and AI agents with minimal output.

use

Set default app and environment context.
superflag use <app> <env>
Example:
superflag use my-app production
# Output: ✓ Context set to my-app/production
Context is saved to ~/.superflag/context.json and used by get and set commands.

get

Get a flag value using saved context.
superflag get <key>
Example:
superflag get dark-mode
# Output: true
Requires context to be set with superflag use.

set

Set a flag value using saved context.
superflag set <key> <value>
Example:
superflag set dark-mode false
# Output: ✓
Requires context to be set with superflag use.

config

Dump full config as JSON.
superflag config
Example:
superflag config
# Output: {"flags":{"dark-mode":{"type":"bool","value":true}},...}
Useful for debugging or piping to other tools.

Authentication Commands

login

Log in to your Superflag account.
superflag login
Opens browser for OAuth authentication.

logout

Log out and clear credentials.
superflag logout

whoami

Show current user.
superflag whoami
# Output: Logged in as: you@example.com

status

Show authentication and context status.
superflag status
# Output:
# Auth: Logged in as you@example.com
# Context: my-app/production

App Management

apps list

List all your apps.
superflag apps list

apps create

Create a new app.
superflag apps create <name>
Example:
superflag apps create my-new-app

Environment Management

envs list

List environments for an app.
superflag envs list --app <name>
Example:
superflag envs list --app my-app

Flag Management

flags list

List all flags in an environment.
superflag flags list --app <app> --env <env>
Example:
superflag flags list --app my-app --env production

flags create

Create a new flag.
superflag flags create --app <app> --env <env> --key <key> --type <type> --value <value>
Types: bool, string, number, json Example:
superflag flags create \
  --app my-app \
  --env production \
  --key new-feature \
  --type bool \
  --value true

flags set

Set a flag value.
superflag flags set --app <app> --env <env> --key <key> --value <value>
Example:
superflag flags set \
  --app my-app \
  --env production \
  --key dark-mode \
  --value false

flags toggle

Toggle a boolean flag.
superflag flags toggle --app <app> --env <env> --key <key>
Example:
superflag flags toggle \
  --app my-app \
  --env production \
  --key beta-features

flags delete

Delete a flag.
superflag flags delete --app <app> --env <env> --key <key>
Example:
superflag flags delete \
  --app my-app \
  --env production \
  --key old-feature

flags upsert

Create or update a flag (idempotent).
superflag flags upsert --key <key> --type <type> --value <value> [--client]
Flags:
  • --client: Make flag available to client SDKs
Example:
# Uses context from `superflag use`
superflag flags upsert \
  --key api-url \
  --type string \
  --value https://api.example.com \
  --client

flags bulk-set

Set multiple flags from a JSON file.
superflag flags bulk-set [--file <path>]
JSON Format:
{
  "dark-mode": true,
  "api-url": "https://api.example.com",
  "max-retries": 3
}
Example:
superflag flags bulk-set --file flags.json
If --file is not provided, reads from stdin:
echo '{"dark-mode": true}' | superflag flags bulk-set

Key Management

keys list

List API keys for an environment.
superflag keys list --app <app> --env <env>

keys create

Create a new API key.
superflag keys create --app <app> --env <env> --type <type>
Types: sdk, pub Example:
superflag keys create \
  --app my-app \
  --env production \
  --type pub

keys revoke

Revoke an API key.
superflag keys revoke <key-id>

Options

Global Options

Available on all commands:
OptionDescription
--help, -hShow help
--version, -vShow version

Exit Codes

CodeMeaning
0Success
1Error
2Not authenticated
3Not found

Examples

Set up a new project

# Log in
superflag login

# Create app
superflag apps create my-project

# Set context
superflag use my-project production

# Create flags
superflag flags upsert --key dark-mode --type bool --value false --client
superflag flags upsert --key api-url --type string --value https://api.example.com

# Get flag value
superflag get dark-mode

Update flags in automation

# Set context once
superflag use my-app staging

# Quick updates
superflag set feature-a true
superflag set feature-b false

# Or bulk update
cat > flags.json <<EOF
{
  "feature-a": true,
  "feature-b": false,
  "api-timeout": 30
}
EOF
superflag flags bulk-set --file flags.json

Next Steps