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

# context

> Manage CLI connection profiles so you don't repeat flags on every command.

Context profiles store your default connection settings — API base URL, company ID, and API key reference — in `~/.zmeel/context.json`. Once a profile is set, every client command picks up those defaults automatically.

## Commands

```bash theme={null}
zmeel context set --api-base <url> [options]
zmeel context show
zmeel context list
zmeel context use <profile>
```

***

## context set

Save or update values on a profile.

```bash theme={null}
zmeel context set --api-base http://localhost:3100 --company-id <company-id>
```

| Option                          | Description                                                      |
| ------------------------------- | ---------------------------------------------------------------- |
| `--api-base <url>`              | Base URL of your Zmeel server                                    |
| `--company-id <id>`             | Default company ID for company-scoped commands                   |
| `--api-key-env-var-name <name>` | Name of the environment variable that holds your API key         |
| `--profile <name>`              | Profile to write to (defaults to the currently active profile)   |
| `--use`                         | Also set this profile as the active profile after saving         |
| `--context <path>`              | Path to a custom context file instead of `~/.zmeel/context.json` |
| `--data-dir <path>`             | Isolate all local state away from `~/.zmeel`                     |
| `--json`                        | Output the updated profile as raw JSON                           |

<Tip>
  Use `--api-key-env-var-name` instead of storing a literal token. Set the variable once in your shell and Zmeel reads it automatically on every command:

  ```bash theme={null}
  zmeel context set --api-key-env-var-name ZMEEL_API_KEY
  export ZMEEL_API_KEY=your-token-here
  ```

  This keeps secrets out of `~/.zmeel/context.json`.
</Tip>

***

## context show

Print the active profile and the path to the context file.

```bash theme={null}
zmeel context show
```

| Option              | Description                                          |
| ------------------- | ---------------------------------------------------- |
| `--profile <name>`  | Inspect a specific profile instead of the active one |
| `--context <path>`  | Path to a custom context file                        |
| `--data-dir <path>` | Isolate all local state away from `~/.zmeel`         |
| `--json`            | Output raw JSON                                      |

***

## context list

List all profiles defined in the context file.

```bash theme={null}
zmeel context list
```

The output includes each profile's name, whether it is currently active, its API base URL, default company ID, and API key env var name.

| Option              | Description                                  |
| ------------------- | -------------------------------------------- |
| `--context <path>`  | Path to a custom context file                |
| `--data-dir <path>` | Isolate all local state away from `~/.zmeel` |
| `--json`            | Output raw JSON                              |

***

## context use

Switch the active profile.

```bash theme={null}
zmeel context use default
```

| Argument    | Description                     |
| ----------- | ------------------------------- |
| `<profile>` | Name of the profile to activate |

| Option              | Description                                  |
| ------------------- | -------------------------------------------- |
| `--context <path>`  | Path to a custom context file                |
| `--data-dir <path>` | Isolate all local state away from `~/.zmeel` |

***

## Global options

All client commands support these options. When present, they override whatever is saved in the active context profile.

| Option              | Description                                      |
| ------------------- | ------------------------------------------------ |
| `--api-base <url>`  | Override the server base URL for this invocation |
| `--api-key <token>` | Bearer token for this invocation                 |
| `--context <path>`  | Path to a custom context file                    |
| `--profile <name>`  | Use a specific profile for this invocation       |
| `--data-dir <path>` | Isolate all local state away from `~/.zmeel`     |
| `--json`            | Output raw JSON                                  |
