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 -UAuthenticate
For interactive use, sign in with:
lightning loginFor non-interactive environments, configure credentials through environment variables instead:
export LIGHTNING_API_KEY=your-api-keyShell completion
Install native shell completion for your current shell:
lightning completion installSupported 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 zshThe 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 uninstallLocal 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 --helpCommon Workflows
- Develop interactively with Studio.
- Submit and inspect training or batch work with Job and Multi-Machine Training.
- Tail, follow, and search a run's logs with its own
logscommand — see Job, Multi-Machine Training, Deployment, and Sandbox. - Build and operate inference services with Deployment and Model.
- Move data and artifacts with File, Folder, Container, and Copy.
- Configure accounts, organizations, teamspaces, cloud accounts, and SSH with Config, and SSH.
- Manage lower-level sandbox sessions with Sandbox.
- Point coding agents (OpenCode, pi, Codex, DeepSeek Harness, Cursor) at code.lightning.ai with Code.
Command details
The pages below keep focused URLs for each command group and its full option reference.
Was this page helpful?
Thanks for the feedback.