TE CLI (ae-cli) is the command-line tool for the ThinkingEngine data analysis platform, used by AI Agents and human users.
Authentication
You must authenticate before use. Authentication priority:
- Environment variable
TE_TOKEN(highest priority, suitable for CI/scripts) - Cached token (
~/.ae-cli/tokens.json, valid for 20 hours) - macOS automatically extracts it from Chrome (macOS only)
Authentication Commands
# Automatic macOS authentication (extract token from Chrome)
ae-cli auth login
Manually set token
ae-cli auth set-token
View authentication statusae-cli auth status
Log outae-cli auth logout
### Multi-environment Support
```bash
# Specify host
ae-cli auth login --host ta-staging.example.com
ae-cli auth set-token <token> --host ta-staging.example.com
# Configure default host
ae-cli config set defaultHost ta-staging.example.com
Global Parameters
All commands support the following global parameters:
| Parameter | Description | Default |
|---|---|---|
--host <host> |
TE instance address | defaultHost from config or ta.thinkingdata.cn |
--format <json|table> |
Output format | json |
--jq <expr> |
jq filter expression | - |
--dry-run |
Show the request only, do not execute it | false |
--yes |
Skip confirmation for write operations | false |
Output Format
JSON (default)
{
"ok": true,
"data": { ... }
}
Table
ae-cli analysis_meta +list_events --project_id <YOUR_PROJECT_ID> --format table
jq Filtering
ae-cli analysis_meta +list_events --project_id <YOUR_PROJECT_ID> --jq '.'
Error Handling
Error output goes to stderr, in the following format:
{
"ok": false,
"error": {
"type": "auth | api | validation | config",
"message": "...",
"hint": "..."
}
}
Exit code: success 0, error 1.
Security Constraints
- Commands with
risk: readexecute directly - Commands with
risk: writerequire confirmation unless--yesis passed - Use
--dry-runto preview the request that will be sent
Command Structure
ae-cli <domain> +<command> [flags]
ae-cli api <METHOD> <PATH> [--params] [--data]
Domains: analysis (analysis), analysis_audience (audience), analysis_meta (metadata), analysis_common (common), operation (operations)