CLI Quick Start¶
This document is for users who are using OWL CLI for the first time. It introduces how to configure OWL CLI, sync the tool directory, and execute a tool call.
Prerequisites¶
Before starting, please confirm:
- Completed Manual Installation of OWL or Automatic Installation of OWL
- Obtained the OWL CLI Endpoint corresponding to the site of your workspace. Refer to Endpoint List
- Obtained the access token
OWL_TOKENorOWL_API_KEY, corresponding to DF-API-KEY - The current terminal can access the OWL CLI Endpoint
Step 1: Configure Endpoint and Access Token¶
OWL CLI supports setting the Endpoint and access token via environment variables or a local configuration file.
OWL_REGISTRY_ENDPOINT only needs the root address of the Endpoint. Do not manually append /api/v1 or other paths.
Method 1: Using Environment Variables¶
Environment variables are only effective in the current terminal session. After closing the terminal, you need to set them again to continue using.
The access token can also be set via OWL_API_KEY. When both OWL_API_KEY and OWL_TOKEN exist, OWL CLI uses OWL_API_KEY as the priority.
Method 2: Writing to Local Configuration File¶
Execution notes:
owl initis used to write the OWL CLI Endpointowl loginis used to write the access token
Local configuration is written to the OWL CLI configuration directory, and subsequent sessions in new terminals can also use it.
Environment variables take precedence over the configuration file. If environment variables are already set in the current terminal, OWL CLI will use the values from the environment variables first.
Step 2: Sync Tool Directory¶
Before using OWL CLI for the first time, you need to sync the tool directory:
owl sync will sync the metadata of currently available categories and tools from TrueWatch to the local cache. After syncing, you can view and execute tools.
If you only need to sync a specific category, you can use the -c option to specify the category:
Step 3: View Tools¶
View all tool categories:
View tools under a specific category:
View the parameter description of a specific tool:
Step 4: Execute a Tool¶
Run the following command to view the DQL namespaces supported by the current workspace (this is the first step before using owl.data.query):
For machine-readable output, you can specify JSON format:
Complete Example¶
Success Criteria¶
After completing the quick start, the following results should be achieved:
owl synccompletes successfully without authentication or network errorsowl category listshows tool categoriesowl list -c datashows tools under thedatacategoryowl exec owl.data.show_dql_namespacereturns the DQL namespaces supported by the current workspace
If you encounter authentication failures, tool not found, empty results, or other issues, please refer to Troubleshooting.