Skip to content

Commit d46d12e

Browse files
committed
feat(ui): add read-only interactive issue browser
1 parent 80436ad commit d46d12e

18 files changed

Lines changed: 2547 additions & 261 deletions

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ docket next
6969

7070
# View the Kanban board
7171
docket board
72+
73+
# Browse issues in the interactive terminal UI
74+
docket ui
7275
```
7376

74-
**AI agents:** add `--json` to any command for structured, machine-readable output:
77+
**AI agents:** add `--json` to supported non-interactive commands for structured, machine-readable output:
7578

7679
```bash
7780
docket next --json
@@ -81,14 +84,16 @@ docket issue list --json -s todo -s in-progress
8184
## Why Docket?
8285

8386
- **No servers, no network** — everything is a local SQLite file in `.docket/`. Works offline, on planes, in CI.
84-
- **AI-native from day one**every command supports `--json` with a consistent envelope. Agents can create, query, plan, and update issues without parsing human text.
87+
- **AI-native from day one**machine-readable commands support `--json` with a consistent envelope. Agents can create, query, plan, and update issues without parsing human text.
8588
- **Dependency-aware planning**`docket next` and `docket plan` use a DAG to surface only unblocked, work-ready issues. No stale sprint boards.
8689
- **Zero configuration**`docket init` and you're done. No accounts, no tokens, no YAML.
8790
- **Portable data** — the `.docket/` directory travels with your repo. Clone it, fork it, archive it.
8891

8992
## AI Agent Integration
9093

91-
Every command supports `--json` for structured, machine-readable output. All JSON responses use a consistent envelope:
94+
Most commands support `--json` for structured, machine-readable output. All JSON responses use a consistent envelope:
95+
96+
`docket ui` is the exception: it opens a read-only interactive terminal UI, requires a real TTY, and rejects `--json`.
9297

9398
**Success:** `{"ok": true, "data": { ... }, "message": "..."}`
9499

@@ -117,6 +122,12 @@ Run `docket next --json` to find work. Move issues to `in-progress` before start
117122

118123
Any agent that can run shell commands works with Docket. Point it at `docket next --json` to discover work items, and use `docket issue show <id> --json` to get full context before starting a task. The consistent JSON envelope (`ok`, `data`, `error`, `code`) makes parsing straightforward in any language.
119124

125+
### Interactive UI
126+
127+
Use `docket ui` when you want an interactive browser instead of command output. It opens a read-only terminal UI for list and board browsing, requires an interactive terminal, and does not support `--json`.
128+
129+
If you need to debug terminal-specific behavior, set `DOCKET_UI_DEBUG_LOG=/tmp/docket-ui.log` before running `docket ui`.
130+
120131
<details>
121132
<summary>Verbose JSON examples</summary>
122133

@@ -222,6 +233,8 @@ docket issue list --json -s todo -s in-progress -p high
222233
--quiet, -q Suppress non-essential output
223234
```
224235

236+
`docket ui` is interactive-only and rejects `--json`.
237+
225238
### Issue Commands (`docket issue` / `docket i`)
226239

227240
| Command | Description |
@@ -290,6 +303,7 @@ docket issue list --json -s todo -s in-progress -p high
290303
| `docket config` | Show current configuration (database path, schema version, etc.) |
291304
| `docket version` | Print version, commit, and build date |
292305
| `docket stats` | Show summary statistics for the issue database |
306+
| `docket ui` | Browse issues in an interactive terminal UI |
293307

294308
### Export / Import
295309

docs/spec/architecture.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ SQLite (modernc.org/sqlite) -- .docket/issues.db
7676

7777
Built on **spf13/cobra**. The root command (`docket`) defines:
7878

79-
- Global flags: `--json` (structured output), `--quiet` (suppress non-essential output)
79+
- Global flags: `--json` (structured output), `--quiet` (suppress non-essential output). Interactive commands can reject unsupported flags at runtime; `docket ui` rejects `--json`.
8080
- `PersistentPreRunE`: Resolves config, opens SQLite DB, runs migrations. Commands annotated with `skipDB` bypass DB initialization (e.g., `init`).
8181
- `PersistentPostRunE`: Closes the DB connection.
8282
- Version info injected via ldflags at build time (`version`, `commit`, `buildDate`).
@@ -87,6 +87,7 @@ Built on **spf13/cobra**. The root command (`docket`) defines:
8787
|---------|-------------|-------------|
8888
| `init` | -- | Create `.docket/` directory and initialize schema |
8989
| `board` | -- | Kanban board view (columns by status) |
90+
| `ui` | -- | Read-only interactive terminal UI for browsing issues |
9091
| `plan` | -- | DAG-based execution plan with phased grouping |
9192
| `next` | -- | Work-ready issues (unblocked leaf tasks) |
9293
| `stats` | -- | Summary statistics (counts by status/priority/label) |

docs/spec/review-strategy.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,16 @@ The following dimensions are weighted by their relevance to the docket project,
6969
- Review must verify: migration idempotency, rollback safety, data preservation across versions
7070

7171
**JSON API Contract Stability (Critical)**
72-
- Every command supports `--json` with a documented envelope (`{"ok": true, "data": ..., "message": ...}`)
72+
- Non-interactive commands support `--json` with a documented envelope (`{"ok": true, "data": ..., "message": ...}`)
7373
- AI agents depend on stable JSON shapes — breaking changes silently break agent workflows
74+
- Interactive commands like `docket ui` are exceptions and must fail clearly when `--json` is unsupported
7475
- Error codes (`GENERAL_ERROR`, `NOT_FOUND`, `VALIDATION_ERROR`, `CONFLICT`) are part of the contract
7576
- The QA suite has dedicated sections (Q, R) for contract and exit code validation
7677
- Review must verify: no field renames/removals without versioning, exit codes match documented behavior
7778

7879
**CLI UX Consistency (High)**
7980
- One-file-per-command pattern in `internal/cli/` must be maintained
80-
- All commands must support `--json` and `--quiet` flags via `getWriter()`
81+
- Non-interactive commands should support `--json` and `--quiet` via `getWriter()`; interactive commands must document and enforce any exceptions
8182
- Interactive forms (via `charmbracelet/huh`) must degrade gracefully in non-TTY contexts
8283
- Review must verify: new commands follow established patterns, help text is consistent
8384

go.mod

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ go 1.26.0
44

55
require (
66
github.com/ALT-F4-LLC/vorpal/sdk/go v0.0.0-20260320211915-9fb550947a7e
7+
github.com/charmbracelet/bubbletea v1.3.10
78
github.com/charmbracelet/glamour v1.0.0
89
github.com/charmbracelet/huh v1.0.0
910
github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834
1011
github.com/dustin/go-humanize v1.0.1
12+
github.com/muesli/termenv v0.16.0
1113
github.com/spf13/cobra v1.10.2
14+
golang.org/x/sys v0.42.0
1215
golang.org/x/term v0.41.0
1316
modernc.org/sqlite v1.47.0
1417
)
@@ -21,15 +24,13 @@ require (
2124
github.com/aymerick/douceur v0.2.0 // indirect
2225
github.com/catppuccin/go v0.3.0 // indirect
2326
github.com/charmbracelet/bubbles v1.0.0 // indirect
24-
github.com/charmbracelet/bubbletea v1.3.10 // indirect
2527
github.com/charmbracelet/colorprofile v0.4.3 // indirect
2628
github.com/charmbracelet/x/ansi v0.11.6 // indirect
2729
github.com/charmbracelet/x/cellbuf v0.0.15 // indirect
2830
github.com/charmbracelet/x/exp/slice v0.0.0-20260316093931-f2fb44ab3145 // indirect
2931
github.com/charmbracelet/x/exp/strings v0.1.0 // indirect
3032
github.com/charmbracelet/x/term v0.2.2 // indirect
3133
github.com/clipperhouse/displaywidth v0.11.0 // indirect
32-
github.com/clipperhouse/stringish v0.1.1 // indirect
3334
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
3435
github.com/dlclark/regexp2 v1.11.5 // indirect
3536
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
@@ -45,7 +46,6 @@ require (
4546
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
4647
github.com/muesli/cancelreader v0.2.2 // indirect
4748
github.com/muesli/reflow v0.3.0 // indirect
48-
github.com/muesli/termenv v0.16.0 // indirect
4949
github.com/ncruces/go-strftime v1.0.0 // indirect
5050
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
5151
github.com/rivo/uniseg v0.4.7 // indirect
@@ -55,9 +55,8 @@ require (
5555
github.com/yuin/goldmark-emoji v1.0.6 // indirect
5656
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect
5757
golang.org/x/net v0.52.0 // indirect
58-
golang.org/x/sync v0.20.0 // indirect
59-
golang.org/x/sys v0.42.0 // indirect
6058
golang.org/x/text v0.35.0 // indirect
59+
golang.org/x/tools v0.43.0 // indirect
6160
google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 // indirect
6261
google.golang.org/grpc v1.79.3 // indirect
6362
google.golang.org/protobuf v1.36.11 // indirect

0 commit comments

Comments
 (0)