pocket
pocket copied to clipboard
[Core] Use `cobra` for the Pocket node CLI
Objective
Use cobra
in the node CLI binary consistency and simplicity of tooling across the board.
Origin Document
- The node CLI binary uses standard go flag; main/app/pocket/main.go
- The RPC CLI binary uses cobra; main/app/client/main.go
Goals
- Make the binary CLI more extendable
- Use consistent tooling across the board
Deliverable
- [ ] Provide feature parity (e.g. documentation, etc...) by reviewing the RPC CLI and having similar best practices in the node CLI
- [ ] A PR that updates the node CLI to use cobra, in the same fashion as the RPC CLI
- [ ] Use ChatGPT (see image in the bottom of the page) to update the documentation for best practice on our CLI
Non-goals / Non-deliverables
- Introducing new functionality into the CLI
General issue deliverables
- [ ] Update the appropriate CHANGELOG(s)
- [ ] Update any relevant local/global README(s)
- [ ] Update relevant source code tree explanations
- [ ] Add or update any relevant or supporting mermaid diagrams
Testing Methodology
- [ ] Task specific tests or benchmarks:
make ...
- [ ] New tests or benchmarks:
make ...
- [ ] All tests:
make test_all
- [ ] LocalNet: verify a
LocalNet
is still functioning correctly by following the instructions at docs/development/README.md - [ ] k8s LocalNet: verify a
k8s LocalNet
is still functioning correctly by following the instructions here
Creator: @Olshansk Co-Owners: @bryanchriswhite
@3scava1i3r If you're up for it, this is another big ticket item to hit in the future :)
Will look into it after the previous ones
@Olshansk I :heart: the LLM CLI doc generation idea - that's a huge timesaver and a great starting point! :raised_hands:
I was talking with @h5law last week about some conventions that we may want to change regarding code organization in the CLI as right now there are some files with dozens of commands a thousand lines of code.
As peer discovery CLI work I've been doing is still very WIP, I'm not going to point to it as a good example just yet but I've been preferring to organize the CLI code in such a way that each subcommand:
- gets its own go package
- registers itself with its parent command
- registers its own flags in an
init()
function in its package