Skip to main content

CLI tool for Lambda Labs Cloud

Project description

Lambda Labs Cloud CLI

A simple command-line interface for managing Lambda Labs Cloud GPU instances.

Installation

  1. Clone this repository and navigate to the directory:
cd lambda-cli
  1. Install the package:
pip install -e .
  1. (Optional) If the lambda command is not in your PATH, add this to your shell configuration:
# Add to ~/.bashrc or ~/.zshrc
export PATH="$HOME/Library/Python/3.11/bin:$PATH"

Or use the full path: /Users/<username>/Library/Python/3.11/bin/lambda

Quick Start

  1. Configure your API key:
lambda config set-key YOUR_API_KEY

You can get your API key from the Lambda Cloud Console.

  1. List available instance types:
lambda instances look
  1. List your running instances:
lambda instances ls

Commands

Configuration

Set API Key

lambda config set-key <api-key>

Save your Lambda Labs Cloud API key to ~/.lambda/config.json.

Show Configuration

lambda config show

Display your current configuration (API key will be masked).

Clear Configuration

lambda config clear

Remove the configuration file.

Instances

List Instances (ls)

lambda instances ls

List all your running instances with their details (ID, name, instance type, region, status, IP).

Look at Instance Types (look)

lambda instances look

Display all available instance types with specs and available regions.

Options:

  • --available / -a: Show only instance types with available capacity

Example:

lambda instances look --available

Get Instance Details (get)

lambda instances get <instance-id>

Get detailed information about a specific instance.

Example:

lambda instances get 0920582c7ff041399e34823a0be62549

Launch Instances (launch)

lambda instances launch \
  --type <instance-type> \
  --region <region> \
  --ssh-key <ssh-key-name> \
  [--file-system <fs-name>] \
  [--quantity <number>] \
  [--name <instance-name>]

Launch new GPU instances.

Required Options:

  • --type / -t: Instance type (e.g., gpu_1x_a10)
  • --region / -r: Region (e.g., us-west-1)
  • --ssh-key / -k: SSH key name (can be specified multiple times)

Optional Options:

  • --file-system / -f: File system name to attach (can be specified multiple times)
  • --quantity / -q: Number of instances to launch (default: 1)
  • --name / -n: Name for the instance

Example:

lambda instances launch \
  --type gpu_1x_a10 \
  --region us-west-1 \
  --ssh-key my-ssh-key \
  --quantity 1 \
  --name my-gpu-instance

Terminate Instances (terminate)

lambda instances terminate <instance-id> [<instance-id> ...]

Terminate one or more instances. You'll be prompted for confirmation unless you use --yes.

Options:

  • --yes / -y: Skip confirmation prompt

Example:

lambda instances terminate 0920582c7ff041399e34823a0be62549 --yes

Restart Instances (restart)

lambda instances restart <instance-id> [<instance-id> ...]

Restart one or more instances.

Example:

lambda instances restart 0920582c7ff041399e34823a0be62549

API Documentation

This CLI uses the Lambda Labs Cloud API. For more information, see:

Configuration File

The CLI stores your API key in ~/.lambda/config.json. This file has restricted permissions (600) for security.

Requirements

  • Python >= 3.11
  • httpx >= 0.27.0
  • typer >= 0.12.0
  • rich >= 13.7.0

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lambda_labs_cli-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lambda_labs_cli-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file lambda_labs_cli-0.1.0.tar.gz.

File metadata

  • Download URL: lambda_labs_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for lambda_labs_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 16580a404bb19e4b5638564f9ec929bb9455c87c6f7d7e493944bd32321580e9
MD5 11c793027ac8e24ff244dd38752515fc
BLAKE2b-256 fda86e7038797f159f0dea29007e13352a8f6e50c58786281fe4c2ce457e458f

See more details on using hashes here.

File details

Details for the file lambda_labs_cli-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lambda_labs_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bca7ec28d2a1b11086b8b1a909970b293280f95720b77b8fe1a0410c1d9a15d
MD5 c414d769bebdbc356cc3aed56f416f0c
BLAKE2b-256 f5688929c5fcb874b72882afae1e46281ea1d85cf238a9eb680f5f5c55a12f36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page