lsh is the Latitude.sh command-line interface (CLI) that will help you make it easier to retrieve any data from your team or perform any action you need.
Installing the latest version
brew install latitudesh/tools/lsh
curl -fsSL https://cli.latitude.sh/install.sh | shVisit the releases page and select any version you want to download.
Log in into Latitude.sh. An API Key is required.
lsh login <API_KEY>The CLI automatically detects when you use sudo and loads your credentials from your user directory.
List your servers
lsh servers listThe list of the available commands is available here.
See more examples here.
List a server with a specific hostname:
lsh servers list --hostname <HOSTNAME>
Create a server with Ubuntu 24:
lsh servers create --operating_system ubuntu_24_04_x64_lts --project <PROJECT_ID_OR_SLUG> --site <LOCATION> --hostname <HOSTNAME> --plan <PLAN>
List all GPU plans:
lsh plans list --gpu true
Check plan availability per location (one row per plan × location, with stock_level):
lsh plans stockShow only locations that currently have stock:
lsh plans stock --in_stockFilter by region, GPU, or hardware spec and export as CSV:
lsh plans stock --region "United States" --in_stock -o csv > us_plans.csvCombine filters for scripting with jq (use -o json when piping — the default table is meant for humans):
lsh plans stock --gpu --ram_gte 64 -o json | jq '.[] | {plan: .plan_slug, loc: .location, stock: .stock_level}'List volumes:
lsh volume list --project <PROJECT_ID>
Mount volume to a server (requires sudo, auto-installs nvme-cli and connects):
# First, login as normal user
lsh login <API_KEY>
# Then mount with sudo (automatically uses your credentials)
sudo lsh volume mount --id vol_abc123Why sudo is required:
- Installs
nvme-clipackage if not present - Loads NVMe kernel modules (
nvme_tcp) - Writes to
/etc/nvme/hostnqn - Runs privileged
nvme connectcommands
Important:
- Login as a normal user (without sudo):
lsh login <API_KEY> - The CLI automatically finds your credentials when you run commands with sudo
- Volume mount needs sudo for nvme-cli installation and NVMe operations
Every list command can render its results in different formats, so the output
is easy to consume from scripts, CI pipelines and AI agents. See lsh help output-formats for the full guide.
lsh servers list -o table # human-readable table (default)
lsh servers list -o json # JSON
lsh servers list -o yaml # YAML
lsh servers list -o csv # CSV (header + one row per item)
lsh servers list --json # shortcut for -o jsonFilter the structured output with a JMESPath expression
via --query (works with json/yaml/csv):
lsh servers list --query "[?status=='on'].id" -o jsonControl pagination on large listings:
lsh servers list --page-size 50 # items per API page
lsh servers list --max-items 100 # stop after N items (0 = no limit)
lsh servers list --no-paginate # first page only; next page printed to stderr| Variable | Purpose |
|---|---|
LSH_OUTPUT |
Default output format (table/json/yaml/csv). Precedence: --output flag > LSH_OUTPUT > config file > default. |
LSH_CLASSIC_OUTPUT |
Set to true to force the legacy plain-ASCII table. An explicit -o json/yaml/csv still wins over it. |
LATITUDESH_TOKEN |
API token; bypasses any stored profile (see lsh help authentication). |
LSH_PROFILE |
Use the named profile for the command. |
LSH_PROJECT |
Pre-fill --project so list commands don't prompt. |
If you encounter any problems when installing the CLI with the installation script, you can use the command below to uninstall the CLI.
curl -sSL https://raw.githubusercontent.com/latitudesh/cli/main/uninstall.sh | bashIf sudo lsh volume mount says "API key not found":
# Make sure you've logged in as your normal user (not with sudo)
lsh login <API_KEY>
# Then try mount again
sudo lsh volume mount --id <VOLUME_ID>The CLI automatically detects your username via the SUDO_USER environment variable and loads your config.
For more information, see the documentation.
-
Open an issue for questions, feedback, bug reports or feature requests.
-
We welcome pull requests for bug fixes, new features, and improvements to the examples.