# Dstl8 CLI

The `dstl8` CLI is the on-ramp to Dstl8. The flow is: **authenticate → add sources → install MCP**. After that, your AI agent can investigate incidents, query logs, and analyze patterns through Dstl8's MCP tools.

The CLI also ships an interactive TUI for browsing workspaces, sources, incidents, heatmaps, and logs from a terminal.

#### Setup

**Install the CLI**

Pick the option that matches your environment. Each installs the same `dstl8` binary.

| Method                   | Command                                                                           |
| ------------------------ | --------------------------------------------------------------------------------- |
| Homebrew (macOS / Linux) | `brew install control-theory/dstl8/dstl8`                                         |
| Shell installer          | `curl -fsSL https://install.dstl8.ai/script/dstl8-cli \| sh`                      |
| npm                      | `npm install -g dstl8` (or `npx dstl8`)                                           |
| Nix                      | `nix profile install github:control-theory/dstl8`                                 |
| Manual                   | Download from [GitHub Releases](https://github.com/control-theory/dstl8/releases) |

Verify with `dstl8 version`.

**1. Authenticate**

Pick the option that matches your situation — you only need one.

**If you don't have a Dstl8 account yet:**

```bash
dstl8 signup
```

Opens your browser to create a Dstl8 account and organization. Once you're done, the CLI saves a long-lived API token locally, and a `Default` workspace is created for you to start with.

**If you already have an account** — for example, you were invited to an existing org, or you're setting up a new device:

```bash
dstl8 login
```

Opens your browser to authenticate. If you were invited to an org, accept the invite in the browser first, then run `dstl8 login` to attach the CLI.

Either way, confirm with `dstl8 profiles` — the active profile is marked `►`.

**2. Add sources**

Adding a source is what gets logs flowing into Dstl8. `dstl8 sources add` is an interactive wizard for every source type. It auto-detects local config (`~/.aws/credentials`, `~/.kube/config`, `vercel.json`, `supabase/config.toml`, `.git/config`) and pre-fills sensible defaults.

```bash
dstl8 sources add kubernetes
dstl8 sources add cloudwatch
dstl8 sources add vercel
dstl8 sources add supabase
dstl8 sources add otlp
```

For pull-based sources (`kubernetes`, `cloudwatch`), the CLI verifies the connection before exiting. For webhook-based sources (`vercel`, `supabase`, `otlp`, `github`), the wizard prints a webhook URL and any auto-generated tokens — paste those into the upstream provider to complete the setup.

For scripted setups, pass `--yes` with the relevant flags to skip prompts:

```bash
dstl8 sources add cloudwatch --yes \
  --name prod-cw \
  --aws-region us-east-1
```

**Confirm logs are flowing.** Pull-based sources should ingest immediately. Webhook sources only start flowing after you paste the webhook URL into the upstream provider, so do that first.

```bash
dstl8 sources                      # source listed and ingesting
dstl8 logs fetch -n 5              # recent logs
```

**3. Install MCP**

This is the step that connects Dstl8 to your AI agent. `dstl8 install` auto-detects MCP-compatible clients on your machine and configures them:

```bash
dstl8 install                      # interactive picker
dstl8 install --all                # install to every detected client
dstl8 install claude-code          # install to a specific client
dstl8 install status               # see what's installed where
```

Supported clients:

| Client         | Install command                                                                                                                                              |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Claude Code    | `dstl8 install claude-code`                                                                                                                                  |
| Claude Desktop | `dstl8 install claude-desktop`, or download `dstl8.mcpb` from the [latest release](https://github.com/control-theory/dstl8/releases/latest) and double-click |
| Codex          | `dstl8 install codex`                                                                                                                                        |
| LM Studio      | `dstl8 install lm-studio`                                                                                                                                    |
| Cursor         | `dstl8 install --include-experimental cursor`                                                                                                                |
| Windsurf       | `dstl8 install --include-experimental windsurf`                                                                                                              |

Restart your AI client after installing so it picks up the new MCP server. Your AI agent can now query Dstl8.

#### The TUI

`dstl8 tui` opens an interactive terminal UI for browsing your data without leaving the shell. Most investigation work runs through your AI client once MCP is set up, but the TUI is useful for quick visual checks and one-off navigation.

The TUI splits into org-level views (Overview, Workspaces, Incidents, Sources) and workspace views (Dashboard, Incidents, Heatmap, Log Viewer). Use `←` `→` to switch tabs, `↑` `↓` or `j` `k` to navigate, `Enter` to drill in, and `Esc` to go back. `Ctrl+C` quits.

**Sources**

The org-level Sources tab lists every source connected to your organization. Press `Enter` to drill into streams, then `Enter` again on a stream to see its logs. Press `a` on any source or stream to assign it to a workspace.

<figure><img src="/files/ItwMdboC1coEGhcWiKyU" alt=""><figcaption></figcaption></figure>

**Workspace dashboard**

Each workspace has a Dashboard with a Möbius AI summary at the top, a list of active incidents, and the sources feeding the workspace. Press `Enter` on the Möbius summary for a full analysis.

<figure><img src="/files/M1mxMPBl9vaQhrJbqqPY" alt=""><figcaption></figcaption></figure>

**Incidents**

The Incidents tab gives you a sortable, filterable table — Open, Resolved, Closed, or All. Press `s` to change the sort, `f` to cycle filters, and `Enter` on a row to open the incident detail view.

<figure><img src="/files/nq0HWNbh7lSpLe3nmj7I" alt=""><figcaption></figcaption></figure>

The detail view renders Möbius's full analysis: summary, description, evidence, recommended actions, alongside the impacted resources and event timeline.

<figure><img src="/files/8sO26zuYxcVpUkmpdycL" alt=""><figcaption></figcaption></figure>

**Heatmap**

The Heatmap plots sentiment over time by stream, namespace, or service. Anomalies surface as red dots on the affected row. Press `w` to change the time window, `g` to change the grouping, and `Enter` on a row to view the filtered logs for that group.

<figure><img src="/files/UWW4cGXQjVFS5MoidV0L" alt=""><figcaption></figcaption></figure>

**Log Viewer**

The Log Viewer combines a stacked severity bar chart (1-minute buckets) with a scrollable log table. Press `Enter` on a log line to open a detail modal with full metadata. `c` copies the body to your clipboard.

<figure><img src="/files/YMd5OHVn3g2ret919LyL" alt=""><figcaption></figcaption></figure>

For the complete list of keybindings across every view, see the [README](https://github.com/control-theory/dstl8-cli#navigation).

#### Other CLI commands

A handful of commands are useful outside the TUI, especially in scripts and CI.

**Tailing and fetching logs**

`dstl8 logs tail` streams logs to stdout in real time:

```bash
dstl8 logs tail                                    # all logs
dstl8 logs tail --source Prod -s error             # one source, errors only
dstl8 logs tail --stream-name api --search "timeout"
```

`dstl8 logs fetch` pulls a time range and exits — useful for scripts and verifying ingestion:

```bash
dstl8 logs fetch --start 24h -n 500 --json
dstl8 logs fetch --start 7d --end 24h --source Prod -s error
```

Time arguments accept relative (`30m`, `1h`, `24h`, `7d`) or absolute (`2024-01-15`, `2024-01-15T09:30:00`) values. `--json` produces NDJSON for piping.

**Profiles and workspaces**

```bash
dstl8 profiles                     # list configured profiles
dstl8 switch <profile>             # change the active profile
dstl8 workspaces                   # list workspaces
dstl8 workspaces create <name> --description "Production monitoring"
dstl8 sources assign <source> <workspace>
```

Configuration lives in `~/.config/dstl8/`. Use `--profile <name>` on any command to run it against a specific profile without switching.

#### More

The full command reference, every flag, and release notes live in the [dstl8-cli README](https://github.com/control-theory/dstl8-cli) and on the [releases page](https://github.com/control-theory/dstl8/releases).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.controltheory.com/controltheory-documentation/dstl8-docs/dstl8-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
