CLI Reference

XtraSecurity CLI

Complete reference for all 31 commands. Search below to find specific syntax, options, and usage examples.

Installation

The CLI is distributed as an npm package. You can install it globally using your preferred package manager.

Verify Installation

Run xtra --version to ensure the CLI is correctly installed.
>_Terminal
npm install -g xtra-cli

Authentication

Login and authentication

xtra login

Authenticate with XtraSecurity Cloud platform

>_Terminal
$xtra login [OPTIONS]

Options

-k, --key <key>Login using Access Key (non-interactive)
-e, --email <email>Login using Email (will prompt for password)
--ssoLogin via Web/Browser SSO

Usage Examples

>_Terminal
$xtra login

Project & Setup

Initialize and manage projects

xtra init

Bootstrap a new project with .xtrarc configuration

>_Terminal
$xtra init [OPTIONS]

Options

--project <id>Project ID (skip interactive prompt)
--env <env>Default environment
--branch <branch>Default branch
-y, --yesAccept all defaults automatically

Usage Examples

>_Terminal
$xtra init
xtra project

Set and manage default project context

>_Terminal
$xtra project <subcommand> [OPTIONS]

Available Subcommands

xtra project set
Set default project
xtra project current
Show current project
xtra branch

Manage branches in a project

>_Terminal
$xtra branch <subcommand> [OPTIONS]

Available Subcommands

xtra branch list
List all branches
xtra branch create
Create a new branch
xtra branch delete
Delete a branch
xtra branch update
Update branch details
xtra checkout

Switch to a different branch

>_Terminal
$xtra checkout [branchName]

Usage Examples

>_Terminal
$xtra checkout staging

Secrets Management

Create, update, rotate secrets

xtra secrets

Manage secrets (List, Set, Delete)

>_Terminal
$xtra secrets <subcommand> [OPTIONS]

Available Subcommands

xtra secrets list
List all secrets
xtra secrets set
Set one or more secrets (KEY=VALUE)
xtra secrets delete
Delete a secret

Options

-p, --project <projectId>Project ID
-e, --env <environment>Environment
-b, --branch <branchName>Branch name
xtra rotate

Rotate a secret with Zero-Downtime Shadow Mode

>_Terminal
$xtra rotate <key> [OPTIONS]

Options

-p, --project <projectId>Project ID
-e, --env <environment>Environment
--strategy <strategy>Rotation strategy
--promotePromote shadow to active
--value <value>New secret value

Usage Examples

>_Terminal
$xtra rotate DATABASE_PASSWORD

Version Control

View and manage secret versions

xtra history

View version history of a secret

>_Terminal
$xtra history <key> [OPTIONS]

Options

-p, --project <id>Project ID
-e, --env <environment>Environment

Usage Examples

>_Terminal
$xtra history DATABASE_URL
xtra rollback

Rollback secret to previous version

>_Terminal
$xtra rollback <key> [version] [OPTIONS]

Options

-p, --project <projectId>Project ID
-e, --env <environment>Environment

Usage Examples

>_Terminal
$xtra rollback DATABASE_URL

Execution

Run commands with injected secrets

xtra run

Run a command with injected secrets

>_Terminal
$xtra run [OPTIONS] <command> [args...]

REFERENCE

Secrets injected in-memory, never written to disk

Options

-p, --project <projectId>Project ID
-e, --env <environment>Environment
-b, --branch <branchName>Branch Name
--shellEnable shell mode (for npm run, pipes, etc.)

Usage Examples

>_Terminal
$xtra run node app.js
xtra watch

Live reload - auto-restart on secret changes

>_Terminal
$xtra watch [OPTIONS] <command> [args...]

REFERENCE

Not allowed in production

Options

-p, --project <id>Project ID
-e, --env <environment>Environment
-b, --branch <branch>Branch
--interval <seconds>Poll interval
--shellUse shell mode

Usage Examples

>_Terminal
$xtra watch -p proj_123 node app.js
xtra simulate

Dry-run: show what would be injected

>_Terminal
$xtra simulate [command] [OPTIONS]

Options

-p, --project <id>Project ID
-e, --env <environment>Environment
-b, --branch <branch>Branch
--show-valuesReveal values
--diffCompare with local env

Usage Examples

>_Terminal
$xtra simulate node app.js

Configuration

Generate and manage config files

xtra generate

Generate local configuration files (.env, JSON, YAML)

>_Terminal
$xtra generate [OPTIONS]

Options

-p, --project <projectId>Project ID
-e, --env <environment>Environment
-b, --branch <branchName>Branch name
-o, --output <path>Output file (full overwrite if specified)
-f, --format <format>Format: env, json, yaml
--forceSkip prompts

Usage Examples

>_Terminal
$xtra generate
xtra import

Import secrets from file (JSON, CSV, .env)

>_Terminal
$xtra import <file> [OPTIONS]

Options

-p, --project <projectId>Project ID
-e, --env <environment>Environment
-b, --branch <branchName>Branch name
-f, --format <format>Format: json, dotenv, csv (auto-detected)
--prefix <prefix>Add prefix to all keys

Usage Examples

>_Terminal
$xtra import secrets.json -e staging
xtra export

Export secrets to file (JSON, CSV, .env)

>_Terminal
$xtra export [OPTIONS]

Options

-p, --project <projectId>Project ID
-e, --env <environment>Environment
-b, --branch <branchName>Branch name
-f, --format <format>Format: json, dotenv, csv
-o, --output <file>Output file (default: stdout)

Usage Examples

>_Terminal
$xtra export -o secrets.json
xtra template

Templating engine with placeholder substitution

>_Terminal
$xtra template <subcommand> [OPTIONS]

Available Subcommands

xtra template render
Render template with injected secrets
xtra template check
Check for unresolved placeholders
xtra template list
List placeholders in template

Usage Examples

>_Terminal
$xtra template render config.yaml.tpl -e production -o config.yaml
xtra profile

Manage named configuration profiles

>_Terminal
$xtra profile <subcommand> [OPTIONS]

Available Subcommands

xtra profile list
List all profiles
xtra profile create
Create new profile
xtra profile use
Switch to profile
xtra profile set
Update profile values
xtra profile delete
Remove a profile

Usage Examples

>_Terminal
$xtra profile list

Environment

Environment and mode management

xtra local

Toggle offline mode for local development

>_Terminal
$xtra local <subcommand> [OPTIONS]

Available Subcommands

xtra local status
Show current mode (cloud or local)
xtra local on
Enable local offline mode
xtra local off
Disable local mode
xtra local sync
Pull cloud secrets to .env.local

Usage Examples

>_Terminal
$xtra local status
xtra env

Environment management (clone, sync)

>_Terminal
$xtra env <subcommand> [OPTIONS]

Available Subcommands

xtra env clone
Clone secrets from one environment to another

Audit & Logging

Audit trails and compliance

xtra logs

View local audit logs

>_Terminal
$xtra logs [OPTIONS]

Options

-n, --limit <number>Number of logs to show
--syncSync unsynced logs to cloud
--event <type>Filter by event type
--project <projectId>Filter by project
--since <duration>Show logs since (1h, 24h, 7d, 30d)
--jsonJSON output

Usage Examples

>_Terminal
$xtra logs
xtra audit

Manage server-side audit logs

>_Terminal
$xtra audit <subcommand> [OPTIONS]

Available Subcommands

xtra audit verify
Verify integrity of audit chain
xtra audit export
Export logs for compliance

Usage Examples

>_Terminal
$xtra audit verify

Security

Security scanning and leak detection

xtra scan

Scan project for leaked secrets

>_Terminal
$xtra scan [OPTIONS]

Options

--stagedScan only staged files
--install-hookInstall git pre-commit hook

Usage Examples

>_Terminal
$xtra scan

Access Control

JIT access and permissions

xtra access

Manage JIT access requests

>_Terminal
$xtra access <subcommand> [OPTIONS]

Available Subcommands

xtra access request
Request temporary access
xtra access list
List access requests
xtra access approve
Approve/reject request

Usage Examples

>_Terminal
$xtra access request -p proj_123 -d 30 -r 'Issue investigation'

Administration

Admin user and role management

xtra admin

User and role management (admin only)

>_Terminal
$xtra admin <subcommand> [OPTIONS]

Available Subcommands

xtra admin users
List all users
xtra admin set-role
Set user role
xtra admin role list
List available roles

Integrations

External service integrations

xtra integration

Manage external integrations

>_Terminal
$xtra integration <subcommand> [OPTIONS]

Available Subcommands

xtra integration sync
Sync to GitHub
xtra integration kubernetes export
Export as K8s manifest

CI/CD

Pipeline automation

xtra ci

CI/CD headless mode (JSON output, no prompts)

>_Terminal
$xtra ci <subcommand> [OPTIONS]

Available Subcommands

xtra ci secrets
Fetch secrets as JSON
xtra ci set
Set secrets in CI mode
xtra ci export
Export to file
xtra ci run
Run command with secrets

Usage Examples

>_Terminal
XTRA_MACHINE_TOKEN=tok_xxx xtra ci secrets -p proj_123 -e production

Utilities

Utility and diagnostic commands

xtra status

Check synchronization status with cloud

>_Terminal
$xtra status [OPTIONS]

Options

-p, --project <projectId>Project ID
-e, --env <environment>Environment
-b, --branch <branchName>Branch name

Usage Examples

>_Terminal
$xtra status
xtra diff

Show differences between environments or local vs remote

>_Terminal
$xtra diff [env1] [env2] [OPTIONS]

Options

-p, --project <projectId>Project ID
-e, --env <environment>Environment
-b, --branch <branchName>Branch name
--showShow actual values

Usage Examples

>_Terminal
$xtra diff
xtra doctor

Diagnose CLI setup and connectivity

>_Terminal
$xtra doctor [OPTIONS]

Options

--jsonJSON output

Usage Examples

>_Terminal
$xtra doctor
xtra ui

Interactive terminal dashboard

>_Terminal
$xtra ui

Usage Examples

>_Terminal
$xtra ui
xtra completion

Shell completion scripts

>_Terminal
$xtra completion <shell>

Available Subcommands

xtra completion bash
Bash completion
xtra completion zsh
Zsh completion
xtra completion powershell
PowerShell completion
xtra completion install
Auto-install for current shell

Usage Examples

>_Terminal
$xtra completion bash >> ~/.bashrc
xtra logs

View local audit logs

>_Terminal
$xtra logs [OPTIONS]

Options

-n, --limit <number>Number of logs to show
--syncSync unsynced logs to cloud
--event <type>Filter by event type
--project <projectId>Filter by project
--since <duration>Show logs since (1h, 24h, 7d, 30d)
--jsonJSON output

Usage Examples

>_Terminal
$xtra logs