Cosmos-sdk: CLI Refactor

Created on 1 Jul 2020  Â·  3Comments  Â·  Source: cosmos/cosmos-sdk

Summary

The current state of the CLI in the SDK is a bit of a mess, with the use of Viper global/singleton, ad-hoc flag instantiation and binding, and magically instantiation of client.Context. It makes testing difficult and runtime errors hard to debug.

Proposal

Once https://github.com/cosmos/cosmos-sdk/issues/6423 is finalized and merged, we'll have the ability to remove a lot of the existing cruft from the CLI framework. Namely, we should:

Stretch Goal:

  • [ ] Support --config flag where if provided, any field found will set/override any flag/arg.

/cc @aaronc @anilCSE @sahith-narahari @alessio


For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned
CLI

Most helpful comment

@colin-axner sure, but the only major differences from a UX POV are:

  1. the removal of config.toml
  2. a single binary
  3. in process API

We'll have an upgrading doc that will cover all of this stuff.

All 3 comments

Since this is a quite a big change. Could we add creating a doc to the to do list for this. Maybe as an upgrade doc or explaining the scope of the changes for projects dependent upon this area of code.

@colin-axner sure, but the only major differences from a UX POV are:

  1. the removal of config.toml
  2. a single binary
  3. in process API

We'll have an upgrading doc that will cover all of this stuff.

Great job bez!

Looking forward to the new cli

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ValarDragon picture ValarDragon  Â·  3Comments

rigelrozanski picture rigelrozanski  Â·  3Comments

kevlubkcm picture kevlubkcm  Â·  3Comments

ValarDragon picture ValarDragon  Â·  3Comments

mossid picture mossid  Â·  3Comments