@dimension-studios/ttk-proxy

中文文档
1.223.0发布于 2026/11/11ISCTypeScriptES Module近 30 天下载 5852

CLI tool for TikTok proxy API

原始使用文档
文档目录19 节
  1. Installation
  2. Configuration
  3. 1. Using Environment Variables (Recommended)
  4. 2. Using the CLI
  5. View Current Configuration
  6. Clear Configuration
  7. Usage
  8. List TikTok Proxy Tokens
  9. Search shops (by name or slug)
  10. Call the TikTok Proxy API
  11. Output
  12. API Reference
  13. Commands
  14. Development
  15. Setup
  16. Testing Locally
  17. License
  18. Author
  19. Support

@dimension-studios/ttk-proxy

CLI tool for TikTok Proxy API - A simple command-line interface to interact with the TikTok proxy service.

Installation

npm install -g @dimension-studios/ttk-proxy

Configuration

The CLI uses conf to store your API credentials. You can configure it in two ways:

Set the following environment variables:

export TTK_FETCH_API_URL="https://your-api-url.com"
export TTK_FETCH_API_KEY="your-api-key"
export TTK_FETCH_API_SECRET="your-api-secret"

Then run the config command to save them:

ttk-proxy config

2. Using the CLI

ttk-proxy config:set apiUrl "https://your-api-url.com"
ttk-proxy config:set apiKey "your-api-key"
ttk-proxy config:set apiSecret "your-api-secret"

View Current Configuration

ttk-proxy config --show

Clear Configuration

ttk-proxy config --clear

Usage

List TikTok Proxy Tokens

List all available TikTok proxy tokens:

ttk-proxy list

Search shops (by name or slug)

Search shops your API token can access (requires GET /ttk-proxy/shops/search on the Node API):

ttk-proxy shops coffee

Call the TikTok Proxy API

Make a call to the TikTok proxy API with a JSON body:

ttk-proxy call '{"shopId":"your-shop-id","url":"https://api.tiktok.com/endpoint","method":"GET"}'

Example with more complex body:

ttk-proxy call '{
  "shopId": "shop-123",
  "url": "https://api.tiktok.com/v1/shops/products",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json"
  },
  "unofficialApi": {
    "addCookieToHeaders": true,
    "signUrl": true
  }
}'

Base64 Support

You can also pass the JSON body as a base64-encoded string. The CLI will automatically detect and decode it:

# First encode your JSON to base64
echo -n '{"shopId":"shop-123","url":"https://api.tiktok.com/endpoint","method":"GET"}' | base64

# Then pass it directly to the CLI
ttk-proxy call "eyJzaG9wSWQiOiJzaG9wLTEyMyIsInVybCI6Imh0dHBzOi8vYXBpLnRpa3Rvay5jb20vZW5kcG9pbnQiLCJtZXRob2QiOiJHRVQifQ=="

This is useful when copying request bodies from logs or other sources where the JSON is already base64-encoded.

Output

The CLI prints plain messages to stdout, and errors to stderr.

Example output:

🚀 Calling TikTok Proxy API at https://your-api-url.com...
✅ Status: 200 OK

📦 Response:
{
  "code": 0,
  "data": {
    "products": [...]
  },
  "message": "success"
}

API Reference

Commands

ttk-proxy call <body>

Call the TikTok proxy API with a JSON body.

  • Arguments:
    • body (string): Stringified JSON body for the request (can be raw JSON or base64-encoded JSON)

ttk-proxy list

List all TikTok proxy tokens.

ttk-proxy shops <query>

Search shops authorized for your API token (GET /ttk-proxy/shops/search on your Node API). Use at least 2 characters in query.

ttk-proxy get-cookies <shopId>

Fetch cookies JSON for the given shop ID (calls POST /ttk-proxy/get-cookies).

  • Options:
    • -i, --allow-invalid: Return the stored cookie even if no slot is marked valid

ttk-proxy config

Manage configuration.

  • Options:
    • -s, --show: Show current configuration
    • -c, --clear: Clear all configuration

ttk-proxy config:set <key> <value>

Set a configuration value.

  • Arguments:
    • key (string): Configuration key (apiUrl, apiKey, or apiSecret)
    • value (string): Configuration value

Development

Setup

# Install dependencies (repo root)
bun install

# Build the package
bun run --cwd tools/ttk-proxy build

# Run type checking
bun run --cwd tools/ttk-proxy type-check

# Development mode (watch)
bun run --cwd tools/ttk-proxy dev

Testing Locally

# After building, run the CLI from the repo root
node tools/ttk-proxy/bin/cli.js --help

License

ISC

Author

Dimension Studios

Support

For issues and questions, please open an issue on the GitHub repository.

版本与发布记录

@dimension-studios/ttk-proxy 共发布 699 个版本,首次发布于 2025/12/01;过去 12 个月发布了 699 个版本。

版本发布日期距今
1.223.0latest2026/11/111 天前
1.222.12026/11/101 天前
1.222.02026/11/102 天前
1.221.02026/11/102 天前
1.220.02026/11/092 天前
1.219.02026/11/074 天前

其他发布通道:beta → 1.31.0-preprod-release.340。

关于 @dimension-studios/ttk-proxy 的常见问题

@dimension-studios/ttk-proxy 是什么?

CLI tool for TikTok proxy API

如何安装 @dimension-studios/ttk-proxy?

在项目目录运行 npm install @dimension-studios/ttk-proxy,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 ttk-proxy,可以用 npx ttk-proxy 直接运行。

@dimension-studios/ttk-proxy 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@dimension-studios/ttk-proxy 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@dimension-studios/ttk-proxy 可以商用吗?

@dimension-studios/ttk-proxy 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dimension-studios/ttk-proxy 的下载量有多少?

根据 npm 官方下载统计,@dimension-studios/ttk-proxy 在 2026/10/13 – 2026/11/11 这 30 天内被下载 5,852 次,日均约 195 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dimension-studios/ttk-proxy 还在维护吗?

最新版本 1.223.0 发布于 2026/11/11(1 天前);至今共发布 699 个版本,其中过去 12 个月发布了 699 个;首次发布于 2025/12/01。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。