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

Simplify CLI commands by saving rpc-addr and project to context #544

Closed
hackerwins opened this issue Jun 7, 2023 · 2 comments · Fixed by #647
Closed

Simplify CLI commands by saving rpc-addr and project to context #544

hackerwins opened this issue Jun 7, 2023 · 2 comments · Fixed by #647
Assignees
Labels
documentation 📔 Improvements or additions to documentation enhancement 🌟 New feature or request good first issue 🐤 Good for newcomers

Comments

@hackerwins
Copy link
Member

hackerwins commented Jun 7, 2023

Description:

Simplify CLI commands by saving rpc-addr and project to context

Currently, we need to pass the rpc-addr and project for every command.
For example to list documents:

$ yorkie document ls default --rpc-addr localhost:11101

We can simplify commands using the config command:

// save the context of `localhost:11101` to `~/.yorkie/config.json`
$ yorkie login -u admin -p admin --insecure localhost:11101
$ yorkie document ls codepair

// save the context of api.yorkie.dev to `~/.yorkie/config.json`
$ yorkie login -u admin -p admin api.yorkie.dev:443
$ yorkie document ls whiteboard

// list the contexts from `~/.yorkie/config.json`
$ yorkie context ls

// switch the context to `localhost:11101`
$ yorkie context set localhost:11101

// delete the current context from `~/.yorkie/config.json`
$ yorkie logout

Refer to https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-context-and-configuration

Why:

@hackerwins hackerwins added enhancement 🌟 New feature or request good first issue 🐤 Good for newcomers labels Jun 7, 2023
@Wu22e
Copy link
Contributor

Wu22e commented Jul 19, 2023

I'm interested in this issue. Can I work on it?

@hackerwins
Copy link
Member Author

@Wu22e Of course. If you have any questions, feel free to ask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📔 Improvements or additions to documentation enhancement 🌟 New feature or request good first issue 🐤 Good for newcomers
Projects
No open projects
Status: Done
2 participants