Docs

CLI Reference

Complete reference for all Redshift CLI commands.

Global Options

These options are available for all commands:

OptionDescription
--help, -hShow help for command
--version, -vShow version number
--jsonOutput in JSON format
--silentDisable info messages
--debugShow debug output
--config-dir <path>Override config directory (default: ~/.redshift)

redshift login

Authenticate with your Nostr identity.

FlagDescription
--nsec <nsec>Nostr private key (nsec1...)
--bunker <uri>, -bNIP-46 bunker URL
--connect, -cGenerate NostrConnect URI for bunker pairing
--overwriteOverwrite existing token if one exists

Subcommands

login revoke — Revoke auth token (alias for logout). Accepts --yes / -y.

Authentication Methods

  1. Interactive — Run redshift login and you will be prompted for your nsec (hidden input).
  2. Direct nsec — Pass the key directly with the --nsec flag.
  3. NIP-46 Bunker — Use --bunker "bunker://..." (always quote the URL).
  4. NostrConnect — Use --connect to generate a URI for bunker pairing.
  5. Environment variables — Set REDSHIFT_NSEC or REDSHIFT_BUNKER to bypass interactive login.

Examples

# Interactive login (recommended)
redshift login

# Login with nsec
redshift login --nsec nsec1...

# Login via NIP-46 bunker
redshift login --bunker "bunker://pubkey?relay=wss://...&secret=..."

# Generate NostrConnect URI
redshift login --connect

redshift logout

Clear stored credentials (nsec from keychain and config file).

FlagDescription
--yes, -yProceed without confirmation

redshift me

Display info about the currently authenticated identity. Shows auth method, public key (npub), and auth source. Also available as redshift whoami. Supports --json.


redshift setup

Configure project and environment for the current directory. Creates a redshift.yaml file.

FlagDescription
--project, -pProject name
--config, -cConfig/environment slug (e.g. dev, staging, prod)
--no-interactiveDo not prompt; error if project/config not specified

Examples

# Interactive setup
redshift setup

# Direct setup
redshift setup -p my-app -c development

# CI/CD (no prompts)
redshift setup --no-interactive -p my-app -c production

This creates a redshift.yaml file in the current directory:

project: my-app
config: development
relays:
  - wss://relay.damus.io
  - wss://relay.primal.net

redshift run

Run a command with secrets injected as environment variables.

redshift run [options] -- <command> [args...]
FlagDescription
--commandCommand to execute (alternative to -- syntax)
--project, -pOverride project
--config, -cOverride config/environment
--mount <path>Write secrets to an ephemeral file (accessible at REDSHIFT_CLI_SECRETS_PATH)
--mount-format <fmt>File format for mount: env or json (default: json)
--fallback <file>Path to fallback file for offline mode
--fallback-onlyRead all secrets from fallback file only
--fallback-readonlyDisable modifying the fallback file
--no-fallbackDisable reading/writing fallback file
--forward-signalsForward signals to child process (default: true)
--preserve-env <keys>Comma-separated list of secrets where existing env value takes precedence

Subcommands

run clean — Delete old fallback files.

Examples

# Run with secrets injected
redshift run -- npm start
redshift run -- python manage.py runserver

# Override environment
redshift run -c production -- npm run deploy

# Mount secrets to file
redshift run --mount secrets.json -- cat secrets.json
redshift run --mount .env --mount-format env -- ./start.sh

# Fallback for offline mode
redshift run --fallback ./fallback.json -- npm start
redshift run --fallback-only -- npm start

# Preserve existing env values
redshift run --preserve-env PORT,HOST -- npm start

redshift secrets

Manage secrets. When run without a subcommand, defaults to listing secrets.

FlagDescription
--project, -pOverride project
--config, -cOverride config/environment
--only-namesOnly print secret names, omit values
--rawPrint raw secret values without redaction

secrets get

Get one or more secret values.

redshift secrets get <KEY> [options]
FlagDescription
--plainPrint values without formatting
--copyCopy value(s) to clipboard
--no-exit-on-missing-secretDo not exit if secret not found

secrets set

Set one or more secrets. Accepts KEY VALUE pairs or KEY=VALUE syntax.

redshift secrets set <KEY> <VALUE>
redshift secrets set KEY=VALUE
FlagDescription
--no-interactiveDo not allow interactive secret value entry

secrets delete

Delete one or more secrets.

redshift secrets delete <KEY> [options]
FlagDescription
--yes, -yProceed without confirmation

secrets download

Download secrets in various formats.

redshift secrets download [filepath] [options]
FlagDescription
--format <type>Output format: json, env, yaml, docker, env-no-quotes (default: json)
--no-filePrint to stdout instead of file
--passphrasePassphrase for encrypting the secrets file

secrets upload

Upload a secrets file (default: .env). Parses .env format and merges with existing secrets on the relay.

redshift secrets upload [filepath]

Examples

# List secrets
redshift secrets
redshift secrets --raw
redshift secrets --json
redshift secrets --only-names

# Get
redshift secrets get API_KEY
redshift secrets get API_KEY --plain
redshift secrets get API_KEY --copy

# Set
redshift secrets set API_KEY sk_live_xxx
redshift secrets set DB_URL 'postgres://...' REDIS_URL 'redis://...'

# Delete
redshift secrets delete OLD_KEY
redshift secrets delete KEY1 KEY2 -y

# Download
redshift secrets download ./secrets.json
redshift secrets download --format=env --no-file
redshift secrets download --format=env ./secrets.env

# Upload
redshift secrets upload .env
redshift secrets upload secrets.json

redshift configure

View and modify CLI configuration.

FlagDescription
--allPrint all saved options

Subcommands

  • configure get [options...] — Get specific config values.
  • configure set key=value [...] — Set config values. Allowed keys: relays, defaultProject, defaultEnvironment.
  • configure unset key [...] — Remove config values.
  • configure reset --yes — Reset configuration to initial state.

Sensitive keys like nsec are blocked from being set via configure.


redshift serve

Start the web administration UI.

FlagDescription
--port, -pPort to listen on (default: 3000)
--host, -HHost to bind to (default: 127.0.0.1)
--open, -oOpen browser automatically

redshift upgrade

Self-update the CLI binary from GitHub releases. Also available as redshift update.

FlagDescription
--force, -fForce install even if already on latest version
--tag, -tInstall a specific version (e.g. v0.3.0)

Environment Variables

Redshift respects these environment variables:

VariableDescription
REDSHIFT_NSECPrivate key for CI/CD (bypasses interactive login)
REDSHIFT_BUNKERNIP-46 bunker URL for CI/CD
REDSHIFT_CONFIG_DIROverride config directory (default: ~/.redshift)

Configuration Files

~/.redshift/config.json

Global auth config containing nsec, bunker, auth method, relays, and defaults.

redshift.yaml

Per-project config specifying the project name, config/environment, and relay URLs. Created by redshift setup.


Exit Codes

CodeMeaning
0Success
1General error
2Authentication required
3Project/environment not configured