feat: ccx pick session (HITL session resolver via TUI)#25
Merged
Conversation
New `ccx pick session` subcommand renders an interactive session picker
on stderr and prints a stable JSON envelope on stdout, making ccx
composable with shells, scripts, and agents.
sid=$(ccx pick session -query is:current | jq -r '.sessions[0].id')
claude --resume "$sid"
- Extract session filter engine (session.FilterValueFor, session.Matches)
out of internal/tui so TUI and CLI share one source of truth. TUI
behavior unchanged.
- Add `is:current` filter token matching tmux-window Claude CWDs and the
invoker's cwd; populated only when cwdProjectPaths are supplied, so
the TUI path is unaffected.
- Dedicated bubbletea model for the CLI picker with `/` search, space
multi-select (when -multi), and esc/ctrl-c cancel. Row rendering and
result conversion live in standalone helpers for future generalization.
- Exit codes: 0 confirm, 1 error, 2 no candidates, 130 cancel.
- Flags: -query, -multi, -dir.
Design doc: _workbench/design-cli-resolver.md.
Claude-Session: LOCAL_
Replaces the standalone slim picker with the existing session browser running in pick mode so filters, badges, grouping, and multi-select all come for free. Introduces a `tui.PickResult` sum-type interface (currently `SessionsResult`) so Phase 2 entities can add variants without per-entity picker models. - `P` on the session list captures the pick and quits (top-level shortcut, not inside the actions menu). - TUI runs on stderr via `tea.WithOutput`; stdout stays JSON-only. - Prefs save is gated off in pick mode to avoid clobbering state. - CLI flag `-query` renamed to `-search` for consistency with the TUI. Claude-Session: LOCAL_
Collaborator
Author
Screen.Recording.2026-04-18.at.11.52.39.PM.mov |
Pipe consumers (jq, shell one-liners) prefer newline-delimited compact output; the indented form added noise without buying readability. Claude-Session: LOCAL_
Collaborator
|
I think this should be merged with existing |
Collaborator
Author
I'll refactor it to |
Collapse the separate `pick` subcommand into a flag on `sessions` so there's one entrypoint for listing sessions and picking one. Claude-Session: LOCAL_
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ccx pick session— an interactive resolver that launches the fullccxTUI on stderr and emits the user's pick as JSON on stdout. Scripts/agents can pipe it (sid=\$(ccx pick session | jq -r '.sessions[0].id'))./), badges, grouping, multi-select (space), etc. all work without duplication.Pto confirm the pick (top-level shortcut on the session list).tui.PickResultsum-type (currentlySessionsResult) so Phase 2 entities (entries/URLs/files/…) can add variants without per-entity picker models.Test plan
bin/ccx pick session | jq '.sessions[0].id'returns the picked session's UUIDbin/ccx pick session -multiwith 2–3 space-selected rows emits matchingsessions | lengthbin/ccx pick session -search "is:live"opens with the filter appliedq/esc) exits 130 with no stdoutbin/ccxlaunch does NOT show a Pick shortcut in help line; quit still saves prefsfilter_termin~/.config/ccx/config.yamlis unchanged after accx pick sessionrunGenerated with AI