Skip to main content

Authentication and project profiles

Aient CLI uses customer OAuth for ordinary development work. Refresh credentials stay in the operating-system credential store; local profile and project files contain non-secret selectors only.

aient auth login

Open the browser consent flow and save a refresh-backed customer session:
Use a distinct profile for each organisation context you work in. Existing OAuth sessions may need a new login when Aient introduces additional consented capabilities.

aient auth status

Verify the selected login and display its issuer, organisation, and granted scopes:
auth status --all displays local metadata for every profile without refreshing credentials. A status check for a selected refresh-backed profile verifies the live session. For an access-only token, status validates the envelope shape, issuer and audience claims, metadata consistency, and expiry locally; the server verifies its signature and current authority on the first API operation.

aient auth logout

Revoke and remove only the selected login:
Logging out one profile does not remove another organisation’s profile.

aient auth profiles

List locally known named profiles:
The output includes the current fallback marker and non-secret organisation and issuer metadata. It never prints access or refresh tokens.

aient auth profiles default

Choose the non-secret fallback profile:
The default is used only when no explicit access token, explicit profile, environment profile, or project profile selects another context.

Bind a checkout with .aient/config.yaml

Create a project file in the checkout or linked worktree:
The CLI searches from the selected workspace or current directory upward and uses the nearest .aient/config.yaml. Supported keys are: The file is intentionally strict: it accepts only these scalar keys and must not contain credentials. The organisation and repository values are selectors and mismatch checks, never authority.

Profile resolution order

For each invocation, Aient resolves authentication in this order:
  1. An explicit access-only source: --access-token-file, AIENT_ACCESS_TOKEN_FILE, or AIENT_ACCESS_TOKEN.
  2. --profile NAME or AIENT_PROFILE.
  3. The nearest .aient/config.yaml.
  4. The user default selected by auth profiles default.
  5. Compatibility profile customer.
Conflicting explicit sources fail locally. For example, different values in --profile and AIENT_PROFILE are rejected instead of silently choosing one. A portable access token and refresh-profile selection are also mutually exclusive for the same invocation.

aient auth export

Export a shorter-lived access-only credential for a child process, CI job, or another machine. Prefer a uniquely named, mode-0600 file outside every uploaded workspace:
The env and json formats deliberately print a live bearer token. Use them only when the receiving system requires stdout, disable shell tracing, keep the output out of logs and transcripts, and unset or delete the credential when the receiving process finishes.
An export contains no refresh token, environment secret, repository credential, or GitHub token. Imported access-only credentials are not refreshed or persisted by the CLI. When one expires, export another or sign in on that machine. The CLI refuses to upload the active access-token file—or a hard link to it—through workspace sync, raw upload, or files put.

Environment variables