Skip to content

refresh context

Manage saved refresh contexts (list, add, remove)

Aliases: ctx

refresh context [options] <command>

Manage the named contexts that 'refresh use' switches between. Each context binds a cluster to an optional region and AWS profile, so you can name your environments once and select them by name (the kubectx model for EKS).

Contexts are stored as YAML under $XDG_CONFIG_HOME/refresh/context.yaml (default ~/.config/refresh/context.yaml).

refresh context add prod --cluster prod-eks --region us-east-1 --profile prod refresh context list # show all saved contexts (* marks active) refresh context add prod --cluster prod-eks --use # add and switch in one step refresh context remove prod # delete a saved context

Flags

Flag Env Default Description
--help, -h show help

Subcommands

refresh context list

List saved contexts

Aliases: ls

refresh context list [options]

List every saved context with its cluster, region, and profile. The active context (set via 'refresh use') is marked with a '*'.

Flags

Flag Env Default Description
--help, -h show help

refresh context add

Add or update a saved context

refresh context add [options] <name>

Create or overwrite a named context that binds a cluster to an optional region and AWS profile. Re-running with the same name updates it in place. Pass --use to switch to the context immediately after saving.

refresh context add prod --cluster prod-eks --region us-east-1 --profile prod refresh context add prod --cluster prod-eks --use

Flags

Flag Env Default Description
--cluster, -c string EKS cluster name
--region, -r string AWS region (optional)
--profile, -p string AWS shared-config profile (optional)
--use Switch to this context after adding
--help, -h show help

refresh context remove

Remove a saved context

Aliases: rm, delete

refresh context remove [options] <name>

Delete a saved context by name. If the removed context was the active or previous one, those pointers are cleared.

Flags

Flag Env Default Description
--help, -h show help