Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@

### Patch Changes

- fix: resolve catalog protocol references for npm compatibility
- Add scripts/resolve-catalog.mjs to convert pnpm catalog references to actual versions
- Update prepublishOnly script to automatically resolve catalogs before publishing
- Fixes EUNSUPPORTEDPROTOCOL error when using npx zcf-tw

## 3.3.1

### Patch Changes

- Add Traditional Chinese (zh-TW) output-styles templates
- Add 4 output-style templates for Claude Code (zh-TW)
- Add 4 system-prompt templates for Codex (zh-TW)
- Full translation from zh-CN to zh-TW with preserved technical terms

## 3.3.1

### Patch Changes

- ## New Features
- Add configuration copy functionality for easier profile duplication
- Support model configuration editing in profile management
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
> **📢 Note**: This is a fork with Traditional Chinese (zh-TW) support. A [Pull Request](https://github.com/UfoMiao/zcf/pulls) has been submitted to the [original project](https://github.com/UfoMiao/zcf). This package (`zcf-tw`) serves as a temporary solution for Traditional Chinese users until the PR is merged.
>
> **📢 注意**:這是一個支援繁體中文(zh-TW)的分支版本。已向[原專案](https://github.com/UfoMiao/zcf)提交 [Pull Request](https://github.com/UfoMiao/zcf/pulls)。本套件 (`zcf-tw`) 作為過渡方案,供繁體中文使用者使用,直到 PR 被合併。

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
Expand All @@ -14,7 +18,7 @@
</h1>

<p align="center">
<b>English</b> | <a href="README_zh-CN.md">中文</a> | <a href="README_ja-JP.md">日本語</a> | <a href="CHANGELOG.md">Changelog</a>
<b>English</b> | <a href="README_zh-CN.md">简体中文</a> | <a href="README_zh-TW.md">繁體中文</a> | <a href="README_ja-JP.md">日本語</a> | <a href="CHANGELOG.md">Changelog</a>

**✨ Quick Links**: [Codex Support](#-codex-support-v300-new) | [BMad Workflow](#-bmad-workflow-v27-new-feature) | [Spec Workflow](#-spec-workflow-v2124-new-feature) | [Open Web Search](#-open-web-search-v2129-new-feature) | [CCR Router](#-ccr-claude-code-router-support-v28-enhanced) | [CCometixLine](#-ccometixline-support-status-bar-tool-v299-new) | [Output Styles](#-ai-output-styles-v212-new-feature) | [Multi-Configuration Management](#-multi-configuration-management-v320-new)

Expand Down
2 changes: 1 addition & 1 deletion README_ja-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</h1>

<p align="center">
<a href="README.md">English</a> | <a href="README_zh-CN.md">中文</a> | <b>日本語</b> | <a href="CHANGELOG.md">更新履歴</a>
<a href="README.md">English</a> | <a href="README_zh-CN.md">简体中文</a> | <a href="README_zh-TW.md">繁體中文</a> | <b>日本語</b> | <a href="CHANGELOG.md">更新履歴</a>

**✨ クイックリンク**: [Codexサポート](#-codexサポートv300新機能) | [BMadワークフロー](#-bmadワークフローv27新機能) | [Specワークフロー](#-specワークフローv2124新機能) | [Open Web Search](#-open-web-searchv2129新機能) | [CCRルーター](#-ccr-claude-code-router-サポートv28強化版) | [CCometixLine](#-ccometixlineサポートステータスバーツールv299新機能) | [出力スタイル](#-ai出力スタイルv212新機能) | [多設定管理](#-多設定管理v320-新機能)

Expand Down
2 changes: 1 addition & 1 deletion README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</h1>

<p align="center">
<a href="README.md">English</a> | <b>中文</b> | <a href="README_ja-JP.md">日本語</a> | <a href="CHANGELOG.md">更新日志</a>
<a href="README.md">English</a> | <b>简体中文</b> | <a href="README_zh-TW.md">繁體中文</a> | <a href="README_ja-JP.md">日本語</a> | <a href="CHANGELOG.md">更新日志</a>

**✨ 快速导航**: [Codex 支持](#-codex-支持v300-新增) | [BMad 工作流](#-bmad-工作流v27-新功能) | [Spec 工作流](#-spec-工作流v2124-新功能) | [开放网页搜索](#-开放网页搜索v2129-新功能) | [CCR 代理](#-ccr-claude-code-router-支持v28-增强版) | [CCometixLine](#-ccometixline-支持状态栏工具v299-新增) | [输出风格](#-ai-输出风格v212-新功能) | [多配置管理](#-多配置管理v320-新增)

Expand Down
1,003 changes: 1,003 additions & 0 deletions README_zh-TW.md

Large diffs are not rendered by default.

29 changes: 17 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "zcf",
"name": "zcf-tw",
"type": "module",
"version": "3.3.1",
"version": "3.3.1-tw.4",
"packageManager": "[email protected]",
"description": "Zero-Config Code Flow - One-click configuration tool for Claude Code",
"description": "ZCF with Traditional Chinese support - 繁體中文增強版 | Zero-Config Code Flow - One-click configuration tool for Claude Code",
"author": {
"name": "Miao Da",
"email": "[email protected]",
"url": "https://github.com/WitMiao"
"name": "TaichiS",
"email": "[email protected]",
"url": "https://github.com/TaichiS"
},
"license": "MIT",
"homepage": "https://github.com/UfoMiao/zcf",
"homepage": "https://github.com/TaichiS/zcf",
"repository": {
"type": "git",
"url": "git+https://github.com/UfoMiao/zcf.git"
"url": "git+https://github.com/TaichiS/zcf.git"
},
"bugs": "https://github.com/UfoMiao/zcf/issues",
"bugs": "https://github.com/TaichiS/zcf/issues",
"keywords": [
"claude",
"claude-code",
Expand All @@ -27,7 +27,12 @@
"anthropic",
"ai",
"automation",
"mcp"
"mcp",
"traditional-chinese",
"zh-TW",
"taiwan",
"繁體中文",
"台灣"
],
"main": "dist/index.mjs",
"module": "dist/index.mjs",
Expand All @@ -45,7 +50,7 @@
"build": "unbuild",
"start": "node bin/zcf.mjs",
"typecheck": "tsc --noEmit",
"prepublishOnly": "pnpm build",
"prepublishOnly": "node scripts/resolve-catalog.mjs && pnpm build",
"lint": "eslint",
"lint:fix": "eslint --fix",
"test": "vitest",
Expand All @@ -56,7 +61,7 @@
"changeset": "changeset",
"version": "changeset version",
"update:deps": "pnpx taze major -r -w",
"release": "pnpm build && changeset publish",
"release": "pnpm build && pnpm changeset publish",
"prepare": "husky",
"commitlint": "commitlint",
"commitlint:check": "commitlint --from HEAD~1 --to HEAD --verbose"
Expand Down
94 changes: 94 additions & 0 deletions scripts/resolve-catalog.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/usr/bin/env node

import { readFileSync, writeFileSync } from 'node:fs'
import { resolve } from 'node:path'

// Hardcoded catalog mappings from pnpm-workspace.yaml
const catalogs = {
build: {
'@antfu/eslint-config': '^5.4.1',
'eslint': '^9.36.0',
'eslint-plugin-format': '^1.0.2',
'tsx': '^4.20.5',
'typescript': '^5.9.2',
'unbuild': '^3.6.1',
},
cli: {
ansis: '^4.1.0',
cac: '^6.7.14',
inquirer: '^12.9.6',
ora: '^9.0.0',
},
runtime: {
'dayjs': '^1.11.18',
'find-up-simple': '^1.0.1',
'fs-extra': '^11.3.2',
'i18next': '^25.5.2',
'i18next-fs-backend': '^2.6.0',
'pathe': '^2.0.3',
'semver': '^7.7.2',
'smol-toml': '^1.4.2',
'tinyexec': '^1.0.1',
'trash': '^10.0.0',
},
testing: {
'@vitest/coverage-v8': '^3.2.4',
'@vitest/ui': '^3.2.4',
'glob': '^11.0.3',
'vitest': '^3.2.4',
},
tooling: {
'@changesets/cli': '^2.29.7',
'@commitlint/cli': '^19.8.1',
'@commitlint/config-conventional': '^19.8.1',
'@commitlint/types': '^19.8.1',
'husky': '^9.1.7',
'lint-staged': '^16.2.0',
},
types: {
'@types/fs-extra': '^11.0.4',
'@types/inquirer': '^9.0.9',
'@types/node': '^22.18.6',
'@types/semver': '^7.7.1',
},
}

// Read package.json
const packageJsonPath = resolve('package.json')
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'))

// Function to resolve catalog references
function resolveCatalog(deps) {
if (!deps)
return deps

const resolved = {}
for (const [name, version] of Object.entries(deps)) {
if (typeof version === 'string' && version.startsWith('catalog:')) {
const catalogName = version.replace('catalog:', '')
const catalog = catalogs[catalogName]
if (catalog && catalog[name]) {
resolved[name] = catalog[name]
console.log(`✓ Resolved ${name}: catalog:${catalogName} → ${catalog[name]}`)
}
else {
console.warn(`⚠️ Could not resolve ${name} from catalog:${catalogName}`)
resolved[name] = version
}
}
else {
resolved[name] = version
}
}
return resolved
}

// Resolve dependencies
console.log('\n📦 Resolving catalog references...\n')
packageJson.dependencies = resolveCatalog(packageJson.dependencies)
packageJson.devDependencies = resolveCatalog(packageJson.devDependencies)

// Write resolved package.json
writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`)

console.log('\n✅ Resolved all catalog references in package.json\n')
26 changes: 13 additions & 13 deletions src/cli-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ export function customizeHelp(sections: any[]): any[] {
sections.push({
title: ansis.yellow(i18n.t('cli:help.options')),
body: [
` ${ansis.green('--lang, -l')} <lang> ${i18n.t('cli:help.optionDescriptions.displayLanguage')} (zh-CN, en)`,
` ${ansis.green('--config-lang, -c')} <lang> ${i18n.t('cli:help.optionDescriptions.configurationLanguage')} (zh-CN, en)`,
` ${ansis.green('--lang, -l')} <lang> ${i18n.t('cli:help.optionDescriptions.displayLanguage')} (zh-CN, zh-TW, en)`,
` ${ansis.green('--config-lang, -c')} <lang> ${i18n.t('cli:help.optionDescriptions.configurationLanguage')} (zh-CN, zh-TW, en)`,
` ${ansis.green('--force, -f')} ${i18n.t('cli:help.optionDescriptions.forceOverwrite')}`,
` ${ansis.green('--help, -h')} ${i18n.t('cli:help.optionDescriptions.displayHelp')}`,
` ${ansis.green('--version, -v')} ${i18n.t('cli:help.optionDescriptions.displayVersion')}`,
Expand Down Expand Up @@ -221,9 +221,9 @@ export async function setupCommands(cli: CAC): Promise<void> {
// Default command - show menu
cli
.command('', 'Show interactive menu (default)')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, en)')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, zh-TW, en)')
.option('--all-lang, -g <lang>', 'Set all language parameters to this value')
.option('--config-lang, -c <lang>', 'Configuration language (zh-CN, en)')
.option('--config-lang, -c <lang>', 'Configuration language (zh-CN, zh-TW, en)')
.option('--force, -f', 'Force overwrite existing configuration')
.option('--code-type, -T <codeType>', 'Select code tool type (claude-code, codex, cc, cx)')
.action(await withLanguageResolution(async (options) => {
Expand All @@ -234,8 +234,8 @@ export async function setupCommands(cli: CAC): Promise<void> {
cli
.command('init', 'Initialize Claude Code configuration')
.alias('i')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, en)')
.option('--config-lang, -c <lang>', 'Configuration language (zh-CN, en)')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, zh-TW, en)')
.option('--config-lang, -c <lang>', 'Configuration language (zh-CN, zh-TW, en)')
.option('--ai-output-lang, -a <lang>', 'AI output language')
.option('--force, -f', 'Force overwrite existing configuration')
.option('--skip-prompt, -s', 'Skip all interactive prompts (non-interactive mode)')
Expand Down Expand Up @@ -263,17 +263,17 @@ export async function setupCommands(cli: CAC): Promise<void> {
cli
.command('update', 'Update Claude Code prompts only')
.alias('u')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, en)')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, zh-TW, en)')
.option('--all-lang, -g <lang>', 'Set all language parameters to this value')
.option('--config-lang, -c <lang>', 'Configuration language (zh-CN, en)')
.option('--config-lang, -c <lang>', 'Configuration language (zh-CN, zh-TW, en)')
.action(await withLanguageResolution(async (options) => {
await update(options)
}))

// CCR command - Configure Claude Code Router
cli
.command('ccr', 'Configure Claude Code Router for model proxy')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, en)')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, zh-TW, en)')
.option('--all-lang, -g <lang>', 'Set all language parameters to this value')
.action(await withLanguageResolution(async () => {
await ccr()
Expand All @@ -282,7 +282,7 @@ export async function setupCommands(cli: CAC): Promise<void> {
// CCU command - Claude Code usage analysis
cli
.command('ccu [...args]', 'Run Claude Code usage analysis tool')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, en)')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, zh-TW, en)')
.option('--all-lang, -g <lang>', 'Set all language parameters to this value')
.allowUnknownOptions()
.action(await withLanguageResolution(async (args) => {
Expand All @@ -294,7 +294,7 @@ export async function setupCommands(cli: CAC): Promise<void> {
.command('config-switch [target]', 'Switch Codex provider or Claude Code configuration, or list available configurations')
.alias('cs')
.option('--code-type, -T <type>', 'Code tool type (claude-code, codex, cc, cx)')
.option('--lang <lang>', 'ZCF display language (zh-CN, en)')
.option('--lang <lang>', 'ZCF display language (zh-CN, zh-TW, en)')
.option('--all-lang, -g <lang>', 'Set all language parameters to this value')
.option('--list, -l', 'List available configurations')
.action(await withLanguageResolution(async (target, options) => {
Expand All @@ -308,7 +308,7 @@ export async function setupCommands(cli: CAC): Promise<void> {
// Uninstall command - Remove ZCF configurations and tools
cli
.command('uninstall', 'Remove ZCF configurations and tools')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, en)')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, zh-TW, en)')
.option('--all-lang, -g <lang>', 'Set all language parameters to this value')
.option('--mode, -m <mode>', 'Uninstall mode (complete/custom/interactive), default: interactive')
.option('--items, -i <items>', 'Comma-separated items for custom uninstall mode')
Expand All @@ -320,7 +320,7 @@ export async function setupCommands(cli: CAC): Promise<void> {
cli
.command('check-updates', 'Check and update Claude Code and CCR to latest versions')
.alias('check')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, en)')
.option('--lang, -l <lang>', 'ZCF display language (zh-CN, zh-TW, en)')
.option('--all-lang, -g <lang>', 'Set all language parameters to this value')
.option('--code-type, -T <codeType>', 'Select code tool type (claude-code, codex, cc, cx)')
.action(await withLanguageResolution(async (options) => {
Expand Down
4 changes: 3 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,21 @@ export function resolveCodeToolType(value: unknown): CodeToolType {
return DEFAULT_CODE_TOOL_TYPE
}

export const SUPPORTED_LANGS = ['zh-CN', 'en'] as const
export const SUPPORTED_LANGS = ['zh-CN', 'zh-TW', 'en'] as const
export type SupportedLang = (typeof SUPPORTED_LANGS)[number]

// Dynamic language labels using i18n
// This will be replaced with a function that uses i18n to get labels
export const LANG_LABELS = {
'zh-CN': '简体中文',
'zh-TW': '繁體中文',
'en': 'English',
} as const

// AI output languages - labels are now retrieved via helper function
export const AI_OUTPUT_LANGUAGES = {
'zh-CN': { directive: 'Always respond in Chinese-simplified' },
'zh-TW': { directive: 'Always respond in Chinese-traditional' },
'en': { directive: 'Always respond in English' },
'custom': { directive: '' },
} as const
Expand Down
53 changes: 53 additions & 0 deletions src/i18n/locales/zh-TW/api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"apiConfigAuthType": "認證類型",
"apiConfigKey": "Key",
"apiConfigSuccess": "API 設定完成",
"apiConfigUrl": "URL",
"modelConfigSuccess": "API 模型設定完成",
"primaryModel": "主模型",
"fastModel": "快速模型",
"apiKeyDesc": "適用於從 Anthropic Console 獲取的 API 金鑰",
"apiKeyValidation.example": "示例格式: sk-abcdef123456_789xyz",
"authTokenDesc": "適用於通過 OAuth 或瀏覽器登入獲取的令牌",
"configureApi": "選擇 API 認證方式",
"enterApiKey": "請輸入 API Key",
"enterApiUrl": "請輸入 API URL",
"enterAuthToken": "請輸入 Auth Token",
"enterNewApiKey": "請輸入新的 API Key(當前:{key})",
"enterNewApiUrl": "請輸入新的 API URL(當前:{url})",
"existingApiConfig": "檢測到已有 API 設定:",
"invalidKeyFormat": "無效的金鑰格式",
"invalidUrl": "無效的 URL",
"keepExistingConfig": "保留現有設定",
"keyRequired": "金鑰為必填項",
"modificationSaved": "設定已儲存",
"modifyAllConfig": "修改全部設定",
"modifyApiKey": "修改 API Key",
"modifyApiUrl": "修改 API URL",
"modifyAuthType": "修改認證類型",
"modifyPartialConfig": "修改部分設定",

"selectApiMode": "請選擇 API 設定模式",
"selectCustomConfigAction": "請選擇自訂設定操作",
"selectModifyItems": "請選擇要修改的項",
"selectNewAuthType": "選擇新的認證類型(當前:{type})",
"skipApi": "跳過(稍後手動設定)",
"customApiConfig": "自訂 API 設定",
"urlRequired": "URL 為必填項",
"useApiKey": "使用 API Key (金鑰認證)",
"useAuthToken": "使用 Auth Token (OAuth 認證)",
"useCcrProxy": "使用 CCR 代理",
"useOfficialLogin": "使用官方登入",
"officialLoginConfigured": "已切換到官方登入模式",
"officialLoginFailed": "切換到官方登入模式失敗",
"apiModeOfficial": "使用官方登入(不設定 API)",
"apiModeCustom": "自訂 API 設定",
"apiModeCcr": "使用CCR代理",
"apiModeSwitch": "切換 API 設定",
"apiModeSkip": "跳過",
"apiModePrompt": "請選擇 API 設定模式",
"selectApiProvider": "請選擇 API 供應商",
"customProvider": "自訂設定",
"providerSelected": "已選擇供應商: {{name}}",
"enterProviderApiKey": "請輸入 {{provider}} 的 API Key"
}
Loading