Skip to content

fix(cli): re-sync adopted gate on re-init and complete per-command help - #25

Merged
replygirl merged 2 commits into
mainfrom
fix/init-gate-resync-and-command-help
Jul 15, 2026
Merged

fix(cli): re-sync adopted gate on re-init and complete per-command help#25
replygirl merged 2 commits into
mainfrom
fix/init-gate-resync-and-command-help

Conversation

@replygirl

Copy link
Copy Markdown
Contributor

Root cause

gateEnabled defaulted to detecting only state A (fresh init). Re-running
cospec init on a repo that had already adopted the gate (state C — an
existing `cospec:` task in `mise.toml`) never re-synced the gate config
and printed nothing, making PR #24's merge-into-existing-`mise.toml` fix
unreachable on re-init.

Fixes

  1. State-C gate re-sync — init now detects an existing `cospec:` task
    and re-syncs the gate config on re-init, with a never-silent receipt
    hint printed on every path (fresh init, re-sync, no-op).
  2. Empty-`mise.toml` write reported — writing gate config into a repo
    with no prior `mise.toml` content is now reported instead of silently
    succeeding with no output.
  3. Per-command `--help` — now lists that command's own flags instead
    of the generic top-level flag list.
  4. `cospec help` — now equivalent to `cospec --help`, and
    `init` rejects a bare `help` positional instead of treating it as a
    target directory.

Tests

  • Integration: apps/cli/test/integration/gate.test.ts — re-init re-sync path.
  • Unit: apps/cli/test/unit/cli.test.ts, apps/cli/test/unit/init/init.test.ts.

Docs

  • apps/docs/guide/installation.md, apps/docs/reference/commands.md.

Out of scope (follow-ups)

  • mise-merge.ts false-unparseable on dotted-key TOML.
  • commands.md schema-row flags need a similar per-command pass.

🤖 Generated with Claude Code

replygirl and others added 2 commits July 15, 2026 16:11
- gateEnabled defaulted to state A only, so re-running init on an
  already-adopted repo (state C) never re-synced the gate config and
  printed nothing; init now detects the existing cospec: task and
  re-syncs, with a never-silent receipt hint on every path.
- An empty mise.toml write (no gate config previously present) is now
  reported instead of silently succeeding with no output.
- Per-command --help now lists that command's own flags instead of the
  generic top-level flag list.
- `cospec <cmd> help` is now equivalent to `cospec <cmd> --help`, and
  init rejects a bare `help` positional instead of treating it as a
  target directory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 15, 2026 21:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@replygirl
replygirl merged commit 88c6bbd into main Jul 15, 2026
11 checks passed
@replygirl
replygirl deleted the fix/init-gate-resync-and-command-help branch July 15, 2026 22:28
replygirl added a commit that referenced this pull request Jul 16, 2026
* fix(cli): show templates --schema flag in per-command help

The COMMANDS table entry for `templates` had no `options` field, so
`cospec templates --help` never showed its real --schema <name> flag
(PR #25 missed this one). Add the missing options metadata and a
regression test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore: archive templates-help-schema-flag

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants