Skip to content

Working with Multiple Profiles

A Profile is a complete OWL configuration with an alias, containing an Endpoint, an 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 command manages these standalone configurations. owl workspace profile manages the workspaces entries in 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 optionally the workspace UUID and name
owl profile add customer-a

# Copy an existing configuration; later 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

The terminal hides characters as you type the API Key. Adding a Profile only saves the configuration and does not switch the current selection; a Profile with the same name returns an error. Aliases are case-sensitive, 1–80 characters long, and may contain letters (including Chinese characters), digits, hyphens, and underscores. The first character must be a letter or digit.

If --profile / OWL_PROFILE has not been specified and owl switch has not been run, the legacy configuration mode continues to be used. Even after a Profile has been added, as long as it has not been selected, the legacy configuration 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 perform local validation only and do not request cloud-side authorization verification. profile list lists the configurations saved on the local machine, not the currently valid account authorizations on the cloud. If an actual request encounters an authentication, permission, or network error, it returns an error and does not fall back to another Profile.

Command-Line Completion

After enabling Bash or PowerShell completion, you can use Tab to get suggestions for 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. The new alias for profile add and the new name for profile rename must be entered manually; the reserved name default does not appear among rename or remove candidates. After a Profile is selected, tool names and argument candidates come from that Profile's cache.

Temporary Selection and Scripting

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 entirely from its configuration file. Residual OWL_REGISTRY_ENDPOINT, OWL_API_KEY, OWL_TOKEN, and equivalent authentication configuration environment variables 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 ensures that after switching the default, the current terminal is not still pointed at another Profile by a temporary selection.

unset OWL_PROFILE
owl switch customer-b

The -f json output of management commands can be parsed directly; 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 online verification has not been performed.

Standalone Files and Legacy Configuration

By default, files are stored in ~/.owl; when OWL_DIR is set, they follow that directory:

~/.owl/
├── config.yaml
├── state.yaml
└── profiles/
    └── profile-<id>/
        ├── config.yaml
        ├── cache/
        ├── data/
        └── logs/

state.yaml records the alias, a stable directory identifier, and the current default; it does not contain the Key. The directory identifier does not change with the alias, so renaming does not break the paths of existing query files. Use profile current to see the actual location of configuration files.

Each Profile configuration is complete and standalone; unconfigured fields use program defaults and do not inherit from the root config.yaml. At import time, 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 through 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 that support POSIX permissions, configuration files are written with mode 0600, and Profile directories are created with mode 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 has not been used, legacy configuration and environment variable precedence remain compatible. After explicitly selecting default or running owl switch default, the root configuration also follows the full 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; its original behavior is preserved during the compatibility period. When used, a one-time migration notice is written to stderr without affecting JSON stdout. We recommend importing the configuration and then using the alias:

owl profile add standalone --from ./standalone.yaml
owl --profile standalone config show

Passing --conf and --profile together returns an error. Using --conf alone ignores OWL_PROFILE and the persisted selection, keeps the original environment variable precedence, and writes changes back to the specified file. --conf does not select a separate set of Profile directories and does not apply to 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, rotation of external key files, or custom paths can continue to use --conf during the compatibility period; switch to Profiles once migration is complete. This deprecation applies only to the OWL CLI; the Registry service's --config is unchanged.

Modifying, Renaming, and Removing

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

# Use only 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 the configuration; the alias is only a label and is not guaranteed to be permanently bound to a specific workspace.

When renaming the current default, OWL updates the selection record accordingly. You must switch away before removing the current default; a Profile selected via OWL_PROFILE also requires the temporary selection to be unset first. default cannot be renamed or removed.

By default, removal only deletes the configuration and credentials and shows 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 that is still under management. Recreating a Profile with the same name creates a new directory and does not connect to old artifacts.

If --purge fails to clean up artifacts, the configuration and credentials are retained and the alias is restored; retry after fixing directory permissions. Cache or query files already deleted during cleanup will not be restored; if you need to keep artifacts, back them up first or use the remove command without --purge.

Agent-managed Runtime Profiles

A CLI with capability runtime-profile/v1 accepts three executor-injected variables together: OWL_RUNTIME_PROFILE (a stable, nonsecret alias), OWL_RUNTIME_ENDPOINT, and OWL_RUNTIME_TOKEN. Any variable activates complete validation. Every call requires a nonempty runtime Key; it cannot fall back to installation credentials. The mode locks the Profile and endpoint. It rejects --conf, another --profile, owl switch, login, and configuration changes.

Runtime configuration uses OWL_DIR/profiles/runtime-<alias hash>, with separate cache/data/log/index. It stores only the endpoint and auth.runtime: true, without the Key or a state.yaml entry. Key rotation preserves the user's artifact directory but changes cache identity when endpoint/Key changes. The executor should scope aliases by deployment/workspace/user and isolate outer Agent directories when necessary.

OWL_RUNTIME_TOKEN takes precedence over the selected Profile's authentication. Without this protocol, existing ordinary Profile and OWL_API_KEY / OWL_TOKEN precedence stays the same. Runtime Profiles do not provide an OS sandbox; the host controls same-UID environment and file access. Release Owl, then the complete Agent package, then reinstall to enable user mode. Disable user mode and reinstall before rollback.

Feedback

Is this page helpful?