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

# Intro

> Install and configure the oleander CLI to manage Spark jobs, query the lake, manage catalogs and tables, handle environment variables, and save queries from your terminal.

The oleander CLI lets you manage Spark artifacts and jobs, run SQL queries against the lake, browse catalogs, register infrastructure, and launch a DuckDB terminal from the command line. Queries go through the [query router](/platform/query-routing), so the CLI picks the engine and machine size for you.

## Installation

<CodeGroup>
  ```bash Homebrew theme={null} theme={null}
  brew tap OleanderHQ/tap
  brew install oleander-cli
  ```

  ```bash Ubuntu (APT) theme={null} theme={null}
  sudo apt-get update
  sudo apt-get install -y curl ca-certificates gnupg

  curl -fsSL https://oleander-cli-releases.s3.amazonaws.com/keys/oleander-archive-keyring.gpg \
    | sudo tee /usr/share/keyrings/oleander-archive-keyring.gpg >/dev/null

  sudo tee /etc/apt/sources.list.d/oleander.sources >/dev/null <<'EOF'
  Types: deb
  URIs: https://oleander-cli-releases.s3.amazonaws.com/apt
  Suites: stable
  Components: main
  Signed-By: /usr/share/keyrings/oleander-archive-keyring.gpg
  EOF

  sudo apt-get update
  sudo apt-get install -y oleander-cli
  ```
</CodeGroup>

## Configuration

Authenticate with the API key from your [oleander settings](https://oleander.dev/app/settings/api-keys).

```bash theme={null} theme={null}
oleander configure --api-key <YOUR_API_KEY>
```

You can also run `oleander configure` without flags to enter your key interactively. The CLI stores the API key in `~/.oleander/config.json`.

## Upgrade

Upgrade to the latest release:

```bash theme={null}
oleander upgrade
```

Check whether an update is available without installing it:

```bash theme={null}
oleander upgrade --check
```

## Commands

### General

| Command              | Description                   |
| -------------------- | ----------------------------- |
| `oleander configure` | Set your API key              |
| `oleander upgrade`   | Upgrade to the latest release |

### Lake

| Command                 | Description                                                                                         |
| ----------------------- | --------------------------------------------------------------------------------------------------- |
| `oleander query`        | Run a read against the lake; oleander picks the engine and machine size                             |
| `oleander query submit` | Run a query that writes - a `SELECT` plus `--destination`, or a statement that names its own target |
| `oleander polars`       | Run a Polars SQL query or Python script against the lake                                            |
| `oleander duckdb`       | Launch a DuckDB terminal connected to your lake                                                     |

### Catalogs

| Command                                  | Description                                   |
| ---------------------------------------- | --------------------------------------------- |
| `oleander catalogs list`                 | List registered catalogs                      |
| `oleander catalogs register`             | Register an S3 Tables catalog                 |
| `oleander catalogs credentials`          | Get short-lived credentials for a catalog     |
| `oleander catalogs namespaces list`      | List namespaces in a catalog                  |
| `oleander catalogs namespaces create`    | Create a namespace                            |
| `oleander catalogs tables list`          | List tables in a namespace                    |
| `oleander catalogs tables describe`      | Describe a table schema                       |
| `oleander catalogs tables create`        | Create a new Iceberg table                    |
| `oleander catalogs tables delete`        | Delete a table                                |
| `oleander catalogs tables load`          | Load data from a file or URI into a new table |
| `oleander catalogs tables schema add`    | Add columns to a table                        |
| `oleander catalogs tables schema rename` | Rename a column                               |
| `oleander catalogs tables schema drop`   | Drop columns from a table                     |

### Spark

| Command                            | Description                        |
| ---------------------------------- | ---------------------------------- |
| `oleander spark init`              | Initialize a PySpark job workspace |
| `oleander spark jobs list`         | List uploaded Spark artifacts      |
| `oleander spark jobs upload`       | Upload a Spark artifact            |
| `oleander spark jobs get`          | Download a Spark artifact's source |
| `oleander spark jobs delete`       | Delete a Spark artifact            |
| `oleander spark jobs submit`       | Submit a Spark job                 |
| `oleander spark jobs stop`         | Stop a running Spark job           |
| `oleander spark clusters list`     | List registered Spark clusters     |
| `oleander spark clusters register` | Register an external Spark cluster |

### Env

| Command               | Description                             |
| --------------------- | --------------------------------------- |
| `oleander env list`   | List organization environment variables |
| `oleander env set`    | Set an environment variable             |
| `oleander env delete` | Delete an environment variable          |

### Queries

| Command                 | Description               |
| ----------------------- | ------------------------- |
| `oleander queries list` | List saved queries        |
| `oleander queries get`  | Get a saved query by name |
| `oleander queries save` | Save a named query        |

See [Spark](/cli/spark), [Lake](/cli/lake), [Polars](/cli/polars), [Env](/cli/env), and [Queries](/cli/queries) for detailed usage.
