Skip to content

Commit

Permalink
cmd/cue: un-hide login command and update docs
Browse files Browse the repository at this point in the history
We will soon publish the first tutorials using the central registry,
so they will ask users to run `cue login`.
Un-hide the command so it can be found with its documentation.

Tweak the documentation after the $CUE_CONFIG_DIR change as well.

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: I5dcd754e89dacf815d4460725c9aa72793b76765
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1185185
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Paul Jolly <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
  • Loading branch information
mvdan committed Mar 20, 2024
1 parent 4aaa2db commit 50ed912
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cmd/cue/cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,15 @@ import (

func newLoginCmd(c *Command) *cobra.Command {
cmd := &cobra.Command{
// TODO: this command is still experimental, don't show it in
// the documentation just yet.
Hidden: true,

Use: "login [registry]",
Short: "log into a CUE registry",
Long: `WARNING: THIS COMMAND IS EXPERIMENTAL.
Log into a CUE registry via the OAuth 2.0 Device Authorization Grant.
Without an argument, CUE_REGISTRY is used if it points to a single registry.
Once the authorization is successful, a token is stored in a cue/logins.json file
inside your user's config directory, such as $XDG_CONFIG_HOME or %AppData%.
Once the authorization is successful, a token is stored in a logins.json file
inside $CUE_CONFIG_DIR; see 'cue help environment'.
`,
Args: cobra.MaximumNArgs(1),
RunE: mkRunE(c, func(cmd *Command, args []string) error {
Expand Down
1 change: 1 addition & 0 deletions cmd/cue/cmd/testdata/script/help.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Available Commands:
get add dependencies to the current module
help Help about any command
import convert other formats to CUE files
login log into a CUE registry
mod module maintenance
trim remove superfluous fields
version print CUE version
Expand Down

0 comments on commit 50ed912

Please sign in to comment.