Metadata-Version: 2.4
Name: foxglove-wizard
Version: 0.1.1
Summary: Scaffold-free Foxglove quickstart: auth, stream an existing MCAP recording live, and upload it.
License-File: LICENSE
Requires-Python: >=3.9
Requires-Dist: foxglove-sdk>=0.10
Requires-Dist: httpx>=0.27
Requires-Dist: mcap>=1.1
Description-Content-Type: text/markdown

# foxglove-wizard

A scaffold-free Foxglove quickstart. One command authenticates you, streams an
existing MCAP recording live into Foxglove when a viewer connects, then uploads
that same recording and creates a searchable `event=takeoff` event.

No robot or existing stack required — just an MCAP file to replay.

## What it does

1. **Auth** — browser device flow → session bearer token (held in memory; no
   API key is created, nothing is written to disk).
2. **Stream** — starts a WebSocket server on `ws://localhost:8765`, mirrors the
   input MCAP's channels/schemas, and replays its messages at their recorded
   cadence once a Foxglove viewer subscribes.
3. **Upload** — registers the recording (under a timestamped filename) and PUTs
   the input MCAP's bytes to the signed URL.
4. **Event** — creates an `event=takeoff` event 3 seconds into the recording.

## Prerequisites

- [`uv`](https://docs.astral.sh/uv/) (installs Python and dependencies for you)

## Run it locally

From this directory, during development:

```bash
uv run foxglove-wizard --help
```

Local-only smoke test (no auth, no upload) — just stream a recording:

```bash
uv run foxglove-wizard --skip-auth --no-wait
```

Full flow against an environment (no client id to provision — it defaults):

```bash
uv run foxglove-wizard
```

## Run it the way a user will (as a uv tool)

```bash
uvx --from . foxglove-wizard
```

Or install it onto your PATH:

```bash
uv tool install --editable .
```

## Options

| Flag | Default | Purpose |
| --- | --- | --- |
| `--api-url` | `https://api.foxglove.dev` | API base URL (`FOXGLOVE_API_URL`) |
| `--client-id` | `foxglove-wizard` | Device-flow client id (`FOXGLOVE_CLIENT_ID`); not a provisioned credential |
| `--project-id` | — | Target project (`FOXGLOVE_PROJECT_ID`); required for multi-project orgs |
| `--mcap` | bundled sample recording | Input MCAP recording to stream and upload |
| `--no-open` | off | Don't auto-open the browser for auth |
| `--app-url` | (API default) | Foxglove UI base for the live-view link (`FOXGLOVE_APP_URL`) |
| `--no-wait` | off | Start streaming immediately instead of waiting for a viewer to connect |
| `--skip-auth` | off | Local only: no auth, no upload |
| `--skip-upload` | off | Auth + stream, but don't upload |

## Notes

- The approval step is intentionally browser-based: the terminal prints a code
  and opens the verification URL; you sign in or sign up and confirm, then the
  CLI continues. It is not fully headless.
- `--client-id` is a free-form device-flow label, not a registered OAuth
  client: the API accepts any non-empty string and only requires it to match
  between the device-code and token calls. The default (`foxglove-wizard`)
  deliberately differs from the desktop client id so approval does not try to
  launch the desktop app.
