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

# CLI Commands

> Complete reference for Station CLI commands

## Command Overview

Station CLI (`stn`) provides commands for managing agents, MCP servers, and deployments.

```bash theme={null}
stn [command] [subcommand] [flags]
```

## Core Commands

### `stn init`

Initialize Station configuration.

```bash theme={null}
stn init [flags]
```

| Flag              | Description                          |
| ----------------- | ------------------------------------ |
| `--provider`      | AI provider (openai, gemini, custom) |
| `--model`         | AI model name                        |
| `--api-key`       | API key for provider                 |
| `--base-url`      | Custom API endpoint                  |
| `--yes`, `-y`     | Use defaults without prompts         |
| `--ship`          | Enable Ship CLI integration          |
| `--cloudship-key` | CloudShip registration key           |

### `stn serve`

Start the Station server.

```bash theme={null}
stn serve [flags]
```

| Flag                 | Description                     |
| -------------------- | ------------------------------- |
| `--api-port`         | API server port (default: 8585) |
| `--mcp-port`         | MCP server port (default: 8586) |
| `--ssh-port`         | SSH server port (default: 2222) |
| `--database`         | Database file path              |
| `--local`            | Force local mode                |
| `--enable-telemetry` | Enable OpenTelemetry            |

### `stn up`

Start Station in a Docker container.

```bash theme={null}
stn up [flags]
```

| Flag                | Description                      |
| ------------------- | -------------------------------- |
| `--workspace`, `-w` | Workspace directory to mount     |
| `--provider`        | AI provider for initialization   |
| `--bundle`          | CloudShip bundle ID to install   |
| `--upgrade`         | Rebuild container image          |
| `--env`, `-e`       | Additional environment variables |
| `--develop`         | Enable Genkit Developer UI       |

### `stn down`

Stop the Station container.

```bash theme={null}
stn down [flags]
```

| Flag              | Description           |
| ----------------- | --------------------- |
| `--remove-volume` | Delete all data       |
| `--remove-image`  | Remove Docker image   |
| `--clean-mcp`     | Remove from .mcp.json |

## Agent Commands

### `stn agent create`

Create a new agent.

```bash theme={null}
stn agent create --name "my-agent" --description "My agent description"
```

| Flag            | Description           |
| --------------- | --------------------- |
| `--name`        | Agent name (required) |
| `--description` | Agent description     |
| `--env`         | Environment name      |
| `--model`       | AI model override     |

### `stn agent run`

Execute an agent.

```bash theme={null}
stn agent run <agent-name> "<task>"
```

| Flag          | Description          |
| ------------- | -------------------- |
| `--env`       | Environment name     |
| `--variables` | JSON input variables |
| `--stream`    | Stream output        |

### `stn agent list`

List all agents.

```bash theme={null}
stn agent list [--env <environment>]
```

## MCP Commands

### `stn mcp list`

List MCP configurations.

```bash theme={null}
stn mcp list [--env <environment>]
```

### `stn mcp tools`

List available MCP tools.

```bash theme={null}
stn mcp tools [--filter <pattern>]
```

### `stn mcp status`

Show MCP configuration status.

```bash theme={null}
stn mcp status [environment]
```

### `stn sync`

Sync file-based configurations.

```bash theme={null}
stn sync [environment]
```

| Flag        | Description          |
| ----------- | -------------------- |
| `--dry-run` | Preview changes      |
| `--verbose` | Show detailed output |

## Bundle Commands

### `stn bundle create`

Create a bundle from an environment.

```bash theme={null}
stn bundle create <environment> [--output <path>]
```

### `stn bundle install`

Install a bundle.

```bash theme={null}
stn bundle install <source> <environment> [--force]
```

Sources can be:

* CloudShip bundle UUID
* URL to bundle file
* Local file path

### `stn bundle share`

Upload a bundle to CloudShip.

```bash theme={null}
stn bundle share <environment-or-file>
```

## Utility Commands

### `stn status`

Show Station server status.

```bash theme={null}
stn status
```

### `stn logs`

Show container logs.

```bash theme={null}
stn logs [--follow]
```

### `stn jaeger`

Manage Jaeger telemetry.

```bash theme={null}
stn jaeger up      # Start Jaeger
stn jaeger down    # Stop Jaeger
stn jaeger status  # Check status
stn jaeger clean   # Remove data
```

### `stn config`

Manage configuration.

```bash theme={null}
stn config show              # Show all config
stn config get <key>         # Get a value
stn config set <key> <value> # Set a value
```

## Global Flags

These flags work with any command:

| Flag                 | Description          |
| -------------------- | -------------------- |
| `--config`           | Config file path     |
| `--enable-telemetry` | Enable OpenTelemetry |
| `--otel-endpoint`    | OTLP endpoint URL    |
| `-h`, `--help`       | Show help            |
| `-v`, `--version`    | Show version         |

## Examples

<AccordionGroup>
  <Accordion title="Quick start with OpenAI">
    ```bash theme={null}
    export OPENAI_API_KEY="sk-..."
    stn init --provider openai --yes
    stn serve
    ```
  </Accordion>

  <Accordion title="Start with Docker and bundle">
    ```bash theme={null}
    stn up --bundle e26b414a-f076-4135-927f-810bc1dc892a --provider openai
    ```
  </Accordion>

  <Accordion title="Run agent with custom input">
    ```bash theme={null}
    stn agent run code-reviewer --variables '{"code": "print(1)", "language": "python"}'
    ```
  </Accordion>

  <Accordion title="Enable tracing">
    ```bash theme={null}
    stn jaeger up
    stn serve --enable-telemetry --otel-endpoint http://localhost:4318
    # View traces at http://localhost:16686
    ```
  </Accordion>
</AccordionGroup>
