console

package
v0.1.0-rc.73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package console implements `w17ctl console` — list the consoles you are logged into and choose which one subsequent commands talk to.

Why this exists

~/.w17/auth.yaml holds one entry per console (`instances`) plus a pointer at the active one (`default_instance`), and the store has always assumed the pointer is something a person moves: `RemoveInstance` clears it on logout and says in as many words that "a remaining instance is NOT auto-promoted — the user chooses explicitly". There was nothing to choose WITH. The only writer of that pointer was `login`, which sets it to whatever it just authenticated against.

That made a two-console setup a trap rather than a configuration. Signing a plugin release needs the console holding the signing key — production — while everyday work belongs on a local console: codegen, dev locks, `plugin dev`, e2e. Logging into production to publish silently moved the default there, and the next ordinary `w17ctl codegen` would ask the PRODUCTION console to sign a development lock and register a throwaway project in the production registry. Nothing fails; it just quietly happens on the wrong console.

Switching back meant hand-editing YAML, which is not a thing to put in a workflow people repeat.

Deliberately offline

Choosing the active console does not call it. The pointer is local state, and requiring a round-trip would make the command unusable in the case it is most needed — the console you are leaving is down, or unreachable from here. A stale token surfaces at the next command that actually talks, with that command's own error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	List ListCmd `cmd:"" help:"List the consoles you are logged into, marking the active one."`
	Use  UseCmd  `` /* 148-byte string literal not displayed */
}

Cmd is the `w17ctl console` group.

type ListCmd

type ListCmd struct{}

ListCmd is `w17ctl console list`.

func (*ListCmd) Run

func (c *ListCmd) Run() error

type UseCmd

type UseCmd struct {
	URL string `arg:"" help:"Console to make active. The scheme is optional — 'api.w17.app:50051' finds 'grpcs://api.w17.app:50051'."`
}

UseCmd is `w17ctl console use <url>`.

func (*UseCmd) Run

func (c *UseCmd) Run() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL