pocket icon indicating copy to clipboard operation
pocket copied to clipboard

[Core] Use `cobra` for the Pocket node CLI

Open Olshansk opened this issue 1 year ago • 3 comments

Objective

Use cobra in the node CLI binary consistency and simplicity of tooling across the board.

Origin Document

Screenshot 2023-06-16 at 11 41 55 AM Screenshot 2023-06-16 at 11 41 57 AM

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


ChatGPT-ChatGPT (1)

Olshansk avatar Jun 16 '23 18:06 Olshansk

@3scava1i3r If you're up for it, this is another big ticket item to hit in the future :)

Olshansk avatar Jun 16 '23 18:06 Olshansk

Will look into it after the previous ones

3scava1i3r avatar Jun 17 '23 08:06 3scava1i3r

@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

bryanchriswhite avatar Jun 19 '23 06:06 bryanchriswhite