Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPIC: AutoCLI & hubl #11775

Closed
33 tasks done
aaronc opened this issue Apr 26, 2022 · 5 comments · Fixed by #18100
Closed
33 tasks done

EPIC: AutoCLI & hubl #11775

aaronc opened this issue Apr 26, 2022 · 5 comments · Fixed by #18100
Assignees
Labels

Comments

@aaronc
Copy link
Member

aaronc commented Apr 26, 2022

User Story

As a module developer, I want the framework to automatically generate CLI commands from protobuf Query and Msg service and ORM table definitions so that I don't have to manually write and test these commands.

Phase 1: Basic Support

Phase 2: Enhanced Support

Phase 2.5: Module customization

For each module in the SDK, add autocli options following the pattern in x/auth/autocli.go. These options should:

Phase 3: Full Tx Support

Phase 4: Full parity with existing CLI

Support for genesis related stuff, node status, tendermint blocks and events, etc.

Phase 5: ORM Query Support

To be specified once #11774 is completed.

@tac0turtle
Copy link
Member

ref #3558

@aaronc
Copy link
Member Author

aaronc commented Sep 8, 2022

@AmauryM this should probably reuse the same Coin functionality as textual. That is something we could put in core, but the need here is also for a protoreflect version which I think should be generic enough to not depend on a configurable denom regex

@amaury1093
Copy link
Contributor

amaury1093 commented Sep 8, 2022

I can put this function into core:

func formatCoins(coins []*basev1beta1.Coin, metadata []*bankv1beta1.Metadata) (string, error) {

This function IMO shouldn't depend on any regex, it should assume all denoms inside Coin and Metadata are valid.

@aaronc
Copy link
Member Author

aaronc commented Sep 8, 2022

One pending discussion from #11877 is:

We would like to be able to customize:

  • short and long usage strings for commands
  • aliases for flags (ex. -a for --amount)
  • which fields are positional parameters rather than flags

It is an open discussion
as to whether these customizations options should line in:

  • the .proto files themselves,
  • separate config files (ex. YAML), or
  • directly in code

Providing the options in .proto files would allow a dynamic client to automatically generate
CLI commands on the fly. However, that may pollute the .proto files themselves with information that is only relevant
for a small subset of users

I think we should have as a goal:

  • clients need to download one binary (i.e. lens or cosmos-client),
  • that works for all chains by pulling the CLI info dynamically,
  • clients don't need to upgrade the binary for chain upgrades (everything is pulled dynamically)

I tend to agree with the perspective that CLI options in .proto files might bloat them a little. If we don't do them in the .proto files, I would want a similar client distribution system that accomplishes the above. It might be that using the .proto files is the simplest approach because the existing gRPC reflection API will be sufficient (just pull the FileDescriptor's and that's it).

@aaronc
Copy link
Member Author

aaronc commented Sep 8, 2022

I updated #11763 with an example using a .yaml file. The same thing could be done in a go file and it would really be the user's choice. How does that look @AmauryM @marbar3778 ?

@aaronc aaronc changed the title Auto-generate CLI commands Auto-generate CLI commands (AutoCLI) Sep 14, 2022
@aaronc aaronc mentioned this issue Sep 27, 2022
3 tasks
@aaronc aaronc changed the title Auto-generate CLI commands (AutoCLI) EPIC: Auto-generate CLI commands (AutoCLI) Jan 17, 2023
@tac0turtle tac0turtle removed the G:Q4 label Jan 18, 2023
@tac0turtle tac0turtle changed the title EPIC: Auto-generate CLI commands (AutoCLI) EPIC: AutoCLI & hubl Mar 30, 2023
@julienrbrt julienrbrt self-assigned this Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

6 participants