Skip to content

feat(cli): restructure CLI around session/checkpoint/agent/auth/doctor#1062

Merged
gtrrz-victor merged 12 commits intomainfrom
new-command-structure
Apr 29, 2026
Merged

feat(cli): restructure CLI around session/checkpoint/agent/auth/doctor#1062
gtrrz-victor merged 12 commits intomainfrom
new-command-structure

Conversation

@gtrrz-victor
Copy link
Copy Markdown
Contributor

@gtrrz-victor gtrrz-victor commented Apr 28, 2026

https://entire.io/gh/entireio/cli/trails/250

Summary

Reorganizes the flat top-level CLI around noun groups. The command layout now has five domain groups: session, checkpoint, agent, auth, and doctor, plus configure for non-agent settings.

Compatibility policy:

  • Same-parent shorthands use real Cobra aliases (sessions, cp, checkpoints).
  • Cross-path top-level shortcuts (rewind, resume, attach, explain, trace) stay registered but are hidden and emit a one-line cobra deprecation hint pointing at the canonical group command. They cannot be Cobra aliases because Cobra aliases must share a parent.
  • entire configure is the home for non-agent settings (telemetry, git-hook mode, strategy options, summary provider). Agent CRUD lives under entire agent. Bare entire configure prints help and a hint to entire agent.

Closes #1061 once shipped.

Final Command Layout

entire
  ├── activity
  ├── agent
  │   ├── list
  │   ├── add <agent-name>              # flags: --local-dev, --force
  │   └── remove <agent-name>
  ├── auth
  │   ├── login
  │   ├── logout
  │   ├── status
  │   ├── list
  │   └── revoke [id]
  ├── checkpoint                        # aliases: cp, checkpoints
  │   ├── list                          # flags: --session, --no-pager
  │   ├── explain [checkpoint-id|commit-sha]
  │   │   └── flags: --session, --commit, --checkpoint, --short, --full,
  │   │              --raw-transcript, --generate, --force, --search-all,
  │   │              --no-pager
  │   ├── rewind
  │   │   └── flags: --to, --list, --logs-only, --reset
  │   └── search [query]
  ├── clean                             # flags: --all, --session, --force, --dry-run
  ├── configure                         # non-agent settings only
  │   └── flags: --telemetry, --absolute-git-hook-path, --force,
  │              --checkpoint-remote, --skip-push-sessions,
  │              --summarize-provider, --summarize-model,
  │              --local, --project, --local-dev
  ├── disable
  ├── dispatch
  ├── doctor                            # bare runs scan-and-fix
  │   ├── trace
  │   ├── logs
  │   └── bundle
  ├── enable
  ├── login / logout
  ├── session                           # alias: sessions
  │   ├── list
  │   ├── info <session-id> [--json]
  │   ├── stop [session-id]
  │   ├── current
  │   ├── attach <session-id>
  │   └── resume <branch>
  ├── status
  ├── help / version
  ├── hidden top-level shortcuts (functional, emit cobra deprecation hint):
  │   ├── rewind   →  checkpoint rewind
  │   ├── resume   →  session resume
  │   ├── attach   →  session attach
  │   ├── explain  →  checkpoint explain
  │   └── trace    →  doctor trace
  └── hidden:
      ├── search [query]                # → checkpoint search (no hint)
      ├── reset                         # → clean (cobra deprecation message)
      ├── trail (list/create/update)    # experimental
      ├── migrate
      ├── hooks (claudecode/git/...)
      ├── curl-bash-post-install
      └── __send_analytics

What Changed

  • Noun-group command structure (wired in cmd/entire/cli/root.go, group roots in <noun>_group.go).
  • entire configure keeps non-agent settings (--telemetry, --absolute-git-hook-path, --force, --checkpoint-remote, --skip-push-sessions, --summarize-provider, --summarize-model, --local-dev). Drops --agent, --remove, --yes (those move to entire agent / entire enable).
  • Bare entire configure prints help + a hint pointing at entire agent. On a fresh, un-enabled repo it exits early with Run 'entire enable' first. instead of failing inside settings load.
  • New updateGlobalSettings helper persists telemetry / hook-mode flags and reinstalls the Entire git hook when --force / --absolute-git-hook-path / --local-dev is set.
  • New hideAsAlias(cmd, canonical) helper centralises the Hidden + cobra Deprecated wiring used by the top-level shortcuts.
  • checkpoint show is replaced by checkpoint explain (the full explain command).
  • Cobra-native aliases (sessions, cp, checkpoints) keep working with no hint; regression test prevents accidental duplicate-root registration.
  • Diagnostic commands: session current, doctor logs, doctor bundle.
  • Tests: aliascmd_test.go covers hideAsAlias; setup_test.go covers bare-configure help + hint, removed-flag guards, telemetry persistence, conditional hook reinstall, and fresh-repo guard.
  • Test / e2e helpers (integration_test/testenv.go, e2e/entire/entire.go, explain/attach/resume tests) now invoke canonical commands so output stays hint-free.
  • Updates command-layout documentation in CLAUDE.md and README.md.

Verification

  • mise run check (fmt + lint + unit + integration + Vogon/Roger canary E2E)
  • go test ./cmd/entire/cli/ -count=1
  • go test -tags integration ./cmd/entire/cli/integration_test/ -count=1
  • mise run test:e2e:canary (58 vogon + 4 roger-roger, all green)

Notes:

  • No paid real-agent E2E suite was run; canaries cover the CLI surface.
  • Top-level rewind / resume / attach / explain / trace remain functional; cobra emits a deprecation message on stderr each invocation. Update scripts to the canonical entire <group> <verb> form to silence the hint.

Reorganize the flat top-level command surface around four noun groups
(session, checkpoint, agent, doctor) so users can discover and reason
about commands the way they think about the work — by domain noun,
not verb.

Phase 1 is purely additive:
  - 4 new noun groups with sub-commands
  - 8 new sub-commands: session current, agent {list,add,remove},
    checkpoint {list,show,diff}, doctor {logs,bundle}
  - All previous top-level verbs (rewind, resume, attach, explain,
    trace, search) remain registered as silent permanent aliases
  - configure prints a one-time deprecation warning pointing to agent
  - sessions stays as a Cobra alias of session

No prior invocation breaks. Full implementation tracked in #1061.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: da43eccbd366
Copilot AI review requested due to automatic review settings April 28, 2026 12:33
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c410989. Configure here.

Comment thread cmd/entire/cli/checkpoint_diff.go Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Phase 1 of the CLI noun-group restructure for Entire, reorganizing the command surface around domain nouns (session, checkpoint, agent, doctor) while keeping backwards-compatible top-level entrypoints.

Changes:

  • Introduces new noun-group parent commands (session, checkpoint, agent, doctor) and wires them into root.go.
  • Adds new subcommands/features: session current, checkpoint diff, doctor logs, doctor bundle, plus an agent CRUD group.
  • Adds one-time deprecation warning plumbing for deprecated aliases (e.g. configureagent) and updates docs/help text.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
cmd/entire/cli/setup.go Emits one-time deprecation warning when using configure.
cmd/entire/cli/sessions.go Renames command to session (keeps sessions alias) and registers new children.
cmd/entire/cli/session_current.go Adds entire session current command.
cmd/entire/cli/root.go Wires noun groups, keeps top-level compatibility commands, updates Getting Started text.
cmd/entire/cli/doctor_logs.go Adds entire doctor logs (tail/follow operational log).
cmd/entire/cli/doctor_bundle.go Adds entire doctor bundle (zip diagnostic bundle).
cmd/entire/cli/doctor.go Registers trace/logs/bundle as doctor subcommands.
cmd/entire/cli/checkpoint_group.go Adds entire checkpoint group with list/show/rewind/search/diff.
cmd/entire/cli/checkpoint_diff.go Implements entire checkpoint diff.
cmd/entire/cli/aliascmd.go Adds one-time deprecation warning helper.
cmd/entire/cli/agent_group.go Adds entire agent group with list/add/remove.
CLAUDE.md Documents the new command layout.

Comment thread cmd/entire/cli/doctor_logs.go
Comment thread cmd/entire/cli/checkpoint_diff.go Outdated
Comment thread cmd/entire/cli/doctor_bundle.go
Comment thread cmd/entire/cli/doctor_bundle.go Outdated
Comment thread cmd/entire/cli/checkpoint_group.go Outdated
Comment thread cmd/entire/cli/checkpoint_diff.go Outdated
Comment thread cmd/entire/cli/doctor_bundle.go
Comment thread cmd/entire/cli/doctor_bundle.go
Comment thread cmd/entire/cli/doctor_bundle.go Outdated
Comment thread CLAUDE.md Outdated
#1061)

Phase 2 of the noun-group restructure:

- Hide 'configure' from --help (still functional, prints one-time
  deprecation pointing at 'entire agent'). 'reset' was already hidden by
  Cobra's Deprecated field.
- Refresh user-facing hints across attach, summary-provider picker,
  enabled-status, and the manage-agents non-interactive error to point
  at 'entire agent ...' instead of 'entire configure --agent ...'.
- Add tests for the Phase 1 surface:
  - aliascmd warnDeprecatedAliasOnce (prints exactly once per pair)
  - computeCheckpointDiff (file delta, token delta, identical, nil tokens)
  - readLastNLines + printTail (tail behavior, n=0 copies all)
  - writeDoctorBundle (zip contents, omits absent logs/)
  - runAgentList (lists registered agents, marks installed)
  - session current (no-session hint, not-a-repo error)
- Update one existing setup test that asserted the old hint text.

No prior invocation breaks. Configure and reset remain callable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 55878d5f1d9c
@gtrrz-victor
Copy link
Copy Markdown
Contributor Author

Phase 2 added (still draft, additive):

  • Hidden configure and reset from --help (both remain functional; configure prints one-time deprecation pointing at entire agent, reset already had Cobra's Deprecated field).
  • Refreshed user-facing hints across attach, summary-provider picker, enabled-status, and manage-agents non-interactive error to recommend entire agent ... instead of entire configure --agent ....
  • Tests added for Phase 1 surface:
    • aliascmd.warnDeprecatedAliasOnce — prints exactly once per pair
    • computeCheckpointDiff — file delta, token delta, identical, nil tokens
    • readLastNLines + printTail — tail behavior, n=0 copies all
    • writeDoctorBundle — zip contents, omits absent logs/
    • runAgentList — lists registered, marks installed
    • session current — no-session hint, not-a-repo error

Lint + unit + integration + Vogon canary all green. Zero prior-invocation breakage.

Entire-Checkpoint: b66144f4f8aa
@gtrrz-victor gtrrz-victor marked this pull request as ready for review April 28, 2026 14:15
@gtrrz-victor gtrrz-victor requested a review from a team as a code owner April 28, 2026 14:15
@gtrrz-victor gtrrz-victor marked this pull request as draft April 28, 2026 14:43
Entire-Checkpoint: e150dedd9c09
@gtrrz-victor gtrrz-victor marked this pull request as ready for review April 28, 2026 15:11
Entire-Checkpoint: 45f8833a1843
@gtrrz-victor gtrrz-victor marked this pull request as draft April 28, 2026 15:23
@gtrrz-victor gtrrz-victor changed the title feat(cli): noun-group command structure (Phase 1) feat(cli): noun-group command structure Apr 28, 2026
gtrrz-victor and others added 2 commits April 28, 2026 18:56
Configure stays as the home for telemetry, git-hook installation mode,
strategy options, and summary provider — bare invocation now prints help
and points at `entire agent` for agent CRUD. Drops `--agent`, `--remove`,
and `--yes` from configure since those belong on `entire agent` /
`entire enable`. Adds `updateGlobalSettings` so telemetry / hook mode /
--force can persist (and reinstall the git hook when relevant) without
running the agent picker.

Top-level `rewind`, `resume`, `attach`, `explain`, `trace` are now hidden
shortcuts that emit a one-line cobra deprecation hint pointing at the
canonical group command. Replaces `checkpoint show` with the full
`checkpoint explain` command. Test/e2e helpers (`testenv.go`,
`e2e/entire/entire.go`, explain/attach tests) now invoke canonical
commands so output is hint-free.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: b1309907bec7
Previously `entire configure --telemetry=false` on an un-enabled repo
fell through to LoadFromFile and surfaced a raw "failed to load
settings" error. Now it exits early with a hint to run `entire enable`
first. Adds a regression test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 0ec01fa3de40
@gtrrz-victor
Copy link
Copy Markdown
Contributor Author

Follow-up commits on new-command-structure:

  • 5da62d0 — Keep entire configure for non-agent settings; hide top-level shortcuts. configure no longer carries --agent / --remove / --yes; bare invocation prints help and points at entire agent. New updateGlobalSettings persists --telemetry / --absolute-git-hook-path / --force / --local-dev and reinstalls the Entire git hook when relevant. New hideAsAlias helper hides rewind / resume / attach / explain / trace at the top level and emits a one-line cobra deprecation hint pointing at the canonical group command. checkpoint show is replaced by checkpoint explain (the full explain command). Test/e2e helpers now invoke canonical commands so output stays hint-free. CLAUDE.md and README.md updated.
  • 275ebc5entire configure --<flag> on an un-enabled repo now exits early with Run 'entire enable' first. instead of failing inside LoadFromFile. Regression test added.

Verification: mise run check (fmt + lint + unit + integration + Vogon/Roger canary E2E) green on both commits.

gtrrz-victor and others added 2 commits April 29, 2026 14:53
Out of scope for the noun-group restructure. Removes the command, its
test, and references in CLAUDE.md / README.md / checkpoint group help.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: cd2c819b91b0
@gtrrz-victor gtrrz-victor marked this pull request as ready for review April 29, 2026 12:55
@gtrrz-victor gtrrz-victor changed the title feat(cli): noun-group command structure feat(cli): reorganize commands into noun groups Apr 29, 2026
@gtrrz-victor gtrrz-victor changed the title feat(cli): reorganize commands into noun groups feat(cli): restructure CLI around session/checkpoint/agent/auth/doctor Apr 29, 2026
Comment thread CLAUDE.md Outdated
Comment thread cmd/entire/cli/doctor_bundle.go
Comment thread cmd/entire/cli/explain_summary_provider.go Outdated
gtrrz-victor and others added 2 commits April 29, 2026 16:08
Hidden subcommand of `entire enable` had no callers — no scripts, tests,
hooks, or docs invoked it. Functionality is fully covered by `entire
configure --force` / `--absolute-git-hook-path`. Drops the constructor,
its RunE helper, and the CLAUDE.md mention.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gtrrz-victor gtrrz-victor force-pushed the new-command-structure branch from aee3b75 to bb486ec Compare April 29, 2026 14:38
Bundle previously zipped raw logs and settings.local.json — credentials
in agent logs or checkpoint_remote URLs ended up in the file users send
to support. Only the git command outputs were scrubbed.

Now every text entry routes through the redact package before zipping:
JSON / JSONL via redact.JSONLContent (preserves structure, skips IDs),
everything else via redact.Bytes. --raw opts out for support cases that
need the full payload.

Help text and a stderr banner ("Bundle written (redacted): <path>" /
"... (RAW — contains unredacted contents): ...") make the active mode
unmissable. Bundle path stays on stdout so script consumers keep working.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 6561e7636817
@gtrrz-victor
Copy link
Copy Markdown
Contributor Author

Addresses Soph's bundle review: redacted by default; --raw to opt out.

  • 6ec2dacentire doctor bundle now scrubs every text entry (.entire/logs/*, settings/*.json, git-*.txt, version.txt) through the redact package before zipping. JSON/JSONL files go through redact.JSONLContent (preserves structure, skips ID fields); everything else through redact.Bytes. The git command outputs were already redacted; this extends the same protection to logs and settings.
  • --raw opts out for support workflows that need the full payload. Help text and a stderr mode banner (Bundle written (redacted): <path> / Bundle written (RAW — contains unredacted contents): <path>) make the active mode obvious. Bundle path stays on stdout so $(entire doctor bundle) keeps working.
  • New tests cover: log secret redaction, settings credential redaction, --raw passthrough, help-text guard, stderr banner end-to-end.

Verification: mise run lint clean; go test ./cmd/entire/cli/ -count=1 green.

@gtrrz-victor gtrrz-victor enabled auto-merge April 29, 2026 15:10
@gtrrz-victor gtrrz-victor merged commit d5621e9 into main Apr 29, 2026
9 checks passed
@gtrrz-victor gtrrz-victor deleted the new-command-structure branch April 29, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

PRD: Restructure CLI commands into noun groups (session/checkpoint/agent/doctor)

3 participants