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

feat(zkstack_cli): Autocompletion support #3097

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

manuelmauro
Copy link
Contributor

@manuelmauro manuelmauro commented Oct 15, 2024

What ❔

Add autocomplete feature to zkstack:

❯ zkstack
chain              dev     -- Chain related commands                                                                                                                   
consensus                  -- Update ZKsync                                                                                                                            
containers                 -- Run containers for local development                                                                                                     
contract-verifier          -- Run contract verifier                                                                                                                    
ecosystem                  -- Ecosystem related commands                                                                                                               
explorer                   -- Run block-explorer                                                                                                                       
external-node              -- External Node related commands                                                                                                           
help                       -- Print this message or the help of the given subcommand(s)                                                                                
markdown           update  --                                                                                                                                          
portal                     -- Run dapp-portal                                                                                                                          
prover                     -- Prover related commands                                                                                                                  
server                     -- Run server
❯ zkstack ecosystem                   
build-transactions    -- Create transactions to build ecosystem contracts
change-default-chain  -- Change the default chain
create                -- Create a new ecosystem and chain, setting necessary configurations for later initialization
help                  -- Print this message or the help of the given subcommand(s)
init                  -- Initialize ecosystem and chain, deploying necessary contracts and performing on-chain operations
setup-observability   -- Setup observability for the ecosystem, downloading Grafana dashboards from the era-observability repo

Why ❔

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zkstack dev fmt and zkstack dev lint.

@manuelmauro manuelmauro changed the title feat(zkstack_cli): Auto completion support feat(zkstack_cli): Autocompletion support Oct 15, 2024
.join(format!(".{}rc", shell));

if shell_rc.exists() {
let shell_rc_content = std::fs::read_to_string(&shell_rc)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot fail during this process. Let's handle errors

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in bc7d89e

use ethers::contract::Abigen;
use eyre::ContextCompat;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you try to use anyhow?
seems it's the only place where we use eyre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants