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

Provide a commandline tljh command for setting config #38

Closed
yuvipanda opened this issue Jul 15, 2018 · 0 comments
Closed

Provide a commandline tljh command for setting config #38

yuvipanda opened this issue Jul 15, 2018 · 0 comments
Milestone

Comments

@yuvipanda
Copy link
Collaborator

Editing YAML files on the terminal is not the easiest thing for new people. Indents get screwed up often, and lots of people are not used to nano / vim.

We should offer an easy way to interact with this YAML file from the commandline. Inspiration for this comes from the git config command, which lets you edit your .gitconfig files easily, without having to
manually edit the files. This also helps with validation a lot.

Instead of asking users to add:

user_environment:
   default_app: jupyterlab

to the yaml file, they can instead run:

tljh config set user_environment.default_app jupyterlab

This command would:

  1. Load the current config.yaml file
  2. Set the requested key to requested value
  3. Validate the new config
  4. Save config
  5. Reload JupyterHub to let config take effect.

For lists, you can do:

tljh config add users.admin yuvipanda

or

tljh config set-list users.admin yuvipanda test1 test2

(using set-list instead of set so people don't accidentally clean out their lists and replace them with one item)

View items with:

tljh config view users.admin

You can reset items with:

tljh config reset users.admin
@yuvipanda yuvipanda added this to the v0.1 milestone Jul 23, 2018
yuvipanda added a commit that referenced this issue Jul 28, 2018
We do not want users to hand-edit YAML files. This has been a
major source of bugs and confusion for users in z2jh. Doing so
in a terminal text editor makes it even worse.

This lets users type commands directly to modify config.yaml file
rather than edit files directly. This makes it a lot less error
prone and user friendly.

Advanced users can still edit config.yaml manually.

Fixes #38
@yuvipanda yuvipanda mentioned this issue Jul 28, 2018
5 tasks
yuvipanda added a commit that referenced this issue Jul 28, 2018
We do not want users to hand-edit YAML files. This has been a
major source of bugs and confusion for users in z2jh. Doing so
in a terminal text editor makes it even worse.

This lets users type commands directly to modify config.yaml file
rather than edit files directly. This makes it a lot less error
prone and user friendly.

Advanced users can still edit config.yaml manually.

Fixes #38
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

No branches or pull requests

1 participant