Reference

CLI Reference

CLI Reference

Complete command-line interface reference for Lambda.


Installation

macOS / Linux

curl -fsSL https://get.lambda.io/install.sh | bash

Windows (PowerShell)

iwr https://get.lambda.io/install.ps1 -useb | iex

Using npm

npm install -g @lambda/cli

Using Homebrew (macOS)

brew tap lambda/tap
brew install lambda-cli

Global Options

Available for all commands:

OptionDescription
--api-key KEYOverride default API key
--region REGIONOverride default region
--output FORMATOutput format: json, yaml, table
--debugEnable debug logging
--no-colorDisable colored output
--quietSuppress non-error output
--versionShow version and exit
--helpShow help and exit

Authentication Commands

lambda login

Authenticate with Lambda account.

lambda login

Options:

  • --api-key KEY - Login with API key instead of browser
  • --org ORG - Switch to specific organization

Example:

lambda login --org my-company

lambda logout

Log out from Lambda account.

lambda logout

lambda whoami

Display current authentication information.

lambda whoami

Output:

Email: you@example.com
Organization: Your Company
Plan: Professional
Region: us-west-1

Instance Commands

lambda create instance

Create a new compute instance.

lambda create instance [options]

Options:

  • --name NAME - Instance name (required)
  • --type TYPE - Instance type (required)
  • --region REGION - Region (required)
  • --image IMAGE - OS image (required)
  • --ssh-key PATH - SSH public key file
  • --ssh-keys ID... - SSH key IDs
  • --firewall-rules FILE - Firewall rules file
  • --user-data FILE - User data script
  • --tags KEY=VALUE... - Instance tags
  • --encryption-key PATH - Encryption key file
  • --from-snapshot ID - Create from snapshot
  • --wait - Wait for instance to be ready

Examples:

# Basic instance
lambda create instance \
  --name web-server \
  --type compute-4x \
  --region us-west-1 \
  --image ubuntu-22.04

# With all options
lambda create instance \
  --name prod-api \
  --type compute-8x \
  --region eu-west-1 \
  --image ubuntu-22.04 \
  --ssh-key ~/.ssh/id_rsa.pub \
  --firewall-rules firewall.json \
  --user-data init.sh \
  --tags env=production app=api \
  --encryption-key ~/keys/master.pem \
  --wait

lambda list instances

List all instances.

lambda list instances [options]

Options:

  • --region REGION - Filter by region
  • --status STATUS - Filter by status (running, stopped, creating)
  • --tag KEY=VALUE - Filter by tag
  • --sort FIELD - Sort by field (name, created_at, status)
  • --limit N - Limit results

Examples:

# List all instances
lambda list instances

# Filter running instances
lambda list instances --status running

# Filter by tag
lambda list instances --tag env=production

lambda status

Get instance status.

lambda status INSTANCE_ID

Alias: lambda show, lambda info, lambda get

Output:

Instance: inst_abc123
Name: my-instance
Type: compute-4x
Status: running
Region: us-west-1
Image: ubuntu-22.04
Public IP: 203.0.113.42
Private IP: 10.0.1.5
Created: 2026-01-24T10:30:00Z
Uptime: 2 days, 5 hours

lambda start

Start a stopped instance.

lambda start INSTANCE_ID

Options:

  • --wait - Wait for instance to start

Example:

lambda start inst_abc123 --wait

lambda stop

Stop a running instance.

lambda stop INSTANCE_ID [options]

Options:

  • --force - Force stop (immediate, no graceful shutdown)
  • --wait - Wait for instance to stop

Example:

lambda stop inst_abc123 --wait

lambda restart

Restart an instance.

lambda restart INSTANCE_ID [options]

Options:

  • --wait - Wait for instance to restart

lambda destroy

Permanently delete an instance.

lambda destroy INSTANCE_ID [options]

Options:

  • --confirm - Skip confirmation prompt
  • --delete-volumes - Also delete attached volumes

Example:

lambda destroy inst_abc123 --confirm

lambda resize

Resize an instance to different type.

lambda resize INSTANCE_ID [options]

Options:

  • --type TYPE - New instance type (required)
  • --wait - Wait for resize to complete

Example:

lambda resize inst_abc123 --type compute-8x --wait

lambda ssh

SSH into an instance.

lambda ssh INSTANCE_ID [options]

Options:

  • --user USER - SSH user (default: lambda)
  • --port PORT - SSH port (default: 22)
  • --key PATH - SSH private key
  • --command CMD - Run command and exit

Examples:

# Interactive SSH
lambda ssh inst_abc123

# Run command
lambda ssh inst_abc123 --command "uptime"

# Different user
lambda ssh inst_abc123 --user root

Volume Commands

lambda create volume

Create a storage volume.

lambda create volume [options]

Options:

  • --name NAME - Volume name (required)
  • --size SIZE - Size in GB (required)
  • --region REGION - Region (required)
  • --type TYPE - Volume type (ssd, nvme)
  • --encryption-key PATH - Encryption key

Example:

lambda create volume \
  --name data-volume \
  --size 500GB \
  --region us-west-1

lambda list volumes

List all volumes.

lambda list volumes [options]

lambda attach volume

Attach volume to instance.

lambda attach volume VOLUME_ID [options]

Options:

  • --instance INSTANCE_ID - Instance to attach to (required)
  • --device PATH - Device path (default: auto)

Example:

lambda attach volume vol_abc123 --instance inst_xyz789

lambda detach volume

Detach volume from instance.

lambda detach volume VOLUME_ID

lambda delete volume

Delete a volume.

lambda delete volume VOLUME_ID [options]

Options:

  • --confirm - Skip confirmation

Snapshot Commands

lambda snapshot create

Create a snapshot.

lambda snapshot create INSTANCE_ID|VOLUME_ID [options]

Options:

  • --name NAME - Snapshot name
  • --description TEXT - Description

Example:

lambda snapshot create inst_abc123 --name "before-deploy"

lambda snapshot list

List all snapshots.

lambda snapshot list [options]

Options:

  • --instance INSTANCE_ID - Filter by instance
  • --volume VOLUME_ID - Filter by volume

lambda snapshot restore

Restore from snapshot.

lambda snapshot restore SNAPSHOT_ID [options]

Options:

  • --name NAME - New instance/volume name
  • --region REGION - Region to restore in

lambda snapshot delete

Delete a snapshot.

lambda snapshot delete SNAPSHOT_ID [options]

lambda snapshot schedule

Schedule automatic snapshots.

lambda snapshot schedule INSTANCE_ID [options]

Options:

  • --frequency FREQ - Frequency: hourly, daily, weekly
  • --time TIME - Time for snapshot (UTC)
  • --retain N - Number of snapshots to retain
  • --day DAY - Day for weekly (monday, tuesday, etc.)

Examples:

# Daily at 2 AM UTC, keep 7 days
lambda snapshot schedule inst_abc123 \
  --frequency daily \
  --time "02:00" \
  --retain 7

# Weekly on Sunday
lambda snapshot schedule inst_abc123 \
  --frequency weekly \
  --day sunday \
  --retain 4

Firewall Commands

lambda firewall allow

Allow traffic through firewall.

lambda firewall allow INSTANCE_ID [options]

Options:

  • --port PORT - Port number (required)
  • --protocol PROTO - Protocol: tcp, udp, icmp (default: tcp)
  • --source CIDR - Source IP/CIDR (required)
  • --description TEXT - Rule description

Example:

lambda firewall allow inst_abc123 \
  --port 443 \
  --protocol tcp \
  --source 0.0.0.0/0 \
  --description "HTTPS traffic"

lambda firewall deny

Deny traffic through firewall.

lambda firewall deny INSTANCE_ID [options]

lambda firewall list

List firewall rules.

lambda firewall list INSTANCE_ID

lambda firewall remove

Remove firewall rule.

lambda firewall remove INSTANCE_ID [options]

Options:

  • --rule RULE_ID - Rule ID to remove

Monitoring Commands

lambda metrics

Get instance metrics.

lambda metrics INSTANCE_ID [options]

Options:

  • --metric NAME - Specific metric (cpu, memory, network, disk)
  • --period DURATION - Time period (1h, 24h, 7d, 30d)
  • --interval DURATION - Data point interval

Example:

lambda metrics inst_abc123 --metric cpu --period 24h

lambda logs

Get instance logs (metadata only, not application logs).

lambda logs INSTANCE_ID [options]

Options:

  • --follow - Follow logs in real-time
  • --since TIME - Show logs since time
  • --until TIME - Show logs until time

lambda wait

Wait for instance to reach state.

lambda wait INSTANCE_ID [options]

Options:

  • --status STATUS - Wait for status (running, stopped)
  • --timeout SECONDS - Timeout (default: 300)

Network Commands

lambda network info

Get network information.

lambda network info INSTANCE_ID

lambda network assign-ip

Assign public IP to instance.

lambda network assign-ip INSTANCE_ID

lambda network release-ip

Release public IP from instance.

lambda network release-ip INSTANCE_ID

Billing Commands

lambda billing usage

Get usage information.

lambda billing usage [options]

Options:

  • --month YYYY-MM - Specific month (default: current)
  • --detailed - Detailed breakdown

Example:

lambda billing usage --month 2026-01 --detailed

lambda billing estimate

Estimate costs.

lambda billing estimate [options]

Options:

  • --instance-type TYPE - Instance type
  • --hours HOURS - Number of hours
  • --region REGION - Region

Example:

lambda billing estimate \
  --instance-type compute-4x \
  --hours 730

lambda billing invoices

List invoices.

lambda billing invoices [options]

Options:

  • --status STATUS - Filter by status (paid, unpaid, overdue)
  • --year YEAR - Filter by year

API Key Commands

lambda api-keys create

Create API key.

lambda api-keys create [options]

Options:

  • --name NAME - Key name (required)
  • --permissions PERMS... - Permissions
  • --expires DATE - Expiration date

Example:

lambda api-keys create \
  --name "ci-deploy" \
  --permissions "instances:create,instances:delete"

lambda api-keys list

List API keys.

lambda api-keys list

lambda api-keys delete

Delete API key.

lambda api-keys delete KEY_ID

Configuration Commands

lambda config set

Set configuration value.

lambda config set KEY VALUE

Examples:

lambda config set region eu-west-1
lambda config set output json

lambda config get

Get configuration value.

lambda config get KEY

lambda config list

List all configuration.

lambda config list

Utility Commands

lambda version

Show CLI version.

lambda version

lambda update

Update CLI to latest version.

lambda update

lambda docs

Open documentation in browser.

lambda docs [TOPIC]

Example:

lambda docs instances

Shell Completion

Bash

lambda completion bash > /etc/bash_completion.d/lambda

Zsh

lambda completion zsh > "${fpath[1]}/_lambda"

Fish

lambda completion fish > ~/.config/fish/completions/lambda.fish

Environment Variables

VariableDescription
LAMBDA_API_KEYAPI key for authentication
LAMBDA_REGIONDefault region
LAMBDA_OUTPUTDefault output format
LAMBDA_CONFIG_DIRConfig directory location
LAMBDA_DEBUGEnable debug mode

Exit Codes

CodeMeaning
0Success
1General error
2Invalid arguments
3Authentication failed
4Resource not found
5Permission denied
6Rate limit exceeded
7Server error

Examples

Complete Workflow

# 1. Login
lambda login

# 2. Create instance
lambda create instance \
  --name my-app \
  --type compute-4x \
  --region us-west-1 \
  --image ubuntu-22.04 \
  --wait

# 3. Configure firewall
lambda firewall allow inst_abc123 --port 80 --source 0.0.0.0/0
lambda firewall allow inst_abc123 --port 443 --source 0.0.0.0/0

# 4. Deploy application
lambda ssh inst_abc123 --command "git clone https://github.com/user/app"

# 5. Monitor
lambda metrics inst_abc123 --period 1h

# 6. Create backup
lambda snapshot create inst_abc123 --name "production-backup"

Next Step

Check the FAQ for common questions.

Frequently Asked Questions →


Think Lambda, Think Privacy