CLI Reference
Login & Authentication
kubectl kedge login — OIDC browser flow or static token.
kubectl kedge login authenticates against a hub and writes a kubeconfig context named kedge with your credentials embedded. Use it once per hub; subsequent commands use the saved context.
Flags:
| Flag | Description |
|---|---|
--hub-url <url> | Hub URL. Defaults to https://console.faros.sh. https:// is assumed if you omit the scheme. |
--token <token> | Static bearer token — skips the OIDC browser flow. |
-i, --interactive | After login, run the organization/workspace picker (same as kedge use). |
--insecure-skip-tls-verify | Skip TLS verification — only for self-signed dev hubs. |
OIDC (browser flow)
For the hosted hub you can omit everything:
kubectl kedge login
Or point at a self-hosted hub:
kubectl kedge login --hub-url https://hub.example.com
What happens:
- The CLI checks
https://<hub>/healthzto see whether the hub has OIDC enabled. If not, it tells you to use--token. - It starts a one-time listener on a random
127.0.0.1port and opens your browser to the hub’s/auth/authorizeendpoint, passing the callback port and a PKCE code verifier. - The hub redirects to its configured OIDC provider (Dex — GitHub, Google, LDAP, … depending on the hub). After you authorize, the browser is redirected back to
http://127.0.0.1:<port>/callbackand the CLI receives your kubeconfig. - The kubeconfig is merged into
$KUBECONFIG(or~/.kube/config) as thekedgecontext.
The flow is a PKCE public client — there is no client secret anywhere on your machine.
Token refresh
The kubeconfig doesn’t embed a static OIDC token. It uses a kubectl exec credential plugin that runs kedge get-token behind the scenes: cached ID tokens are reused until they expire, then refreshed with your refresh token. You should rarely need to re-run login.
Static token
For dev hubs or unattended automation, use a pre-shared token instead of OIDC:
kubectl kedge login \
--hub-url https://hub.example.com \
--token $(cat token.txt)
Add --insecure-skip-tls-verify if the hub uses a self-signed certificate.
See Static tokens for how to provision them on the hub side. Each distinct static token maps to its own isolated tenant user on the hub.
Pick an organization and workspace
After login your context points at your default workspace. To switch:
kubectl kedge use # interactive picker
kubectl kedge use --org acme --workspace platform
See Organizations & workspaces.
Logging out / switching hubs
There is no logout command. Credentials live in the kedge context of your kubeconfig — to log out, delete that context (kubectl config delete-context kedge) or simply login against a different hub, which overwrites it. The CLI keeps exactly one active hub per kubeconfig file; to work against two hubs at once, use separate kubeconfig files via the global --kubeconfig flag or $KUBECONFIG.
Where credentials live
kedge writes to your standard kubeconfig ($KUBECONFIG or ~/.kube/config). OIDC refresh-token state is cached on disk for the exec plugin; static tokens are stored as bearer tokens in the user entry. Treat both as secrets.