Using Multiple Profiles¶
A Profile is a complete OWL configuration with an alias, containing an Endpoint, API Key, and optional workspace information. For example, you can use customer-a-prod and customer-a-test to store two workspaces for the same customer, or store configurations for different accounts or sites.
The top-level owl profile manages these independent configurations. owl workspace profile manages the workspaces entries within the selected configuration; workspace use or workspace profile use replaces the workspace identity of the selected configuration without changing the default Profile saved by owl switch.
Adding and Switching¶
# Interactively enter the Endpoint, API Key, and optional workspace UUID and name
owl profile add customer-a
# Copy an existing configuration; subsequent changes do not affect the source file
owl profile add customer-b --from ./customer-b.yaml
owl profile list
owl switch customer-a
owl profile current
owl exec owl.metric.list --mode source --start_time 1792548000000 --end_time 1792551600000
Characters typed for the API Key are hidden. Adding a Profile only saves the configuration without switching the current selection; creating a Profile with the same name returns an error. Aliases are case-sensitive, 1–80 characters long, allowing letters (including Chinese characters), digits, hyphens, and underscores; the first character must be a letter or digit.
When neither --profile nor OWL_PROFILE is specified and no owl switch has been run, the legacy configuration mode continues to be used. Even if a Profile has been added, as long as it has not been selected, the legacy config file, identity environment variable precedence, and cache/data paths remain unchanged; init, login, config set, and workspace use still write back to the original configuration.
Adding and switching performs only local validation and does not request cloud authorization verification. profile list lists configurations saved on the local machine, not the currently valid account authorization list in the cloud. If an actual request encounters authentication, permission, or network errors, it reports an error and does not fall back to another Profile.
Command-Line Completion¶
After enabling Bash or PowerShell completion, use Tab to complete local Profile aliases:
owl switch customer-<Tab>
owl profile rename customer-<Tab>
owl profile remove customer-<Tab>
owl --profile customer-<Tab>
owl exec --profile=customer-<Tab>
Completion only reads local configuration; it does not switch Profiles or access the network. New aliases for profile add and new names for profile rename must be typed manually; the reserved name default does not appear in rename or delete candidates. Once a Profile is selected, tool name and argument candidates come from that Profile's cache.
Temporary Selection and Scripts¶
owl --profile customer-b exec owl.metric.list --mode source --start_time 1792548000000 --end_time 1792551600000
OWL_PROFILE=customer-b owl exec owl.metric.list --mode source --start_time 1792548000000 --end_time 1792551600000
owl profile list -f json
owl --profile customer-b profile current -f json
The selection order is: --profile > OWL_PROFILE > the default Profile saved by owl switch. A temporary selection does not modify the persisted default; multiple tasks can each specify their own Profile.
For exec, tool exec, tools exec, validate, and tool validate, place --profile / --conf before the command. Arguments after the tool name belong to the tool itself and are not used to select the OWL configuration.
Once a Profile takes effect, the Endpoint and Key come as a complete set from its config file. Residual environment variables such as OWL_REGISTRY_ENDPOINT, OWL_API_KEY, OWL_TOKEN, and equivalent authentication configuration do not override it. Other supported non-identity environment settings continue to follow existing rules.
If OWL_PROFILE is set, you must unset it before running owl switch; switch also does not accept --profile or --conf. This avoids situations where, after switching the default, the current terminal is still pointed at another Profile by the temporary selection.
The -f json output of management commands can be parsed directly, and interactive prompts are written to stderr. profile current returns profile, source, defaultProfile, configFile, endpoint, workspace information, the masked Key, and the actual cache/data paths. authorizationChecked is false, indicating that no online verification was performed.
Independent Files and Legacy Configuration¶
Stored in ~/.owl by default, or under the directory set by OWL_DIR:
~/.owl/
├── config.yaml
├── state.yaml
└── profiles/
└── profile-<id>/
├── config.yaml
├── cache/
├── data/
└── logs/
state.yaml records aliases, stable directory identifiers, and the current default; it does not contain Keys. Directory identifiers do not change with aliases, so renaming does not break the paths of existing query files. Use profile current to view the actual location of the config file.
Each Profile configuration is complete and independent; unconfigured fields use program defaults and do not inherit from the root config.yaml. During import, credentials in token_file are copied, and cache/data/log paths are adjusted to the new Profile directory. For named Profiles, these directories are managed by OWL and cannot be overridden via environment variables or config set; the root configuration default retains custom directories and the token_file reference.
The cache is further partitioned by the selected identity; after changing the Endpoint or Key, a new cache partition is used to avoid accidentally using tool directories from the old identity. Query files remain in the data directory of their Profile. On platforms with POSIX permission support, config files are written with 0600 permissions and Profile directories are created with 0700; on Windows, files inherit the access control of the current user directory.
The legacy root config.yaml is used directly as the reserved name default; it is neither copied nor moved. When the Profile selection feature is not yet used, the legacy configuration and environment variable precedence remain compatible. After explicitly selecting default or running owl switch default, the root configuration also follows the complete set of identity rules. Its cache/data base directories continue to use the original configuration.
Migrating from the Deprecated --conf¶
The CLI's --conf is deprecated and hidden from help; during the compatibility period, the original behavior is retained, and using it outputs a one-time migration notice to stderr without affecting JSON stdout. It is recommended to import the configuration and then use an alias:
Passing both --conf and --profile returns an error. Using --conf alone ignores OWL_PROFILE and the persisted selection, retains the original environment variable precedence, and writes changes back to the specified file. --conf does not select a separate set of Profile directories and is not used with profile add/list/rename/remove.
After import, the configuration, credentials, and cache/data/log are independent of the source file; identity environment variables no longer override the selected Profile. Scripts that depend on writing back to the original file, external key file rotation, or custom paths can continue to use --conf during the compatibility period and switch to Profiles after migration. This deprecation applies only to the OWL CLI; the Registry service's --config remains unchanged.
Modifying, Renaming, and Deleting¶
owl --profile customer-a login
owl --profile customer-a config set registry.request_timeout 180000
owl --profile customer-a workspace use wksp_example
owl profile rename customer-a customer-a-prod
owl profile remove customer-b
# Only use this when you also need to delete the Profile's cache and query files
owl profile remove obsolete-profile --purge
login, config set, and workspace use modify the selected Profile without changing the persisted selection. workspace use replaces the workspace key and workspace information in that configuration; the alias is just a label and is not guaranteed to be permanently bound to a specific workspace.
When renaming the current default, OWL updates the selection record synchronously. Before deleting the current default, you must switch away from it; a Profile selected by OWL_PROFILE also requires unsetting the temporary selection first. default cannot be renamed or deleted.
The default deletion behavior removes only the configuration and credentials and displays the directory path where cache/data are retained; you can archive or clean up leftover files at that path. --purge additionally deletes the Profile directory still under management. Recreating a Profile with the same name creates a new directory and does not attach to the old artifacts.
If --purge fails to clean up artifacts, the configuration and credentials are retained and the alias is restored; you can retry after fixing directory permissions. Cache or query files already deleted during cleanup cannot be restored; if you need to keep artifacts, back them up first or use the delete command without --purge.
Runtime Profiles Managed by Agent¶
A CLI supporting runtime-profile/v1 accepts OWL_RUNTIME_PROFILE (a stable, non-secret alias), OWL_RUNTIME_ENDPOINT, and OWL_RUNTIME_TOKEN injected together by the executor. If any of these variables is present, full validation is entered; every invocation 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 values, owl switch, login, and configuration changes.
The runtime configuration is located in OWL_DIR/profiles/runtime-<alias-hash> and stores cache/data/log/index independently; the configuration saves only the endpoint and auth.runtime: true, does not save the Key, and is not registered in state.yaml. After the same user changes the Key, the artifact directory is retained, but endpoint/Key changes update the cache identity. The executor should construct the alias based on deployment/workspace/user and, when necessary, isolate the outer Agent directory.
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 OS-level sandbox; environment and file access under the same UID remain managed by the host. The coordinated release order is Owl → Agent full release package → reinstall to enable user mode; before rolling back, disable user mode and reinstall.