CLI Auth and Configuration
This page documents how the CLI resolves API URLs, loads environment values, and stores credentials.
Login and session lifecycle
Login command:
nasiko auth login --access-key <ACCESS_KEY> --access-secret <ACCESS_SECRET>
Useful auth commands:
nasiko auth status
nasiko auth logout
Behind the scenes:
- Login uses
POST {base_url}/auth/users/login. - Status checks validate auth with
GET {base_url}/auth/validateand may fall back toGET {base_url}/api/v1/healthcheck. - The CLI stores a JWT and reuses it for authenticated commands.
- Access key format is validated by
auth loginand must start withNASK_. auth loginsupports--save-credentials/--no-saveand--api-url.
Token and credential storage
The CLI uses OS keyring when available. If keyring is unavailable, it falls back to encrypted local files under ~/.nasiko/.
Storage is cluster-scoped (derived from active cluster):
token_<cluster>.enccredentials_<cluster>.enc
Legacy plain token files can also be cleaned when you clear auth state.
Config file loading
Config files are loaded very early (before command parsing) so env-driven defaults are available during option resolution.
Load order:
--configor-c(explicit file path, highest priority).nasiko-local.env.nasiko.env.nasiko-aws.env.nasiko-do.env.env
API base URL resolution
The CLI resolves base URL in this order:
- Explicit URL passed by command internals (if any)
- Active cluster metadata from
~/.nasiko/context.json+ state files NASIKO_API_URLenvironment variable- Default fallback (
http://localhost:8000)
Cluster targeting
You can target a cluster for a single command:
nasiko --cluster my-cluster agent list
This sets NASIKO_CLUSTER_NAME for that invocation.
To inspect configured clusters:
nasiko list-clusters
Common env variables
NASIKO_API_URLNASIKO_CLUSTER_NAMENASIKO_DEBUGKUBECONFIGNASIKO_PROVIDERNASIKO_REGIONNASIKO_PUBLIC_REGISTRY_USER
Troubleshooting
- If
nasiko auth statussays you are not authenticated, runnasiko auth loginagain. - If API requests fail unexpectedly, check
NASIKO_API_URLand cluster selection. - If keyring is unavailable in your environment, ensure
~/.nasikois writable for encrypted fallback files.