CLI Quick Start¶
This document is intended for users who are using the OWL CLI for the first time. It describes how to complete OWL CLI configuration, synchronize the tool catalog, and execute a tool call.
Prerequisites¶
Before you begin, ensure:
- You have completed Manual OWL Installation or Automatic OWL Installation
- You have obtained the OWL CLI Endpoint corresponding to the site of your workspace. Refer to the Endpoint List
- You have obtained the access token
OWL_TOKENorOWL_API_KEY, which corresponds to DF-API-KEY - The current terminal can reach 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 should only contain the root address of the Endpoint. Do not manually append /api/v1 or any other path.
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 CLI.
The access token can also be set via OWL_API_KEY. When both OWL_API_KEY and OWL_TOKEN are present, the OWL CLI will use OWL_API_KEY.
Method 2: Writing to a Local Configuration File¶
Explanation:
owl initis used to write the OWL CLI Endpointowl loginis used to write the access token
The local configuration is written to the OWL CLI configuration directory, so it can be used in subsequent terminal sessions.
Environment variables take precedence over the configuration file. If environment variables are set in the current terminal, the OWL CLI will use the values from the environment variables.
Step 2: Synchronize the Tool Catalog¶
Before using OWL CLI for the first time, you need to synchronize the tool catalog:
owl sync will synchronize the metadata of categories and tools currently available in TrueWatch to the local cache. After synchronization, you can view and execute tools.
To synchronize only a specific category, use the -c flag:
Step 3: View Tools¶
List all tool categories:
List tools under a specific category:
View the parameters of a specific tool:
Step 4: Validate Before Execution¶
Validate a tool invocation without making an actual query:
The valid field in the result should be true, and request_executed should be false. If the current CLI does not support validate, upgrade to version 1.2.0 or later.
Step 5: 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, specify the JSON format:
Complete Example¶
Success Criteria¶
After completing the Quick Start, you should achieve the following:
owl synccompletes successfully without authentication or network errorsowl category listdisplays tool categoriesowl list -c datashows tools under thedatacategoryowl validate owl.data.show_dql_namespace -f jsonreturnsvalid: trueandrequest_executed: falseowl exec owl.data.show_dql_namespacereturns the DQL namespaces supported by the current workspace
If you encounter authentication failures, missing tools, empty results, or other issues, please refer to Troubleshooting.