{"id":"493aa74a-36c6-47ec-8dd7-481fa1330e95","entityType":"agent","slug":"clawhub-baidu-translate-baidu-text-translate","name":"Baidu Text Translate","canonicalUrl":"https://www.xpersona.co/agent/clawhub-baidu-translate-baidu-text-translate","canonicalPath":"/agent/clawhub-baidu-translate-baidu-text-translate","generatedAt":"2026-10-10T17:36:55.850Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T14:20:09.282Z","emptyReason":null},"description":"Translate text using Baidu AI Translation API via trans-cli with Baidu-specific language codes, API key management, error handling, and environment diagnostics. Skill: Baidu Text Translate Owner: baidu-translate Summary: Translate text using Baidu AI Translation API via trans-cli with Baidu-specific language codes, API key management, error handling, and environment diagnostics. Tags: latest:1.0.1 Version history: v1.0.1 | 2026-04-29T03:28:05.140Z | user - Added required TRANS_API_KEY environment variable to skill metadata. - No other changes to skill logic or documentation.","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.4K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s173pby7qgzc6mnef856135vr983z06v:baidu-text-translate","sourceUrl":"https://clawhub.ai/baidu-translate/baidu-text-translate","homepage":"https://clawhub.ai/baidu-translate/skills/baidu-text-translate","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/baidu-translate/baidu-text-translate","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/baidu-translate/skills/baidu-text-translate","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":63,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Translate text using Baidu AI Translation API via trans-cli with Baidu-specific language codes, API key management, error handling, and environment diagnostics."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T14:20:09.282Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T14:20:09.282Z","emptyReason":null},"stars":null,"forks":null,"downloads":1390,"packageName":null,"latestVersion":"1.0.1","tractionLabel":"1.4K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T14:20:09.282Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T14:20:09.282Z","lastCrawledAt":"2026-10-10T14:20:09.282Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T14:20:09.282Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.1","createdAt":"2026-04-29T03:28:05.140Z","changelog":"- Added required TRANS_API_KEY environment variable to skill metadata. - No other changes to skill logic or documentation.","fileCount":3,"zipByteSize":4588},{"version":"1.0.0","createdAt":"2026-04-20T09:47:02.195Z","changelog":"- Initial release of baidu-text-translate skill. - Enables text translation via the trans-cli tool using Baidu Translation AI API. - Supports JSON output, Baidu-specific language codes (e.g., jp, kor, fra, spa, ara), and error handling based on exit codes and API responses. - Includes guidance for API key setup, quota issues, and environment diagnosis using trans doctor. - Provides tools for listing and searching supported languages with correct Baidu codes. - Details non-standard behaviors and configuration priorities for seamless translation workflow.","fileCount":2,"zipByteSize":3356}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s173pby7qgzc6mnef856135vr983z06v:baidu-text-translate","setupComplexity":"medium","setupSteps":["Setup complexity is MEDIUM. Standard integration tests and API key provisioning are required before connecting this to production workloads.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-baidu-translate-baidu-text-translate/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-baidu-translate-baidu-text-translate/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-baidu-translate-baidu-text-translate/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-baidu-translate-baidu-text-translate/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-baidu-translate-baidu-text-translate/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-baidu-translate-baidu-text-translate/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T17:36:55.850Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-baidu-translate-baidu-text-translate/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-baidu-translate-baidu-text-translate/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-baidu-translate-baidu-text-translate/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-baidu-translate-baidu-text-translate/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-10T14:20:09.282Z","emptyReason":null},"readme":"Skill: Baidu Text Translate\n\nOwner: baidu-translate\n\nSummary: Translate text using Baidu AI Translation API via trans-cli with Baidu-specific language codes, API key management, error handling, and environment diagnostics.\n\nTags: latest:1.0.1\n\nVersion history:\n\nv1.0.1 | 2026-04-29T03:28:05.140Z | user\n\n- Added required TRANS_API_KEY environment variable to skill metadata.\n- No other changes to skill logic or documentation.\n\nv1.0.0 | 2026-04-20T09:47:02.195Z | user\n\n- Initial release of baidu-text-translate skill.\n- Enables text translation via the trans-cli tool using Baidu Translation AI API.\n- Supports JSON output, Baidu-specific language codes (e.g., jp, kor, fra, spa, ara), and error handling based on exit codes and API responses.\n- Includes guidance for API key setup, quota issues, and environment diagnosis using trans doctor.\n- Provides tools for listing and searching supported languages with correct Baidu codes.\n- Details non-standard behaviors and configuration priorities for seamless translation workflow.\n\nArchive index:\n\nArchive v1.0.1: 3 files, 4588 bytes\n\nFiles: skill-card.md (2461b), SKILL.md (6526b), _meta.json (139b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: baidu-text-translate\ndescription: Use this skill whenever you need to translate text with the trans-cli tool (Baidu Translation AI API). Covers JSON output contract, Baidu-specific language codes (jp/kor/fra/spa/ara — not ISO defaults), exit code semantics, error decision tree, first-time API key setup, QUOTA_EXCEEDED / AUTH_FAILED recovery, environment self-diagnosis via `trans doctor`, and listing supported languages via `trans languages`. Trigger on any of: running `trans text`, shell pipelines with translation, trans-cli errors, API key configuration, `trans doctor` checks, or looking up language codes.\nhomepage: https://fanyi.baidu.com\nmetadata: {\"clawdbot\":{\"emoji\":\"🌐\",\"requires\":{\"bins\":[\"trans\"],\"env\":[\"TRANS_API_KEY\"]},\"install\":[{\"id\":\"npm\",\"kind\":\"npm\",\"package\":\"@bdtrans/trans-cli\",\"bins\":[\"trans\"],\"label\":\"Install trans-cli (npm)\"}]}}\n---\n\n# baidu_text_translate — Agent Reference\n\n`trans text` wraps the Baidu AI Translation API. Use `--json` — it separates\nsuccess (stdout) from errors (stderr) and gives you structured fields to act on.\n\n```bash\ntrans text --json \"你好世界\"                             # auto-detect → English\ntrans text --json --from zh --to jp \"你好\"               # explicit languages\ntrans text --json --to fra --reference \"使用正式语气\" \"你好\"  # custom instruction\necho \"早上好\" | trans text --json                        # stdin pipe\n```\n\n---\n\n## Environment Diagnosis\n\nBefore translating, verify the environment with `trans doctor`:\n\n```bash\ntrans doctor           # human-readable output\ntrans doctor --json    # JSON output for Agent parsing\n```\n\n**JSON contract** (stdout):\n```json\n{\n  \"checks\": [\n    {\"name\":\"api_key\",     \"ok\":true,  \"source\":\"env/config\", \"message\":\"configured\"},\n    {\"name\":\"connectivity\",\"ok\":true,  \"latency_ms\":243,       \"message\":\"reachable\"},\n    {\"name\":\"account\",     \"ok\":true,                          \"message\":\"valid\"}\n  ],\n  \"all_ok\": true\n}\n```\n\n| Exit | `all_ok` | Meaning |\n|------|----------|---------|\n| 0 | `true` | All checks passed — ready to translate |\n| 2 | `false` | At least one check failed — inspect `checks[].ok` |\n\n**When a check fails**, `help_url` in the failing check points to the fix:\n- `api_key.ok:false` → set `TRANS_API_KEY` (see Configuration below)\n- `account.ok:false` → key invalid/expired or quota exhausted\n\nRun `trans doctor --json` as the first step when diagnosing any trans-cli failure.\n\n---\n\n## JSON Contract\n\n**Success** (stdout, exit 0):\n```json\n{\"from\":\"zh\",\"to\":\"en\",\"source\":\"你好\",\"translated\":\"Hello\"}\n```\n\n| Field | Note |\n|-------|------|\n| `from` | API-detected language — may differ from `--from auto` |\n| `to` | Target language |\n| `source` | Original input |\n| `translated` | Result |\n\n**Error** (stderr, exit ≠ 0):\n```json\n{\"code\":\"AUTH_FAILED\",\"message\":\"…\",\"help_url\":\"https://…\",\"raw_code\":\"52001\"}\n```\n\n`help_url` and `raw_code` are omitted when not applicable.\n\n---\n\n## Error Decision Tree\n\n| Exit | `code` | Cause | Action |\n|------|--------|-------|--------|\n| 0 | — | OK | Use `translated` |\n| 1 | `INVALID_INPUT` | Empty text | Fix input, don't retry |\n| 1 | `INVALID_LANGUAGE` | Wrong lang code (e.g. `ja` → should be `jp`) | Fix `--to`/`--from`, see Language Codes below |\n| 2 | `CONFIG_MISSING` | `TRANS_API_KEY` not set | Stop — run `trans doctor --json` then guide user to set up API key |\n| 2 | `AUTH_FAILED` | Key invalid/expired (`raw_code` 52001–52003) | Stop — run `trans doctor --json` then guide user to API key page |\n| 3 | `QUOTA_EXCEEDED` | Balance = 0 | Stop — guide user to recharge (see below) |\n| 3 | `RATE_LIMITED` | QPS exceeded | Wait 1 s, retry once |\n| 3 | `API_ERROR` | Unexpected API error | Retry once; if persists, report `raw_code` + `message` |\n| 4 | `NETWORK_ERROR` | No connectivity | Retry twice with 2 s gap; if persists, report |\n\nExit 2 requires human intervention — the agent cannot fix auth or config.\nExit 1 means the agent passed bad arguments — fix the call, not the environment.\n\n---\n\n## Language Codes\n\nBaidu does **not** follow ISO 639. When unsure of a code, query locally:\n\n```bash\ntrans languages                    # full list (200+ languages)\ntrans languages --filter jp        # search by code\ntrans languages --filter 日语      # search by name\ntrans languages --json             # JSON output for Agent parsing\n```\n\nThe six most common ISO traps:\n\n| Baidu (correct) | ISO (wrong for Baidu) | Language |\n|-----------------|----------------------|----------|\n| `jp` | `ja` | Japanese |\n| `kor` | `ko` | Korean |\n| `fra` | `fr` | French |\n| `spa` | `es` | Spanish |\n| `ara` | `ar` | Arabic |\n| `vie` | `vi` | Vietnamese |\n\nOther common codes that match ISO: `zh` `cht` `en` `ru` `de` `pt` `it` `nl` `hi` `th`\nUse `auto` for source-language auto-detection.\n\n---\n\n## Configuration\n\nPriority: `--api-key flag > TRANS_API_KEY env > ~/.trans-cli/config.json`\n\nConfig file field: `api_key`.\n\n```bash\ntrans config init               # create empty config skeleton (~/.trans-cli/config.json)\ntrans config init --force       # overwrite existing config\ntrans config set api_key <KEY>  # write api_key (creates file if absent)\n```\n\n---\n\n## Getting an API Key (First-Time Setup)\n\nGuide the user through these steps — the agent cannot do this on their behalf:\n\n1. Open the Baidu Translation Open Platform and sign in: <https://fanyi-api.baidu.com/>\n2. Go to Developer Center: <https://fanyi-api.baidu.com/manage/developer>\n3. Click \"Use Now\" → select \"General Translation\" → complete identity verification\n4. Get your API Key: <https://fanyi-api.baidu.com/manage/apiKey>\n5. Write to config: `trans config set api_key <KEY>`\n   or set the environment variable `TRANS_API_KEY`\n6. Verify: `trans doctor --json` — `all_ok:true` means success\n\n---\n\n## Recharging (QUOTA_EXCEEDED)\n\nRecharge portal: <https://fanyi-api.baidu.com/manage/account>\nTakes effect immediately — no restart needed. Auto-renewal can be enabled on the same page.\nUsage details: <https://fanyi-api.baidu.com/api/trans/user/usage>\n\n---\n\n## Non-Obvious Behaviours\n\n- Multiple positional args join with a space: `trans text hello world` → `\"hello world\"`\n- When both stdin and positional args are given, positional args win silently\n- The `from` field in JSON is the API's detected language, not the `--from` flag value\n- `trans doctor` checks are short-circuit: if `api_key` fails, connectivity/account are skipped\n- `--reference` is optional; omitting it sends no extra field to the API\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn7fhw0h9fm3z24r13j111w56583yfp7\",\n  \"slug\": \"baidu-text-translate\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1777433285140\n}\n\nFile v1.0.1:skill-card.md\n\n## Description:\n\nTranslate text using Baidu AI Translation API via trans-cli with Baidu-specific language codes, API key management, error handling, and environment diagnostics.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[baidu-translate](https://clawhub.ai/user/baidu-translate)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agents use this skill to translate text with Baidu's trans-cli, diagnose API key and account readiness, choose Baidu-specific language codes, and respond to translation errors.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Translated text is sent to Baidu's external translation service.\n\nMitigation: Avoid translating secrets, credentials, private documents, or regulated data unless that data sharing has been approved.\n\nRisk: The skill depends on installing and running the external @bdtrans/trans-cli npm package.\n\nMitigation: Review the npm package and version before installation, especially in sensitive environments.\n\nRisk: The Baidu API key may be exposed through unsafe shell history, config files, or prompts.\n\nMitigation: Prefer TRANS_API_KEY or carefully managed config storage and do not paste credentials into translated text.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/baidu-translate/skills/baidu-text-translate)\n- [Baidu Translate](https://fanyi.baidu.com)\n- [Baidu Translation Open Platform](https://fanyi-api.baidu.com/)\n- [Baidu Developer Center](https://fanyi-api.baidu.com/manage/developer)\n- [Baidu API Key Management](https://fanyi-api.baidu.com/manage/apiKey)\n- [Baidu Account Recharge](https://fanyi-api.baidu.com/manage/account)\n- [Baidu Translation Usage Details](https://fanyi-api.baidu.com/api/trans/user/usage)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown with inline shell commands and JSON examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Guidance centers on trans-cli JSON output, exit codes, language codes, API key setup, and environment diagnostics.]\n\n## Skill Version(s):\n\n1.0.1 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.0.0: 2 files, 3356 bytes\n\nFiles: SKILL.md (6502b), _meta.json (139b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: baidu-text-translate\ndescription: Use this skill whenever you need to translate text with the trans-cli tool (Baidu Translation AI API). Covers JSON output contract, Baidu-specific language codes (jp/kor/fra/spa/ara — not ISO defaults), exit code semantics, error decision tree, first-time API key setup, QUOTA_EXCEEDED / AUTH_FAILED recovery, environment self-diagnosis via `trans doctor`, and listing supported languages via `trans languages`. Trigger on any of: running `trans text`, shell pipelines with translation, trans-cli errors, API key configuration, `trans doctor` checks, or looking up language codes.\nhomepage: https://fanyi.baidu.com\nmetadata: {\"clawdbot\":{\"emoji\":\"🌐\",\"requires\":{\"bins\":[\"trans\"]},\"install\":[{\"id\":\"npm\",\"kind\":\"npm\",\"package\":\"@bdtrans/trans-cli\",\"bins\":[\"trans\"],\"label\":\"Install trans-cli (npm)\"}]}}\n---\n\n# baidu_text_translate — Agent Reference\n\n`trans text` wraps the Baidu AI Translation API. Use `--json` — it separates\nsuccess (stdout) from errors (stderr) and gives you structured fields to act on.\n\n```bash\ntrans text --json \"你好世界\"                             # auto-detect → English\ntrans text --json --from zh --to jp \"你好\"               # explicit languages\ntrans text --json --to fra --reference \"使用正式语气\" \"你好\"  # custom instruction\necho \"早上好\" | trans text --json                        # stdin pipe\n```\n\n---\n\n## Environment Diagnosis\n\nBefore translating, verify the environment with `trans doctor`:\n\n```bash\ntrans doctor           # human-readable output\ntrans doctor --json    # JSON output for Agent parsing\n```\n\n**JSON contract** (stdout):\n```json\n{\n  \"checks\": [\n    {\"name\":\"api_key\",     \"ok\":true,  \"source\":\"env/config\", \"message\":\"configured\"},\n    {\"name\":\"connectivity\",\"ok\":true,  \"latency_ms\":243,       \"message\":\"reachable\"},\n    {\"name\":\"account\",     \"ok\":true,                          \"message\":\"valid\"}\n  ],\n  \"all_ok\": true\n}\n```\n\n| Exit | `all_ok` | Meaning |\n|------|----------|---------|\n| 0 | `true` | All checks passed — ready to translate |\n| 2 | `false` | At least one check failed — inspect `checks[].ok` |\n\n**When a check fails**, `help_url` in the failing check points to the fix:\n- `api_key.ok:false` → set `TRANS_API_KEY` (see Configuration below)\n- `account.ok:false` → key invalid/expired or quota exhausted\n\nRun `trans doctor --json` as the first step when diagnosing any trans-cli failure.\n\n---\n\n## JSON Contract\n\n**Success** (stdout, exit 0):\n```json\n{\"from\":\"zh\",\"to\":\"en\",\"source\":\"你好\",\"translated\":\"Hello\"}\n```\n\n| Field | Note |\n|-------|------|\n| `from` | API-detected language — may differ from `--from auto` |\n| `to` | Target language |\n| `source` | Original input |\n| `translated` | Result |\n\n**Error** (stderr, exit ≠ 0):\n```json\n{\"code\":\"AUTH_FAILED\",\"message\":\"…\",\"help_url\":\"https://…\",\"raw_code\":\"52001\"}\n```\n\n`help_url` and `raw_code` are omitted when not applicable.\n\n---\n\n## Error Decision Tree\n\n| Exit | `code` | Cause | Action |\n|------|--------|-------|--------|\n| 0 | — | OK | Use `translated` |\n| 1 | `INVALID_INPUT` | Empty text | Fix input, don't retry |\n| 1 | `INVALID_LANGUAGE` | Wrong lang code (e.g. `ja` → should be `jp`) | Fix `--to`/`--from`, see Language Codes below |\n| 2 | `CONFIG_MISSING` | `TRANS_API_KEY` not set | Stop — run `trans doctor --json` then guide user to set up API key |\n| 2 | `AUTH_FAILED` | Key invalid/expired (`raw_code` 52001–52003) | Stop — run `trans doctor --json` then guide user to API key page |\n| 3 | `QUOTA_EXCEEDED` | Balance = 0 | Stop — guide user to recharge (see below) |\n| 3 | `RATE_LIMITED` | QPS exceeded | Wait 1 s, retry once |\n| 3 | `API_ERROR` | Unexpected API error | Retry once; if persists, report `raw_code` + `message` |\n| 4 | `NETWORK_ERROR` | No connectivity | Retry twice with 2 s gap; if persists, report |\n\nExit 2 requires human intervention — the agent cannot fix auth or config.\nExit 1 means the agent passed bad arguments — fix the call, not the environment.\n\n---\n\n## Language Codes\n\nBaidu does **not** follow ISO 639. When unsure of a code, query locally:\n\n```bash\ntrans languages                    # full list (200+ languages)\ntrans languages --filter jp        # search by code\ntrans languages --filter 日语      # search by name\ntrans languages --json             # JSON output for Agent parsing\n```\n\nThe six most common ISO traps:\n\n| Baidu (correct) | ISO (wrong for Baidu) | Language |\n|-----------------|----------------------|----------|\n| `jp` | `ja` | Japanese |\n| `kor` | `ko` | Korean |\n| `fra` | `fr` | French |\n| `spa` | `es` | Spanish |\n| `ara` | `ar` | Arabic |\n| `vie` | `vi` | Vietnamese |\n\nOther common codes that match ISO: `zh` `cht` `en` `ru` `de` `pt` `it` `nl` `hi` `th`\nUse `auto` for source-language auto-detection.\n\n---\n\n## Configuration\n\nPriority: `--api-key flag > TRANS_API_KEY env > ~/.trans-cli/config.json`\n\nConfig file field: `api_key`.\n\n```bash\ntrans config init               # create empty config skeleton (~/.trans-cli/config.json)\ntrans config init --force       # overwrite existing config\ntrans config set api_key <KEY>  # write api_key (creates file if absent)\n```\n\n---\n\n## Getting an API Key (First-Time Setup)\n\nGuide the user through these steps — the agent cannot do this on their behalf:\n\n1. Open the Baidu Translation Open Platform and sign in: <https://fanyi-api.baidu.com/>\n2. Go to Developer Center: <https://fanyi-api.baidu.com/manage/developer>\n3. Click \"Use Now\" → select \"General Translation\" → complete identity verification\n4. Get your API Key: <https://fanyi-api.baidu.com/manage/apiKey>\n5. Write to config: `trans config set api_key <KEY>`\n   or set the environment variable `TRANS_API_KEY`\n6. Verify: `trans doctor --json` — `all_ok:true` means success\n\n---\n\n## Recharging (QUOTA_EXCEEDED)\n\nRecharge portal: <https://fanyi-api.baidu.com/manage/account>\nTakes effect immediately — no restart needed. Auto-renewal can be enabled on the same page.\nUsage details: <https://fanyi-api.baidu.com/api/trans/user/usage>\n\n---\n\n## Non-Obvious Behaviours\n\n- Multiple positional args join with a space: `trans text hello world` → `\"hello world\"`\n- When both stdin and positional args are given, positional args win silently\n- The `from` field in JSON is the API's detected language, not the `--from` flag value\n- `trans doctor` checks are short-circuit: if `api_key` fails, connectivity/account are skipped\n- `--reference` is optional; omitting it sends no extra field to the API\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7fhw0h9fm3z24r13j111w56583yfp7\",\n  \"slug\": \"baidu-text-translate\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1776678422195\n}","readmeExcerpt":"Skill: Baidu Text Translate Owner: baidu-translate Summary: Translate text using Baidu AI Translation API via trans-cli with Baidu-specific language codes, API key management, error handling, and environment diagnostics. Tags: latest:1.0.1 Version history: v1.0.1 | 2026-04-29T03:28:05.140Z | user - Added required TRANS_API_KEY environment variable to skill metadata. - No other changes to skill logic or documentation.","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"trans text --json \"你好世界\"                             # auto-detect → English\ntrans text --json --from zh --to jp \"你好\"               # explicit languages\ntrans text --json --to fra --reference \"使用正式语气\" \"你好\"  # custom instruction\necho \"早上好\" | trans text --json                        # stdin pipe"},{"language":"bash","snippet":"trans doctor           # human-readable output\ntrans doctor --json    # JSON output for Agent parsing"},{"language":"json","snippet":"{\n  \"checks\": [\n    {\"name\":\"api_key\",     \"ok\":true,  \"source\":\"env/config\", \"message\":\"configured\"},\n    {\"name\":\"connectivity\",\"ok\":true,  \"latency_ms\":243,       \"message\":\"reachable\"},\n    {\"name\":\"account\",     \"ok\":true,                          \"message\":\"valid\"}\n  ],\n  \"all_ok\": true\n}"},{"language":"json","snippet":"{\"from\":\"zh\",\"to\":\"en\",\"source\":\"你好\",\"translated\":\"Hello\"}"},{"language":"json","snippet":"{\"code\":\"AUTH_FAILED\",\"message\":\"…\",\"help_url\":\"https://…\",\"raw_code\":\"52001\"}"},{"language":"bash","snippet":"trans languages                    # full list (200+ languages)\ntrans languages --filter jp        # search by code\ntrans languages --filter 日语      # search by name\ntrans languages --json             # JSON output for Agent parsing"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: baidu-text-translate\ndescription: Use this skill whenever you need to translate text with the trans-cli tool (Baidu Translation AI API). Covers JSON output contract, Baidu-specific language codes (jp/kor/fra/spa/ara — not ISO defaults), exit code semantics, error decision tree, first-time API key setup, QUOTA_EXCEEDED / AUTH_FAILED recovery, environment self-diagnosis via `trans doctor`, and listing supported languages via `trans languages`. Trigger on any of: running `trans text`, shell pipelines with translation, trans-cli errors, API key configuration, `trans doctor` checks, or looking up language codes.\nhomepage: https://fanyi.baidu.com\nmetadata: {\"clawdbot\":{\"emoji\":\"🌐\",\"requires\":{\"bins\":[\"trans\"],\"env\":[\"TRANS_API_KEY\"]},\"install\":[{\"id\":\"npm\",\"kind\":\"npm\",\"package\":\"@bdtrans/trans-cli\",\"bins\":[\"trans\"],\"label\":\"Install trans-cli (npm)\"}]}}\n---\n\n# baidu_text_translate — Agent Reference\n\n`trans text` wraps the Baidu AI Translation API. Use `--json` — it separates\nsuccess (stdout) from errors (stderr) and gives you structured fields to act on.\n\n```bash\ntrans text --json \"你好世界\"                             # auto-detect → English\ntrans text --json --from zh --to jp \"你好\"               # explicit languages\ntrans text --json --to fra --reference \"使用正式语气\" \"你好\"  # custom instruction\necho \"早上好\" | trans text --json                        # stdin pipe\n```\n\n---\n\n## Environment Diagnosis\n\nBefore translating, verify the environment with `trans doctor`:\n\n```bash\ntrans doctor           # human-readable output\ntrans doctor --json    # JSON output for Agent parsing\n```\n\n**JSON contract** (stdout):\n```json\n{\n  \"checks\": [\n    {\"name\":\"api_key\",     \"ok\":true,  \"source\":\"env/config\", \"message\":\"configured\"},\n    {\"name\":\"connectivity\",\"ok\":true,  \"latency_ms\":243,       \"message\":\"reachable\"},\n    {\"name\":\"account\",     \"ok\":true,                          \"message\":\"valid\"}\n  ],\n  \"all_ok\": true\n}\n```\n\n| Exit | `all_ok` | Meaning |\n|------|----------|---------|\n| 0 | `true` | All checks passed — ready to translate |\n| 2 | `false` | At least one check failed — inspect `checks[].ok` |\n\n**When a check fails**, `help_url` in the failing check points to the fix:\n- `api_key.ok:false` → set `TRANS_API_KEY` (see Configuration below)\n- `account.ok:false` → key invalid/expired or quota exhausted\n\nRun `trans doctor --json` as the first step when diagnosing any trans-cli failure.\n\n---\n\n## JSON Contract\n\n**Success** (stdout, exit 0):\n```json\n{\"from\":\"zh\",\"to\":\"en\",\"source\":\"你好\",\"translated\":\"Hello\"}\n```\n\n| Field | Note |\n|-------|------|\n| `from` | API-detected language — may differ from `--from auto` |\n| `to` | Target language |\n| `source` | Original input |\n| `translated` | Result |\n\n**Error** (stderr, exit ≠ 0):\n```json\n{\"code\":\"AUTH_FAILED\",\"message\":\"…\",\"help_url\":\"https://…\",\"raw_code\":\"52001\"}\n```\n\n`help_url` and `raw_code` are omitted when not applicable.\n\n---\n\n## Error Decision Tree\n\n| Exit | `code` | Cause | Action |\n|------|--------|-------|--------|\n"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7fhw0h9fm3z24r13j111w56583yfp7\",\n  \"slug\": \"baidu-text-translate\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1777433285140\n}"},{"path":"skill-card.md","content":"## Description:\n\nTranslate text using Baidu AI Translation API via trans-cli with Baidu-specific language codes, API key management, error handling, and environment diagnostics.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[baidu-translate](https://clawhub.ai/user/baidu-translate)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agents use this skill to translate text with Baidu's trans-cli, diagnose API key and account readiness, choose Baidu-specific language codes, and respond to translation errors.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Translated text is sent to Baidu's external translation service.\n\nMitigation: Avoid translating secrets, credentials, private documents, or regulated data unless that data sharing has been approved.\n\nRisk: The skill depends on installing and running the external @bdtrans/trans-cli npm package.\n\nMitigation: Review the npm package and version before installation, especially in sensitive environments.\n\nRisk: The Baidu API key may be exposed through unsafe shell history, config files, or prompts.\n\nMitigation: Prefer TRANS_API_KEY or carefully managed config storage and do not paste credentials into translated text.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/baidu-translate/skills/baidu-text-translate)\n- [Baidu Translate](https://fanyi.baidu.com)\n- [Baidu Translation Open Platform](https://fanyi-api.baidu.com/)\n- [Baidu Developer Center](https://fanyi-api.baidu.com/manage/developer)\n- [Baidu API Key Management](https://fanyi-api.baidu.com/manage/apiKey)\n- [Baidu Account Recharge](https://fanyi-api.baidu.com/manage/account)\n- [Baidu Translation Usage Details](https://fanyi-api.baidu.com/api/trans/user/usage)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown with inline shell commands and JSON examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Guidance centers on trans-cli JSON output, exit codes, language codes, API key setup, and environment diagnostics.]\n\n## Skill Version(s):\n\n1.0.1 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Translate text using Baidu AI Translation API via trans-cli with Baidu-specific language codes, API key management, error handling, and environment diagnostics. Skill: Baidu Text Translate Owner: baidu-translate Summary: Translate text using Baidu AI Translation API via trans-cli with Baidu-specific language codes, API key management, error handling, and environment diagnostics. Tags: latest:1.0.1 Version history: v1.0.1 | 2026-04-29T03:28:05.140Z | user - Added required TRANS_API_KEY environment variable to skill metadata. - No other changes to skill logic or documentation.","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1064,"uniquenessScore":48,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T14:20:09.282Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-10T14:20:09.282Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T17:36:55.850Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}