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

# CLI Reference

> Complete reference for the langship command-line interface.

The `langship` CLI is the primary interface for running evals, managing datasets, and triggering deployments locally and in CI.

## Installation

```bash theme={null}
pip install langship
```

Verify:

```bash theme={null}
langship --version
# langship 0.5.0
```

## Authentication

```bash theme={null}
langship login
# Opens browser for OAuth, or:
langship login --api-key your-api-key
```

Set the server URL for self-hosted deployments:

```bash theme={null}
langship config set endpoint https://langship.yourcompany.com
```

## Commands

### `langship eval`

Run evaluators against your agent.

```bash theme={null}
langship eval run [OPTIONS]
```

**Options:**

| Flag                    | Description                                          |
| ----------------------- | ---------------------------------------------------- |
| `--config PATH`         | Path to `langship.yaml` (default: `./langship.yaml`) |
| `--eval NAME`           | Run only the named evaluator (repeat for multiple)   |
| `--dataset NAME`        | Override the dataset specified in config             |
| `--dataset-version SHA` | Pin to a specific dataset version                    |
| `--env ENVIRONMENT`     | Target environment (default: `default`)              |
| `--no-fail`             | Always exit 0 regardless of results                  |
| `--output FORMAT`       | Output format: `table` (default), `json`, `junit`    |
| `--parallel N`          | Run N test cases in parallel (default: 5)            |

**Examples:**

```bash theme={null}
# Run all evals
langship eval run

# Run a specific evaluator
langship eval run --eval factual-accuracy

# Output JUnit XML for CI integration
langship eval run --output junit > results.xml

# Run against a pinned dataset version
langship eval run --dataset-version sha256:abc123
```

***

### `langship dataset`

Manage versioned datasets.

```bash theme={null}
# List datasets in the project
langship dataset list

# Push a local JSONL file as a new dataset version
langship dataset push golden-set ./evals/golden-set.jsonl

# Show a specific dataset version
langship dataset show golden-set --version latest

# Pull a dataset version to a local file
langship dataset pull golden-set --version sha256:abc123 --output ./local-copy.jsonl

# Diff two versions
langship dataset diff golden-set sha256:abc123 sha256:def456
```

***

### `langship runs`

Browse and inspect past runs.

```bash theme={null}
# List recent runs
langship runs list

# List runs for a specific environment
langship runs list --env production

# Show full details for a run
langship runs show RUN_ID

# Show the trace for a run
langship runs trace RUN_ID

# Export a run's trace as OTLP JSON
langship runs export RUN_ID --format otlp
```

***

### `langship deploy`

Deploy an agent version to an environment.

```bash theme={null}
langship deploy [OPTIONS]
```

**Options:**

| Flag                | Description                                        |
| ------------------- | -------------------------------------------------- |
| `--env ENVIRONMENT` | Target environment (e.g., `staging`, `production`) |
| `--agent-id ID`     | Agent ID in the target platform                    |
| `--target PLATFORM` | Deployment target: `lyzr` (default)                |
| `--dry-run`         | Validate config without deploying                  |
| `--wait`            | Wait for deployment to complete                    |

**Examples:**

```bash theme={null}
# Deploy to staging
langship deploy --env staging --agent-id abc123

# Dry run to validate
langship deploy --env production --dry-run
```

***

### `langship config`

Manage CLI configuration.

```bash theme={null}
# Show current config
langship config show

# Set a config value
langship config set endpoint https://langship.yourcompany.com
langship config set project my-agent
langship config set default_env staging

# Unset a config value
langship config unset default_env
```

Config is stored in `~/.langship/config.yaml`.

***

### `langship init`

Initialize a new `langship.yaml` in the current directory.

```bash theme={null}
langship init
```

Interactive prompts will ask for your project name, default dataset path, and first evaluator type.

***

### `langship server`

Start or stop a local Control Plane Server (development use).

```bash theme={null}
# Start local server with Docker
langship server start

# Stop local server
langship server stop

# Show server status
langship server status

# View server logs
langship server logs
```

***

## Global flags

| Flag             | Description                |
| ---------------- | -------------------------- |
| `--profile NAME` | Use a named config profile |
| `--verbose`      | Show verbose output        |
| `--json`         | Output raw JSON            |
| `--no-color`     | Disable colored output     |
| `--help`         | Show help for any command  |

***

## Environment variables

| Variable            | Description                            |
| ------------------- | -------------------------------------- |
| `LANGSHIP_ENDPOINT` | Server URL (overrides config)          |
| `LANGSHIP_API_KEY`  | API key (overrides config)             |
| `LANGSHIP_PROJECT`  | Default project (overrides config)     |
| `LANGSHIP_ENV`      | Default environment (overrides config) |
| `LANGSHIP_NO_COLOR` | Disable colored output                 |
