Sign in to Azure AI Foundry once, pick a resource and model deployments, then hand short-lived tokens to every pks command that needs them.
pks foundry <command> [options]$ pks foundry initSign in and pick a resource plus model deployments
$ pks foundry statusShow the stored tenant, resource, and default model
$ pks foundry selectChange resource or enabled models without signing in again
$ pks foundry tokenPrint a bearer token for the selected resource
$ eval $(pks foundry proxy)Start a local proxy that injects the real Azure token
$ pks foundry usageShow cost for the selected Foundry resource
pks foundry is the credential and model-selection layer for Azure AI Foundry inside pks. Sign in once, choose which Azure subscription, Foundry resource, and model deployments pks should use, and every later command that needs a Foundry token gets one without another browser round trip.
Azure AI Foundry resources are reached with an Azure Active Directory bearer token, and that token lives for about an hour. pks foundry init runs an OAuth 2.0 authorization-code flow with PKCE — Proof Key for Code Exchange, the browser-based login that needs no client secret — against the Azure CLI's well-known public client ID, so no app registration is required. What it keeps is the long-lived refresh token, plus your resource and model choices.
pks foundry token prints one for scripts; pks foundry proxy lends one to a process that should never hold your Azure credential.pks foundry init resolves your tenant from an email address, or takes a tenant ID directly with --tenant.pks foundry token writes a plain bearer token when stdout is redirected, so TOKEN=$(pks foundry token) works.pks foundry proxy accepts a throwaway token and swaps in a fresh Azure token per request.pks foundry usage scopes Azure Cost Management to the selected resource.init is the only command that opens a browser. It stores the tenant and refresh token as soon as login succeeds, then walks you through subscription, resource, and deployments. select re-runs that walk using the stored refresh token alone — no browser, no re-login. status reads the stored record and calls nothing.
token, proxy, and usage are consumers. Each asks the auth service for a live access token, which refreshes against Azure transparently and rewrites the stored record if Azure rotates the refresh token. Because all three read one shared record, re-running select or init --force changes what every one of them talks to.
init · select · token · status · proxy · usage
Every subcommand accepts the inherited -v|--verbose flag. See the pks foundry reference for the full flag surface.
Run the browser login for Azure AI Foundry, choose a subscription and Foundry resource, and enable the model deployments pks should use.
pks foundry init
Start a localhost reverse proxy that accepts a throwaway token and forwards requests to Azure AI Foundry with a freshly refreshed Azure bearer token.
pks foundry proxy [options]
Complete command, flag, scope, and stored-credential reference for the pks foundry group — init, select, token, status, proxy, and usage.
pks foundry <command> [options]
Re-pick the Azure subscription, Foundry resource, enabled model deployments, and default model using the stored refresh token — no browser login.
pks foundry select
Show the tenant, subscription, resource, endpoint, default model, and refresh-token state that every other pks foundry command operates against.
pks foundry status
Mint and print a bearer token for the selected Azure AI Foundry resource, for scripts, curl calls, or pasting into a browser tool.
pks foundry token [options]
Show an Azure cost summary, a cost-over-time chart, and a top-meter breakdown scoped to the selected Azure AI Foundry resource.
pks foundry usage