Authenticate the CLI#

Run yak init to start the CLI’s browser-based OAuth flow. Complete the browser login and return through the local callback. The CLI stores credentials for future authenticated CLI and Python SDK requests. Run yak init --force when you need to authenticate again or replace the existing CLI identity.

Yak Preview access is invite-only. Successful OAuth proves that the CLI has credentials; it does not guarantee access to every Environment, Workspace or product surface. If the callback does not complete, rerun yak init and follow the error it reports. Never copy credential files into an App archive, repository or support log.

Select an Environment and Workspace#

An Environment scopes app configuration, named Secrets, Volumes and related resources. A Workspace groups the developer’s app context. yak run defaults to the development Environment and the configured Workspace (or default when none is configured). Use --environment and --workspace on a CLI run when you need an explicit target.

Keep the same Environment selected when provisioning a named Secret or Volume and when running the Task that uses it. A valid name in one Environment may be absent from another. The Python SDK follows the selected client configuration; do not hard-code private service addresses into public examples.

Diagnose auth and scope errors#

  • If the CLI says credentials are missing or invalid, run yak init and finish the browser flow.
  • If authentication succeeds but a resource is not found, verify its Environment and Workspace before changing the resource name.
  • If the request cannot reach the service, diagnose the transport path separately from account identity; Python reports ConnectionError for connection failures.
  • If the server rejects identity or access, inspect the CLI or SDK authentication message and confirm the invited account is the intended one.

The SDK exposes AuthenticationError for authentication failures. See Troubleshooting for the complete boundary-by-boundary diagnosis path.