Skip to content

feat(cli): example config in releases and cdd config init/path/edit #70

Closed

Description

@hammadmajid

Part of #61. Covers feature 7 (example config in the release, a command to generate config).

What

  • Add a commented config.example.toml at the repo root showing every key with its default, and examples of Actions. It is the single source:
    • //go:embed it into the binary.
    • List it in .goreleaser.yaml archives.files, so it ships in every release tarball.
    • A test loads it through config.LoadFrom and fails if it is invalid.
  • Add cdd config subcommands:
    • cdd config init writes the example to the config path, creating directories. It refuses if a file exists, unless given --force.
    • cdd config path prints the config path (respects XDG_CONFIG_HOME).
    • cdd config edit opens the config in $VISUAL/$EDITOR/vi, running init first if the file is missing.
  • config joins the Wrapper passthrough list.

Acceptance

  • The validity test runs in CI's go test ./....
  • init with and without an existing file, and with --force, is tested against a temp XDG_CONFIG_HOME.
  • A goreleaser release --snapshot --clean tarball contains config.example.toml.
  • README points to cdd config init.

Metadata

Metadata

Assignees

Labels

ready-for-agentFully specified, ready for an AFK agentwayfinder:taskWayfinder ticket: implementation task

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions