Skip to content

CLI: --init / --migrate-config documented as flags everywhere but only exist as subcommands #6277

Description

@bug-ops

Description

src/cli.rs defines init and migrate-config exclusively as clap subcommand variants (Commands::Init, Commands::MigrateConfig) — there is no top-level --init or --migrate-config boolean flag on the Cli struct. Yet the entire project documentation set consistently describes these as flags:

  • User-global CLAUDE.md: "Config migration (--migrate-config)"
  • Project CLAUDE.md (Development Rules, mandatory integration-point checklist): references --init wizard and --migrate-config step
  • .zeph/zeph.md, crates/zeph-config/AGENTS.md: same flag-style wording
  • CHANGELOG.md: 30+ historical entries describe zeph --migrate-config / --migrate-config as if it were a bare flag, going back to the very commit that introduced it (7de52249, PR feat(config): add migrate-config command #1528)
  • src/cli.rs's own doc comments (lines ~922-923, ~962-963) say zeph --init / --migrate-config
  • .local/testing/playbooks/worktree-disk-quota.md Scenarios 6-7 use the incorrect flag-style invocation in their own steps

Since Claude Code loads CLAUDE.md as mandatory, binding instructions for this repository, every session that follows the documented convention hits an immediate clap parse error before reaching the intended functionality. Related precedent: issue #587 ("Restore --vault, --vault-key, --vault-path CLI flags after clap migration") shows a prior clap migration silently dropped top-level flags and they were explicitly restored — --init/--migrate-config were either lost the same way or have simply always been documented incorrectly, and unlike --vault* this was never caught.

Reproduced during ci-1386 live testing while attempting the worktree disk-quota (#5924) migration/wizard scenarios.

Reproduction Steps

  1. cargo run --features full -- --migrate-config --config .local/config/ci1386-worktree-premigration.toml --diff
    error: unexpected argument '--migrate-config' found
  2. cargo run --features full -- --init
    error: unexpected argument '--init' found
  3. cargo run --features full -- migrate-config --config .local/config/ci1386-worktree-premigration.toml --diff (subcommand form) → works correctly
  4. cargo run --features full -- init (subcommand form) → works correctly, launches interactive wizard

Expected Behavior

Either:

The spec leaves the choice between these two remediation paths to implementation planning.

Actual Behavior

Both --init and --migrate-config fail immediately with a clap "unexpected argument" error; only the no-dash subcommand forms work.

Environment

  • Version: 1fe1d0e (main, 2026-07-14)
  • Features: full

Spec

specs/076-cli-init-migrate-config-flag-mismatch/spec.md

Metadata

Metadata

Assignees

Labels

P1High ROI, low complexity — do next sprintbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions