SuperAPI AI Directory

te-shared

Data & analytics

View repository

Updated 10-16 07:23

About this skill

te-shared

TE CLI (te-cli) is the command-line tool of the ThinkingEngine data analysis platform, for use by AI Agents and human users.

Authentication

You must authenticate before use. Authentication priority:

  1. Environment variable TE_TOKEN(highest priority, suitable for CI/scripts)
  2. Cached token (~/.te-cli/tokens.json, valid for 20 hours)
  3. macOS automatically extracts from Chrome (macOS only)

Authentication commands

# macOS 自动认证(从 Chrome 提取 token)
te-cli auth login
Manually set token

te-cli auth set-token

View authentication status

te-cli auth status

Log out

te-cli auth logout


### 多环境支持

```bash
# 指定 host
te-cli auth login --host ta-staging.example.com
te-cli auth set-token <token> --host ta-staging.example.com

# 配置默认 host
te-cli config set defaultHost ta-staging.example.com

Global Parameters

All commands support the following global parameters:

Parameter Description Default Value
--host <host> TE instance address defaultHost in the configuration or ta.thinkingdata.cn
--format <json|table> Output format json
--jq <expr> jq filter expression -
--dry-run Only show the request, do not execute false
--yes Skip write operation confirmation false

Output format

JSON (default)

{
  "ok": true,
  "data": { ... }
}

Table

te-cli meta +list-events -p 1 --format table

jq filter

te-cli meta +list-events -p 1 --jq '.events[].eventName'

Error Handling

Errors are output to stderr, format:

{
  "ok": false,
  "error": {
    "type": "auth | api | validation | config",
    "message": "...",
    "hint": "..."
  }
}

Exit codes: success 0, error 1。

Security Constraints

  • risk: read commands are executed directly
  • risk: write commands require confirmation, unless --yes
  • Using --dry-run can preview the request to be sent

Command Structure

te-cli <domain> +<command> [flags]
te-cli api <METHOD> <PATH> [--params] [--data]

Domains:meta(metadata),analysis(analysis),audience(audience),operation(operation)