> ## Documentation Index
> Fetch the complete documentation index at: https://www.latitude.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Latitude.sh CLI

`lsh` is Latitude.sh's command line interface. [Free and open source](https://github.com/latitudesh/cli).

`lsh` is the easiest way to deploy and manage your infrastructure without leaving the terminal. Use `lsh` to work with servers, settings and more.

<Note>
  The CLI is open source and contributions are welcome. Go to the Github repo,
  share what you'd like to see, or open a PR with your suggestions!
</Note>

### Try Latitude.sh on the command line

Install on MacOS, Linux or WSL:

Using Homebrew

```shell theme={null}
brew install latitudesh/tools/lsh
```

Using the installation script

```shell theme={null}
curl -fsSL https://cli.latitude.sh/install.sh | sh
```

After installation concludes, the `lsh` command should be available.

### Getting started

Using `lsh` is as easy as using the API or dashboard. The response is returned in a table format, but JSON is also available by passing the `--json` argument.

### Authentication

The CLI supports two authentication methods:

**Browser-assisted login (recommended)**

Run `lsh login` without arguments. The CLI opens your browser to authorize the session:

```shell theme={null}
lsh login
```

1. A verification code appears in your terminal
2. Your browser opens to the authorization page
3. Confirm the code matches, select a team, and click **Authorize**
4. Return to your terminal—you're logged in

**API key login**

You can authenticate directly with an API key. Create one from **Settings → API Keys** in the [dashboard](https://www.latitude.sh/dashboard), then run:

```shell theme={null}
lsh login --with-token <API_KEY>
```

**Profiles**

The CLI stores one profile per team you log into. Run `lsh login` again to add another team, switch between them with `lsh profile use`, and check the active profile with `lsh auth status`. See [Commands](/cli/commands#profiles) for details.
