rune login / context
The CLI keeps named contexts in ~/.rune/config.yaml. Each context is a (server, token, namespace, tls) tuple. Switch between them with rune use-context.
rune login
Section titled “rune login”Shortcut for “create or update a context, optionally make it the current one.”
rune login dev \ --server localhost:7863 \ --token-file ~/.rune/dev.token \ --default-namespace defaultIf you omit <context-name>, it defaults to default.
| Flag | Notes |
|---|---|
--server | gRPC address (host:port). |
--token | Inline token value. |
--token-file | Path to a file containing the token. |
--token-stdin | Read the token from stdin. Designed for CI — see below. |
--default-namespace | Default namespace for this context (used when commands omit --namespace). |
--no-verify | Skip server verification — just set the context. |
--set-current | Make this the active context (default: yes). |
rune login verifies the server is reachable and the token works (unless --no-verify).
The legacy --namespace flag on rune login is a deprecated alias for --default-namespace; it still works for one release but emits a warning. The rename disambiguates it from the per-operation --namespace flag used everywhere else (cast, get, delete).
--token-stdin for CI
Section titled “--token-stdin for CI”For automation (GitHub Actions, GitLab CI, etc.) prefer piping the token over stdin so it never lands on the process argv — invisible to /proc, ps, shell history, or naive log capture:
printf '%s' "$RUNE_TOKEN" | rune login ci \ --server runed.example.com:443 \ --token-stdinThis is what runestack/rune-cast-action uses internally. See the CI deployments guide.
About the rune_ token prefix
Section titled “About the rune_ token prefix”All bearer tokens issued from v0.0.1-dev.25 onward look like rune_<uuid>.<uuid>. The prefix is mandatory — tokens without it are rejected by the server. It exists so secret scanners (Gitleaks, GitHub secret scanning, TruffleHog) can match Rune tokens by a stable distinctive marker, the same way ghp_ or glpat- work.
rune context
Section titled “rune context”Sub-commands:
rune context view # show current configrune context list # list allrune context use <name> # switch active contextrune context set <name> [...] # create or update a contextrune context delete <name> # removecontext set
Section titled “context set”rune context set prod \ --server runed.example.com:7863 \ --token-file /etc/rune/prod.token \ --namespace prod \ --tls-ca /etc/rune/ca.crt \ --tls-cert /etc/rune/client.crt \ --tls-key /etc/rune/client.keyUpdate one field on an existing context:
rune context set dev --namespace=stagingAliases
Section titled “Aliases”rune use-context is a top-level alias for rune context use:
rune use-context prodConfig file layout
Section titled “Config file layout”~/.rune/config.yaml:
current-context: devcontexts: dev: server: localhost:7863 namespace: default token: <bearer> prod: server: runed.example.com:7863 namespace: prod token-file: /etc/rune/prod.token tls: ca: /etc/rune/ca.crt cert: /etc/rune/client.crt key: /etc/rune/client.keyThe file is created with mode 0600.
- Prefer
token-fileover inlinetokenfor shared machines. - Use one context per environment, not one per cluster — same context, different namespace works fine for many “envs” inside a single Rune.
rune whoamiwill tell you which context you’re in and whether the token works.