feat: migrate CLI to cobra and add roadmap#236
Merged
Conversation
Replace urfave/cli/v2 with spf13/cobra for the command surface, giving first-class shell completion and doc generation: - Root command with persistent global flags, command groups, and flag-name normalization preserving old aliases (--staging/--target/--msg/--as). - init/send/upload ported to cobra with rich Short/Long/Example help. - Dynamic completion for --peer (self aliases for now) and enum completion for --type; enum flag reimplemented as a pflag.Value. - Hidden `docs` command generating Markdown/man pages from the tree. - Switch error handling from golang.org/x/xerrors to go-faster/errors (Wrap/Wrapf house style). Also add ROADMAP.md describing the agent-automatable CLI plan. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Replaces
urfave/cli/v2withspf13/cobrafor the command surface and lands the agent-automatable CLIROADMAP.md. This is the first Phase 0 foundation item from the roadmap.CLI migration (cobra)
--config/-c,--debug-invoker,--test), command groups, and flag-name normalization preserving old aliases (--staging→--test,--target→--peer,--msg→--message,--as→--type).init/send/uploadported to cobra with richShort/Long/Examplehelp; the oldBeforehook moved intoPersistentPreRunE.tg completion bash|zsh|fish|powershell, dynamic completion for--peer(self aliases for now, with a TODO to read the peer cache once it lands) and enum completion for--type. The enum flag is reimplemented as apflag.Valuefor validation + completion.tg docscommand generating Markdown/man pages from the command tree.Error handling
golang.org/x/xerrorstogithub.com/go-faster/errors, using theWrap/Wrapfhouse style (govet-clean); dropped the stdliberrorsimport where go-faster'sIssuffices.Roadmap
ROADMAP.mddescribing the phased plan for an agent-automatable Telegram CLI, with the cobra decision recorded in Phase 0 and the technical notes.Verification
go build ./...,go vet ./..., andgolangci-lint run ./...(0 issues) all pass.__completefor peer and enum flags, enum validation, all flag aliases,init, docs generation, and error paths.🤖 Generated with Claude Code