Command Line Interface

The Python package installs the lightning command. The lightning-sdk console script is an alias for the same command group.

Use the CLI when you want to manage Lightning AI resources from a terminal, CI job, shell script, or other automation.

Install

Install or upgrade the Python package:

pip install lightning-sdk -U

Authenticate

For interactive use, sign in with:

lightning login

For non-interactive environments, configure credentials through environment variables instead:

export LIGHTNING_API_KEY=your-api-key

Shell completion

Install native shell completion for your current shell:

lightning completion install

Supported shells are Zsh, Fish, and Bash 4.4 or newer.

Pass the shell explicitly when it cannot be detected from $SHELL:

lightning completion install --shell zsh

The installer writes a static completion script and configures Bash or Zsh to source it. Fish uses its native auto-loaded completions directory. This avoids importing the CLI while the shell starts. Check or remove the installation with:

lightning completion status
lightning completion uninstall

Local paths are completed by the shell. Paths beginning with lit:// are resolved dynamically from accessible Teamspaces, Studios, and remote files without opening interactive CLI prompts. Resource options also complete dynamically, including --teamspace owner/teamspace and existing Studio selectors such as lightning studio stop --name when a Teamspace is selected or configured.

Usage

Run a command group directly:

lightning [command]

Every command and subcommand exposes help directly:

lightning COMMAND --help

Common Workflows

Command details

The pages below keep focused URLs for each command group and its full option reference.

Was this page helpful?

What went wrong?

↑↓ Navigate↵ Open⌘↵ New tabesc Close