Use multiple Profiles¶
A Profile stores an account's login information, site address, and current Workspace. You can set aliases for different accounts, such as customer-a and customer-b. API Key Profiles saved before the upgrade remain usable.
Add and switch¶
First, log in to Studio with account A and generate a temporary authorization code on the Personal API Key page. Run owl profile add customer-a, and enter the HTTPS Registry address of the associated site and the temporary code as prompted. Then use a new code generated by account B to add B. The terminal hides the input when you enter the temporary code. View site address
owl profile add customer-a
owl switch customer-a
owl profile add customer-b
owl profile current
owl --profile customer-b sync
owl --profile customer-b exec owl.workspace.member.list --page_size 1
After adding B, the default account remains A. --profile customer-b selects B only for the current command; run owl switch customer-b to make subsequent commands use B. Adding an account requires redeeming the temporary code online; switching only checks the local configuration.
Aliases are case-sensitive and 1–80 characters long. They can contain letters, digits, hyphens, and underscores, and must start with a letter or digit. If an alias already exists, choose another name; the temporary code can still be used.
Reuse existing configuration¶
--from can reuse non-identity settings from a file, such as the site address and timeout, but you still need to log in with the new account's temporary authorization code. The API Key, token_file, and DPoP binding in the source file are not copied to the new Profile, and the source file remains unchanged.
Temporary selection and scripts¶
Selection precedence is --profile > OWL_PROFILE > the default value saved by owl switch. For exec, tool exec, tools exec, and verification commands, place --profile before the command. A temporary selection does not change the default account.
owl --profile customer-b profile current -f json
OWL_PROFILE=customer-b owl profile current -f json
owl profile list -f json
An Agent can provide the temporary code for a new account through OWL_TEMP_CODE. The following command reads the site address from OWL_REGISTRY_ENDPOINT. Do not write temporary codes to commands, logs, or shared files.
After a Profile is selected, the Endpoint and credentials come from that Profile, and identity environment variables do not override them. Non-identity environment settings still take effect. If OWL_PROFILE is set, unset it before running owl switch. If a request fails, it does not automatically switch to another Profile.
Log out of accounts and switch Workspaces¶
The following commands keep A as the default account and revoke B's DPoP credentials. When logging in to B again later, use a newly generated temporary authorization code for B. For DPoP, workspace use requires a Workspace UUID and online verification of the target Workspace.
owl switch customer-a
owl --profile customer-b logout
owl --profile customer-b login --dpop
owl --profile customer-b workspace use wksp_example
In the same installation, multiple aliases for the same account on the same site share the DPoP login state; logging out of one also logs out the other aliases. Workspace lists, API Key retrieval, and Workspace management commands that depend on the Key still require an API Key Profile.
File and configuration compatibility¶
The default root directory is ~/.owl, which can be changed with OWL_DIR. Named Profiles store configuration, cache, query files, and logs independently under profiles/. dpop/ stores local credentials and private keys, which should be properly safeguarded during backups. Tool caches are isolated by identity.
The original ${OWL_DIR}/config.yaml is retained as default and is not migrated. When no Profile is selected, compatibility with the old configuration and environment variable precedence is preserved. The CLI's --conf is deprecated, but it still reads and writes the specified file in the original way, ignoring OWL_PROFILE and the persisted selection; it cannot be used together with --profile. Registry's --config is unaffected.
Command-line completion¶
After you enable Bash or PowerShell completion, Tab suggests existing Profile aliases. Completion reads only the local cache; it does not access the network, switch accounts, or execute tools. New aliases must be entered manually.
Rename and delete¶
owl profile rename customer-a customer-a-prod
owl profile remove customer-b
owl profile remove obsolete-profile --purge
Deleting a Profile does not revoke remote DPoP credentials; to revoke them, first run logout for the corresponding Profile. By default, deletion retains cache/data; --purge also cleans up these directories. If cleanup fails, the configuration and alias are retained or restored, but deleted caches or files are not restored. Before deleting the current default, switch accounts first; default cannot be renamed or deleted.
Agent-managed runtime Profiles¶
CLIs that support runtime-profile/v1 accept the executor injecting OWL_RUNTIME_PROFILE (a stable, non-secret alias), OWL_RUNTIME_ENDPOINT, and OWL_RUNTIME_TOKEN together. If any of these variables is present, full validation is enabled; every call must carry a non-empty runtime Key and cannot fall back to installation credentials. This mode locks the Profile and endpoint and rejects --conf, other --profile options, owl switch, login, and configuration changes.
Runtime configuration is located at OWL_DIR/profiles/runtime-<别名哈希> and stores cache/data/log/index independently; the configuration stores only the endpoint and auth.runtime: true, does not store the Key, and is not registered in state.yaml. If the same user changes the Key, the artifact directory is retained, but changing the endpoint/Key updates the cache identity. The executor should construct aliases by deployment/workspace/user and isolate the outer Agent directory when necessary.
OWL_RUNTIME_TOKEN takes precedence over the authentication information of the selected Profile. When the runtime protocol is not enabled, the precedence of existing regular Profiles and OWL_API_KEY / OWL_TOKEN remains unchanged. Runtime Profiles do not provide an operating system sandbox; environment and file access under the same UID are still managed by the host. The associated release sequence is Owl → complete Agent release package → reinstall to enable user mode; before rolling back, disable user mode and reinstall.