Log in to agentics.dk with a device-code browser flow, and store the resulting Keycloak tokens for every later pks agentics command.
pks agentics init$ pks agentics initLog in against the default agentics.dk server
$ pks agentics init --server agentics.dkLog in against an explicit server host
$ pks agentics init --no-browserPrint the verification URL instead of opening it
Get this machine authenticated against agentics.dk in under a minute: run one command, open the printed URL, enter the user code, and the tokens land on disk. This is the login every other pks agentics command falls back to when no more specific credential applies.
pks agentics init
The command requests a device code, prints a panel containing the verification URL and the user code, and tries to open your browser. On Linux it uses xdg-open, on macOS open, on Windows cmd start. A failed launch is swallowed — the panel is shown either way.
For a headless or SSH session, skip the browser attempt:
pks agentics init --no-browser
Open the printed URL, sign in, and enter the user code. Meanwhile the CLI polls the token endpoint. Polling honors the RFC 8628 responses: authorization_pending keeps polling, slow_down adds five seconds to the interval, and expired_token or access_denied aborts. The interval is clamped to a five-second minimum and the deadline is the server-provided lifetime, with a sixty-second floor.
The Keycloak base URL is derived by convention as https://keycloak.<server>/realms/<realm> unless --server already contains a full http:// or https:// URL.
pks agentics init --server agentics.dk --realm agentics --client-id pks-cli
On success the tokens are written to ~/.pks-cli/agentics-auth.json with mode 0600, together with the server, realm, and client id used.
ls -l ~/.pks-cli/agentics-auth.json
You should see a file owned by you with permissions -rw-------. Deleting it forces a fresh login.
| Flag | Default | Description |
|---|---|---|
--server <SERVER> | agentics.dk | Agentics server host, or a full http(s) URL. |
--realm <REALM> | agentics | Keycloak realm to authenticate against. |
--client-id <ID> | pks-cli | OAuth client id used for the device flow. |
--no-browser | — | Print the verification URL instead of trying to open a browser. |
-v, --verbose | — | Enable verbose output. |
keycloak.<server> DNS convention. Pass the full issuer URL to --server.expires_in, with a sixty-second floor.--no-browser and copy the URL to a local browser.~/.pks-cli/agentics-auth.json exists and is readable by the same user that runs the command. sudo changes the home directory and therefore the credential path.