CLI Commands¶
This document introduces commonly used commands for Owl CLI, including configuration and authentication, tool catalog synchronization, tool viewing and execution, cache management, data file management, and Schema output for Agents.
Configuration and Authentication¶
Owl CLI uses the following common configurations:
| Configuration Item | Description |
|---|---|
OWL_REGISTRY_ENDPOINT |
The Owl CLI Endpoint corresponding to the site where the workspace belongs |
OWL_TOKEN |
Service access token, used to identify the caller's identity, corresponding to DF-API-KEY |
OWL_API_KEY |
Alias environment variable for the service access token, equivalent to OWL_TOKEN |
OWL_DIR |
Override the default configuration/cache/data root directory, default is $HOME/.owl, ~ can be used for expansion |
Common commands:
| Command | Description |
|---|---|
owl init |
Write the Owl CLI Endpoint |
owl login |
Write the access token |
owl config show |
View current configuration |
owl config set <configuration item> <value> |
Modify the specified configuration item |
owl workspace list |
Get the list of available workspaces under the current account, outputting the name and workspace_uuid for each workspace |
owl workspace use <workspace_uuid> |
Switch to the specified workspace, automatically fetch the access key from the cloud and write it to the local configuration; subsequent commands like owl sync, owl exec will be executed using the identity of this workspace |
owl workspace current |
Display the current workspace context |
owl workspace key get <workspace_uuid\|workspace_name> |
Get the access key for the specified workspace (displayed desensitized by default, add --show-secret to output the original key) |
owl workspace profile list |
List local workspace profiles |
owl workspace profile current |
Display the current local workspace profile |
owl workspace profile use <profile_name> |
Switch the current local workspace profile |
owl workspace same-org list |
List workspaces within the same organization (see below for details) |
The
workspacecommand can also be written as the aliasworkspaces.
When setting the access token, the two key names api-key and token are equivalent; writing either one will update the same access token; workspace-level tokens follow the same equivalence rule.
owl workspace same-org list¶
List workspaces that are in the same organization (same-org) as the current account. Supported flags:
| Flag | Description |
|---|---|
--page-size <n> |
Number of items per page, value range 1-100, default 20; out-of-range will cause an error |
--before-id <id> |
Pagination cursor, only returns workspaces with id less than this value; the cursor value is returned by the server and cannot be calculated from array indices |
--uuid <uuid> |
Filter by workspace_uuid, can be passed multiple times |
--all |
Automatically paginate following the cursor returned by the server, returning all pages |
Pagination rules:
- By default, only one page is returned. If there are more results, the text output will prompt
More results available. Fetch the next page with --before-id <id>, where<id>is the next page cursor returned by the server. - When
--allis added, the CLI will automatically loop to fetch the next page according to the cursor returned by the server, until there are no more results; it will stop if the cursor cannot advance further, avoiding infinite loops for abnormal servers.
Examples:
owl workspace same-org list
owl workspace same-org list --page-size 50
owl workspace same-org list --before-id 12345
owl workspace same-org list --uuid wksp_xxx --uuid wksp_yyy
owl workspace same-org list --all
Environment variables have higher priority than local configuration files. If OWL_REGISTRY_ENDPOINT, OWL_API_KEY, or OWL_TOKEN are already set in the current terminal, Owl CLI will prioritize using the values from the environment variables; when both OWL_API_KEY and OWL_TOKEN exist, OWL_API_KEY takes precedence.
Categories and Tool Catalog¶
Before viewing categories and tools, it is recommended to perform a synchronization first:
Category and tool viewing commands:
| Command | Description |
|---|---|
owl category list |
View all categories |
owl category show <Category ID> |
View category details and tools under the category |
owl list |
View all tools |
owl list -c <Category ID> |
View tools under a specific category |
owl show <Tool Name> |
View tool details and parameter definitions |
Tool Execution¶
Use owl exec to execute tools.
The tool name must match the name displayed in owl list. Before execution, you can use owl show <Tool Name> to view parameter definitions.
Parameter Passing Methods¶
owl exec supports the following four parameter passing methods.
Using --key value¶
Using key=value¶
Using -p to pass JSON¶
Reading JSON from standard input¶
Execution Rules¶
When executing tools, please note:
- The tool name must match the name displayed in
owl list - All required parameters must be provided
- Parameter names must match the tool definition
- Parameter types must match the tool definition
- Whether the return result is visible depends on the permissions of the API Key corresponding to
OWL_TOKEN
Example: Querying Metric Sources¶
Example: Querying Event List¶
owl show owl.event.list
owl exec owl.event.list --start_time 1712505600000 --end_time 1712592000000 --limit 20
Configuration Files and Priority¶
Default configuration file paths:
| Operating System | Configuration File Path |
|---|---|
| Windows | %USERPROFILE%\.owl\config.yaml |
| Linux / macOS | $HOME/.owl/config.yaml |
Configuration file example:
registry:
endpoint: your-owl-endpoint
sync_interval: 3600
auth:
token: ""
cache:
directory: ~/.owl/cache
ttl: 86400
data:
directory: ~/.owl/data
max_age_days: 30
sync:
parallel: true
concurrency: 5
incremental: true
execution:
default_timeout: 30000
max_output_size: 10485760
logging:
level: info
file: ~/.owl/logs/owl.log
Configuration priority from high to low is as follows:
- Environment variables
config.yaml
Cache and Synchronization¶
owl sync will synchronize the category and tool metadata from Guance to the local cache directory.
The following scenarios require re-executing owl sync:
- After initial installation is complete
- When the platform releases new tools
- When the platform updates parameters or descriptions of existing tools
- When local cache content needs to be refreshed
Common synchronization and cache commands:
| Command | Description |
|---|---|
owl sync |
Synchronize all categories and tools |
owl sync -c <Category ID> |
Synchronize only the specified category |
owl cache status |
View cache status |
owl cache clear |
Clear all cache |
owl cache clear -c <Category ID> |
Clear cache for the specified category |
Data Result Files¶
When the output type defined by a tool is data, Owl CLI will automatically save the result file to the local data/ directory and record file index and structure information.
Common data file commands:
| Command | Description |
|---|---|
owl data list |
View data file list |
owl data show <file-id> |
View details of the specified data file |
owl data rm <file-id> |
Delete the specified data file |
owl data clean --days <number of days> |
Clean up historical files older than the specified number of days |
owl data stats |
View data file statistics |
Schema Output for Agents¶
If you need to integrate Owl CLI into a custom Agent, you can export the function call Schema:
Export only specified categories:
The output of owl schema includes:
owl_exec: Uniformly execute any Owl toolowl_list_categories: List categoriesowl_list_tools: List tools- Currently synchronized tool definitions
Before integrating with an Agent, it is recommended to execute owl sync once to ensure the local Schema is consistent with the platform's current tool catalog.
If the target client supports MCP, prioritize using the remote MCP Server integration method described in MCP Server Quick Start.
Help Commands¶
View Owl CLI help:
View help for a specific command: