champollion 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +133 -0
- package/README.md +387 -0
- package/bin/cli.js +278 -0
- package/index.js +135 -0
- package/lib/api-key.js +127 -0
- package/lib/autofix.js +432 -0
- package/lib/bridge/method_bridge.py +430 -0
- package/lib/card-source-resolution.mjs +284 -0
- package/lib/cards/cache.js +169 -0
- package/lib/cards/env.js +82 -0
- package/lib/cards/fetch-card-child.js +38 -0
- package/lib/cards/reader.js +435 -0
- package/lib/cards/refresh.js +111 -0
- package/lib/cards/remote.js +387 -0
- package/lib/cldf-export.mjs +540 -0
- package/lib/cldf-terms.mjs +62 -0
- package/lib/command-help.js +790 -0
- package/lib/commands/audit.js +49 -0
- package/lib/commands/card.js +454 -0
- package/lib/commands/doctor.js +559 -0
- package/lib/commands/fonts.js +489 -0
- package/lib/commands/help.js +91 -0
- package/lib/commands/init.js +1259 -0
- package/lib/commands/integrity.js +148 -0
- package/lib/commands/leaderboard.js +478 -0
- package/lib/commands/lint.js +30 -0
- package/lib/commands/models.js +177 -0
- package/lib/commands/plugin.js +103 -0
- package/lib/commands/provenance.js +45 -0
- package/lib/commands/recommend.js +75 -0
- package/lib/commands/register-corpus.js +678 -0
- package/lib/commands/repair-script.js +42 -0
- package/lib/commands/seal-corpus.js +355 -0
- package/lib/commands/seo.js +72 -0
- package/lib/commands/serve.js +147 -0
- package/lib/commands/status.js +265 -0
- package/lib/commands/submit.js +332 -0
- package/lib/commands/sync.js +89 -0
- package/lib/commands/tm.js +573 -0
- package/lib/commands/verify.js +39 -0
- package/lib/commands/watch.js +20 -0
- package/lib/commands/wrap.js +138 -0
- package/lib/commands/xliff.js +327 -0
- package/lib/commercial-eligibility.js +235 -0
- package/lib/concurrent.js +87 -0
- package/lib/config.js +523 -0
- package/lib/contamination-lane.js +76 -0
- package/lib/content-sync.js +731 -0
- package/lib/content.js +733 -0
- package/lib/corpus-registration.mjs +608 -0
- package/lib/cost-report.js +346 -0
- package/lib/diff.js +155 -0
- package/lib/docusaurus-sync.js +1256 -0
- package/lib/flatten.js +55 -0
- package/lib/format.js +954 -0
- package/lib/hash.js +159 -0
- package/lib/icu.js +473 -0
- package/lib/integrity.js +689 -0
- package/lib/license-gate.mjs +478 -0
- package/lib/license-identify.mjs +229 -0
- package/lib/lint.js +629 -0
- package/lib/method-manifest.js +60 -0
- package/lib/methods/anthropic.js +140 -0
- package/lib/methods/apertium.js +163 -0
- package/lib/methods/api.js +316 -0
- package/lib/methods/base.js +184 -0
- package/lib/methods/content-separator.js +45 -0
- package/lib/methods/deepl.js +426 -0
- package/lib/methods/direct-llm.js +586 -0
- package/lib/methods/external.js +332 -0
- package/lib/methods/fetch-with-retry.js +124 -0
- package/lib/methods/gemini.js +147 -0
- package/lib/methods/google-translate.js +402 -0
- package/lib/methods/http-utils.js +122 -0
- package/lib/methods/libretranslate.js +314 -0
- package/lib/methods/llm-coached.js +670 -0
- package/lib/methods/llm.js +592 -0
- package/lib/methods/local.js +76 -0
- package/lib/methods/microsoft-translator.js +331 -0
- package/lib/methods/openai.js +131 -0
- package/lib/methods/openrouter-client.js +327 -0
- package/lib/methods/openrouter-pricing.js +156 -0
- package/lib/methods/provider-env.js +115 -0
- package/lib/methods/provider-pricing.js +310 -0
- package/lib/methods/tilde.js +150 -0
- package/lib/methods/translated.js +229 -0
- package/lib/methods/translation-error.js +80 -0
- package/lib/models.js +258 -0
- package/lib/no-translate.js +233 -0
- package/lib/output.js +238 -0
- package/lib/pairs.js +547 -0
- package/lib/plugins.js +447 -0
- package/lib/provenance.js +323 -0
- package/lib/recommend.js +648 -0
- package/lib/registers.js +1185 -0
- package/lib/repair-script.js +266 -0
- package/lib/scripts.js +994 -0
- package/lib/seal.mjs +464 -0
- package/lib/sealed-qualifier.mjs +211 -0
- package/lib/security.js +59 -0
- package/lib/segment.js +369 -0
- package/lib/seo.js +275 -0
- package/lib/serve.js +854 -0
- package/lib/string-classify.js +85 -0
- package/lib/submit.mjs +344 -0
- package/lib/sync.js +969 -0
- package/lib/tags/bcp47.js +202 -0
- package/lib/tags/resolve.js +314 -0
- package/lib/terminology.js +111 -0
- package/lib/tm-seed.js +294 -0
- package/lib/tm.js +515 -0
- package/lib/translate-pair.js +197 -0
- package/lib/translate.js +203 -0
- package/lib/types.js +230 -0
- package/lib/validate.js +510 -0
- package/lib/verify.js +451 -0
- package/lib/watch.js +145 -0
- package/lib/xliff.js +184 -0
- package/package.json +93 -0
- package/shared/ATTRIBUTION.md +145 -0
- package/shared/CORPORA-CARDS.md +288 -0
- package/shared/DATA-SOVEREIGNTY.md +500 -0
- package/shared/LANGUAGE-CARD-FIELDS.md +532 -0
- package/shared/card-lint-baseline.json +3189 -0
- package/shared/cards-fallback.json +1 -0
- package/shared/catalogue/card-config.json +6091 -0
- package/shared/catalogue/external-results.json +3888 -0
- package/shared/catalogue/gender-guidance.json +1038 -0
- package/shared/catalogue/method-coverage.json +1751 -0
- package/shared/catalogue/metric-coverage.json +170 -0
- package/shared/catalogue/metric-reliability.json +1 -0
- package/shared/catalogue/register-presets.json +3180 -0
- package/shared/catalogue/vitality-scales.json +55 -0
- package/shared/cldr-index.json +1115 -0
- package/shared/code-bridge.json +253 -0
- package/shared/corpora-cards-v1-reference.md +281 -0
- package/shared/curated-dictionary-flags.json +35 -0
- package/shared/curated-endonyms.json +35 -0
- package/shared/curated-fsts.json +51 -0
- package/shared/curated-orthography-conventions.json +26 -0
- package/shared/curated-sil-resources.json +374 -0
- package/shared/curated-tools.json +41 -0
- package/shared/docent/corpus.json +11333 -0
- package/shared/docent/faq.en.json +564 -0
- package/shared/docent/register-blocks.json +60 -0
- package/shared/docent/system-prompt.md +144 -0
- package/shared/domain-taxonomy.json +35 -0
- package/shared/explainers/glossary.json +2975 -0
- package/shared/explainers/tc-features.json +20112 -0
- package/shared/explainers/term-watchlist.json +147 -0
- package/shared/human-services.json +59 -0
- package/shared/license-corrections.json +261 -0
- package/shared/license-evidence.json +13452 -0
- package/shared/licenses.json +6781 -0
- package/shared/method-registry.json +236 -0
- package/shared/metric-registry.json +620 -0
- package/shared/model-aliases.json +7 -0
- package/shared/schemas/champollion-plugin.schema.json +206 -0
- package/shared/schemas/corpora-card.schema.json +957 -0
- package/shared/schemas/domain-taxonomy.schema.json +64 -0
- package/shared/schemas/external-results.schema.json +314 -0
- package/shared/schemas/human-services.schema.json +90 -0
- package/shared/schemas/language-card.schema.json +1308 -0
- package/shared/schemas/licenses.schema.json +155 -0
- package/shared/schemas/method-card.schema.json +412 -0
- package/shared/schemas/method-registry.schema.json +85 -0
- package/shared/schemas/metric-registry.schema.json +96 -0
- package/shared/schemas/metric-reliability.schema.json +178 -0
- package/shared/schemas/model-aliases.schema.json +27 -0
- package/shared/schemas/source-snapshot.schema.json +96 -0
|
@@ -0,0 +1,790 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-command help text registry.
|
|
3
|
+
*
|
|
4
|
+
* Each command has a structured help entry with usage, description,
|
|
5
|
+
* options, and examples. The CLI dispatcher routes `champollion <cmd> --help`
|
|
6
|
+
* to display the relevant entry.
|
|
7
|
+
*
|
|
8
|
+
* WHY: The main `champollion help` screen is a dense overview of every command.
|
|
9
|
+
* Users running `champollion sync --help` expect focused, detailed help for
|
|
10
|
+
* that specific command, including all relevant flags and examples.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { DEFAULT_OPENROUTER_MODEL, DEFAULT_TEMPERATURE, DEFAULT_BATCH_SIZE } from './config.js';
|
|
14
|
+
|
|
15
|
+
const COMMAND_HELP = {
|
|
16
|
+
init: {
|
|
17
|
+
usage: 'champollion init [options]',
|
|
18
|
+
description: [
|
|
19
|
+
'Runs an interactive setup wizard to create champollion.config.json.',
|
|
20
|
+
'Guides you through target languages, registers (tone/formality),',
|
|
21
|
+
'translation method, and content directory.',
|
|
22
|
+
'In non-interactive environments (CI/piped stdin), or with --yes,',
|
|
23
|
+
'generates a default config without prompting. In interactive mode',
|
|
24
|
+
'the same flags prefill the wizard, so each step is Enter to accept.',
|
|
25
|
+
],
|
|
26
|
+
options: [
|
|
27
|
+
['--yes', 'Skip wizard, use defaults'],
|
|
28
|
+
['--force', 'Regenerate config even if one already exists (overwrites)'],
|
|
29
|
+
['--langs <codes>', 'Target languages, comma-separated (e.g., fr,de,ja); presets: european, asian, global, nordic'],
|
|
30
|
+
['--source <code>', 'Source locale (default: en)'],
|
|
31
|
+
['--dir <path>', 'Locales directory (default: ./locales)'],
|
|
32
|
+
['--method <name>', 'Translation method: llm, openai, anthropic, gemini, deepl, microsoft-translator, libretranslate, google-translate (default: llm = OpenRouter)'],
|
|
33
|
+
['--model <model>', `Translation model (default: ${DEFAULT_OPENROUTER_MODEL})`],
|
|
34
|
+
['--temperature <n>', `Sampling temperature, 0.0-1.0 (default: ${DEFAULT_TEMPERATURE})`],
|
|
35
|
+
['--format <fmt>', 'File format: auto, json, toml, yaml (default: auto)'],
|
|
36
|
+
],
|
|
37
|
+
examples: [
|
|
38
|
+
'champollion init # Interactive wizard',
|
|
39
|
+
'champollion init --langs fr,de,ja # Wizard with prefilled targets',
|
|
40
|
+
'champollion init --yes --langs fr,de,ja # Non-interactive, quick setup',
|
|
41
|
+
'champollion init --yes --langs fr,de --method deepl --temperature 0.2',
|
|
42
|
+
'champollion init --yes # Minimal config, auto-detect',
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
sync: {
|
|
47
|
+
usage: 'champollion sync [options]',
|
|
48
|
+
description: [
|
|
49
|
+
'Translates and syncs all locale files based on the project config.',
|
|
50
|
+
'Detects changed keys, batches them for translation, and writes',
|
|
51
|
+
'the results back to each locale file. Also syncs Hugo Markdown',
|
|
52
|
+
'content files when --content-dir is configured.',
|
|
53
|
+
],
|
|
54
|
+
options: [
|
|
55
|
+
['--dry', 'Preview changes without writing files'],
|
|
56
|
+
['--list-keys', 'With --dry: name every queued key, grouped by reason (missing / fallback / unstamped echo / changed / forced)'],
|
|
57
|
+
['--pair <src:tgt>', 'Only sync the named pair(s), comma-separated (e.g. en:fr). Unknown pairs fail loud'],
|
|
58
|
+
['--force', 'Re-queue EVERY source key — whole-locale rebuild. Scope with --pair; add --no-tm to also bypass the cache. TM hits are still served (and gate-checked), so an intact cache makes this cheap'],
|
|
59
|
+
['--force-keys <keys>', 'Comma-separated dot-notation keys to force re-translate'],
|
|
60
|
+
['--force-content', 'Ignore the content lock and re-process every champollion-managed content file (hand-translated files are still preserved). Content cached in the Translation Memory comes back as free hits; text the TM has never seen is re-billed'],
|
|
61
|
+
['--model <model>', 'Override translation model for this run'],
|
|
62
|
+
['--config <path>', 'Path to config file'],
|
|
63
|
+
['--dir <path>', 'Override locales directory'],
|
|
64
|
+
['--content-dir <p>', 'Hugo content directory for Markdown translation'],
|
|
65
|
+
['--source <code>', 'Override source locale (default: en)'],
|
|
66
|
+
['--format <fmt>', 'Locale file format: json, toml, yaml, auto'],
|
|
67
|
+
['--method <method>', 'Translation method: llm, llm-coached, google-translate, api, deepl, microsoft-translator, libretranslate, openai, anthropic, gemini (default: from config)'],
|
|
68
|
+
['--temperature <n>', `Sampling temperature for LLM methods (default: ${DEFAULT_TEMPERATURE})`],
|
|
69
|
+
['--batch-size <n>', `Keys per translation API call (positive integer, default: ${DEFAULT_BATCH_SIZE})`],
|
|
70
|
+
['--max-cost <usd>', 'Abort before any API call if the pre-run cost estimate exceeds this USD cap (exit 2; unknown estimates abort too — unknown is not free)'],
|
|
71
|
+
['--no-verify', 'Skip post-sync verification pass'],
|
|
72
|
+
['--no-tm', 'Skip Translation Memory cache (force fresh API calls for all keys)'],
|
|
73
|
+
['--json', 'Machine-readable NDJSON output (one JSON object per line)'],
|
|
74
|
+
['--quiet, -q', 'Suppress informational messages; show only warnings and errors'],
|
|
75
|
+
],
|
|
76
|
+
examples: [
|
|
77
|
+
'champollion sync # Standard sync',
|
|
78
|
+
'champollion sync --dry # Preview only',
|
|
79
|
+
'champollion sync --pair en:fr # Only the en:fr pair',
|
|
80
|
+
'champollion sync --force-keys hero.title # Re-translate specific keys',
|
|
81
|
+
'champollion sync --pair "en:tlh" --force # Rebuild one whole locale',
|
|
82
|
+
'champollion sync --pair "en:tlh" --force --no-tm # …bypassing a suspect cache',
|
|
83
|
+
'champollion sync --content-dir ./content # Include Hugo content',
|
|
84
|
+
'champollion sync --max-cost 0.50 # Refuse to spend more than $0.50',
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
serve: {
|
|
89
|
+
usage: 'champollion serve [options]',
|
|
90
|
+
description: [
|
|
91
|
+
'Serves this project\'s OWN configured translation stack (method,',
|
|
92
|
+
'registers, coaching, Translation Memory, quality gate) over HTTP,',
|
|
93
|
+
'speaking the same contract the `api` method consumes — so another',
|
|
94
|
+
'champollion project can point `method: "api"` at it. Requests run',
|
|
95
|
+
'through the exact pipeline `sync` uses: TM hits are served free from',
|
|
96
|
+
'cache, and quality-gate failures return structured per-key errors,',
|
|
97
|
+
'never silently degraded output.',
|
|
98
|
+
'',
|
|
99
|
+
'Binds to 127.0.0.1 by default: anyone who can reach the port can',
|
|
100
|
+
'spend your upstream API budget, so exposing the server is an explicit',
|
|
101
|
+
'decision (--bind 0.0.0.0) and requires a bearer token. --no-auth is',
|
|
102
|
+
'only accepted together with a loopback bind.',
|
|
103
|
+
],
|
|
104
|
+
options: [
|
|
105
|
+
['--port <n>', 'Listen port (default: 1822; 0 = random free port)'],
|
|
106
|
+
['--bind <addr>', 'Bind address (default: 127.0.0.1 — loopback only; --bind 0.0.0.0 exposes the server and requires a token)'],
|
|
107
|
+
['--token <secret>', 'Bearer token consumers must send (default: CHAMPOLLION_SERVE_TOKEN from env or .env.local; min 12 chars)'],
|
|
108
|
+
['--no-auth', 'Disable auth — refused unless --bind is loopback (127.0.0.1/::1/localhost)'],
|
|
109
|
+
['--rate-limit <n>', 'Requests per minute per client IP (default: 120; 0 disables)'],
|
|
110
|
+
['--max-body-bytes <n>', 'Request body size cap in bytes (default: 1000000)'],
|
|
111
|
+
['--max-cost-per-request <usd>', 'Refuse any request whose estimated upstream cost exceeds this cap (unknown pricing refuses too — unknown is not free)'],
|
|
112
|
+
['--max-session-cost <usd>', 'Cumulative estimated-spend ceiling for this server process; requests past it are refused (402)'],
|
|
113
|
+
['--name <kebab-case>', 'Served method name (default: derived from the project directory, e.g. my-project-serve)'],
|
|
114
|
+
['--pair <src:tgt>', 'Serve only the named configured pair(s), comma-separated'],
|
|
115
|
+
['--emit-manifest', 'Write the method.json plugin manifest a consumer installs, then exit (no server)'],
|
|
116
|
+
['--endpoint <url>', 'Consumer-reachable endpoint URL for --emit-manifest (default: http://127.0.0.1:<port>/translate)'],
|
|
117
|
+
['--out <path>', 'Where --emit-manifest writes (default: ./<name>/method.json)'],
|
|
118
|
+
['--quiet, -q', 'Suppress informational messages'],
|
|
119
|
+
],
|
|
120
|
+
examples: [
|
|
121
|
+
'CHAMPOLLION_SERVE_TOKEN=$(openssl rand -hex 24) champollion serve',
|
|
122
|
+
'champollion serve --token my-strong-secret --max-session-cost 5',
|
|
123
|
+
'champollion serve --no-auth --bind 127.0.0.1 # local-only, no token',
|
|
124
|
+
'champollion serve --emit-manifest --endpoint https://translate.example.org',
|
|
125
|
+
'champollion serve --pair en:crk --max-cost-per-request 0.25',
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
watch: {
|
|
130
|
+
usage: 'champollion watch [options]',
|
|
131
|
+
description: [
|
|
132
|
+
'Starts a file watcher that auto-syncs when the source locale',
|
|
133
|
+
'file changes. Runs until manually stopped (Ctrl+C).',
|
|
134
|
+
],
|
|
135
|
+
options: [
|
|
136
|
+
['--config <path>', 'Path to config file'],
|
|
137
|
+
['--dir <path>', 'Override locales directory'],
|
|
138
|
+
['--source <code>', 'Override source locale'],
|
|
139
|
+
],
|
|
140
|
+
examples: [
|
|
141
|
+
'champollion watch # Watch and auto-sync on changes',
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
audit: {
|
|
146
|
+
usage: 'champollion audit [options]',
|
|
147
|
+
description: [
|
|
148
|
+
'Lists all untranslated [EN] fallback values across locale files.',
|
|
149
|
+
'Returns exit code 1 if any untranslated keys exist — usable as',
|
|
150
|
+
'a CI gate to block deploys with missing translations.',
|
|
151
|
+
],
|
|
152
|
+
options: [
|
|
153
|
+
['--config <path>', 'Path to config file'],
|
|
154
|
+
['--dir <path>', 'Override locales directory'],
|
|
155
|
+
['--source <code>', 'Override source locale'],
|
|
156
|
+
['--format <fmt>', 'Locale file format: json, toml, yaml, auto'],
|
|
157
|
+
['--json', 'Machine-readable NDJSON output (one JSON object per line; summary carries the untranslated key list)'],
|
|
158
|
+
],
|
|
159
|
+
examples: [
|
|
160
|
+
'champollion audit # List untranslated keys',
|
|
161
|
+
'champollion audit && echo "All translated" # CI gate',
|
|
162
|
+
'champollion audit --json | jq \'select(.level=="summary")\'',
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
card: {
|
|
167
|
+
usage: 'champollion card <code> [options]',
|
|
168
|
+
description: [
|
|
169
|
+
'Pretty-prints a language card from the shared language-cards directory.',
|
|
170
|
+
'Shows identification, classification, speaker estimates, typology,',
|
|
171
|
+
'corpus availability, eval datasets, pipeline readiness, method support,',
|
|
172
|
+
'and data sources in a color-formatted terminal layout.',
|
|
173
|
+
'',
|
|
174
|
+
'Resolves aliases automatically (e.g., "fr" → "fra", "es" → "spa").',
|
|
175
|
+
],
|
|
176
|
+
options: [
|
|
177
|
+
['--json', 'Output the raw card JSON instead of the formatted display'],
|
|
178
|
+
],
|
|
179
|
+
examples: [
|
|
180
|
+
'champollion card crk # Plains Cree',
|
|
181
|
+
'champollion card spa # Spanish',
|
|
182
|
+
'champollion card cmn --json # Raw JSON for Mandarin',
|
|
183
|
+
'champollion card fr # French (resolves alias)',
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
'register-corpus': {
|
|
188
|
+
usage: 'champollion register-corpus [options]',
|
|
189
|
+
description: [
|
|
190
|
+
'Register a new evaluation corpus, choosing its license and exposure tier.',
|
|
191
|
+
'You control the license and how far the corpus travels — three exposure',
|
|
192
|
+
'tiers, defaulting to the most private:',
|
|
193
|
+
' local-only — never registered or uploaded; card + text stay on your machine.',
|
|
194
|
+
' private — register METADATA ONLY (WMT-style sovereign held-out set);',
|
|
195
|
+
' your text is never uploaded or hosted; you keep custody.',
|
|
196
|
+
' public — publish a metadata card + fetch-from-source pointer; text never',
|
|
197
|
+
' hosted by us, and gated to redistribution-cleared licenses.',
|
|
198
|
+
' sealed — encrypt the corpus ON YOUR DEVICE under the custodian group’s',
|
|
199
|
+
' threshold key; we receive ciphertext + a content-free card only',
|
|
200
|
+
' and cannot decrypt it. Paired with a public qualifier a method',
|
|
201
|
+
' must clear before any sealed run can be proposed.',
|
|
202
|
+
'',
|
|
203
|
+
'Champollion never reads, uploads, or hosts your corpus plaintext in ANY tier.',
|
|
204
|
+
'Interactive in a terminal; fully scriptable with flags (or --yes).',
|
|
205
|
+
],
|
|
206
|
+
options: [
|
|
207
|
+
['--tier <tier>', 'local-only | private | public | sealed (default: local-only). Alias: --exposure'],
|
|
208
|
+
['--license <id>', 'License key / SPDX id / list number (see --list)'],
|
|
209
|
+
['--name <text>', 'Corpus name (required)'],
|
|
210
|
+
['--pair <src>tgt>', 'Language pair, e.g. eng>crk (or --source-lang/--target-lang)'],
|
|
211
|
+
['--size <n>', 'Number of sentence pairs (required)'],
|
|
212
|
+
['--domain <text>', 'Domain: news, conversational, educational, … (required)'],
|
|
213
|
+
['--contamination <l>', 'NONE | LOW | MEDIUM | HIGH (default: NONE private / LOW public)'],
|
|
214
|
+
['--publisher <text>', 'Publisher / your name or org'],
|
|
215
|
+
['--repo-url <url>', 'Public tier: fetch-from-source archive/repo URL'],
|
|
216
|
+
['--source-url <url>', 'Public tier: canonical project/dataset URL'],
|
|
217
|
+
['--builder <id>', 'Public tier: builder adapter id (rebuilds from source)'],
|
|
218
|
+
['--seal-input <path>', 'Sealed tier: local corpus file to encrypt on-device'],
|
|
219
|
+
['--threshold-pubkey <k>', 'Sealed tier: custodian threshold public key (path / PEM / base64 DER)'],
|
|
220
|
+
['--custodian-group <id>', 'Sealed tier: custodian group id that holds the key'],
|
|
221
|
+
['--seal-out <path>', 'Sealed tier: where to write the ciphertext artifact'],
|
|
222
|
+
['--qualifier-id <id>', 'Sealed tier: paired public qualifier card id (vYYYY)'],
|
|
223
|
+
['--qualifier-threshold <n>', 'Sealed tier: score a method must clear on the qualifier'],
|
|
224
|
+
['--id <id>', 'Override the generated card id (eval-…)'],
|
|
225
|
+
['--out <dir>', 'local-only: where to write the card (default: cwd)'],
|
|
226
|
+
['--list', 'Print the license + tier catalog (add --json for JSON)'],
|
|
227
|
+
['--json', 'Machine-readable output (for agents)'],
|
|
228
|
+
['--yes', 'Non-interactive; take values from flags'],
|
|
229
|
+
],
|
|
230
|
+
examples: [
|
|
231
|
+
'champollion register-corpus # interactive wizard',
|
|
232
|
+
'champollion register-corpus --list # see licenses + tiers',
|
|
233
|
+
'champollion register-corpus --yes --name "My set" --pair "eng>crk" \\',
|
|
234
|
+
' --license cc-by-4.0 --tier local-only --size 200 --domain news',
|
|
235
|
+
'champollion register-corpus --yes --name "Holdout" --pair "eng>crk" \\',
|
|
236
|
+
' --license cc-by-nc-4.0 --tier private --size 500 --domain educational',
|
|
237
|
+
'champollion register-corpus --yes --name "Sealed" --pair "eng>crk" \\',
|
|
238
|
+
' --license proprietary --tier sealed --size 500 --domain educational \\',
|
|
239
|
+
' --seal-input ./secret.json --threshold-pubkey ./group.pub \\',
|
|
240
|
+
' --custodian-group nehiyawewin-trust --qualifier-id eval-eng-crk-…-qualifier-v2026',
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
'seal-corpus': {
|
|
245
|
+
usage: 'champollion seal-corpus <keygen|seal|open|sign-keygen|sign|verify> [options]',
|
|
246
|
+
description: [
|
|
247
|
+
'The crypto verbs around the sealed exposure tier (lib/seal.mjs is the one',
|
|
248
|
+
'cipher implementation: X25519-ECDH → HKDF-SHA256 → AES-256-GCM). Used by',
|
|
249
|
+
'contest organizers and by the mt-eval organizer node, which shells out here',
|
|
250
|
+
'rather than re-implementing the cipher.',
|
|
251
|
+
'',
|
|
252
|
+
' keygen — generate a WAVE-1 STAND-IN threshold keypair. Honest label: a',
|
|
253
|
+
' SINGLE keypair, not the Wave-2 M-of-N group key; whoever holds',
|
|
254
|
+
' the private-key file can decrypt alone.',
|
|
255
|
+
' seal — encrypt a corpus file on THIS machine; writes the ciphertext',
|
|
256
|
+
' artifact + the content-free card block. Plaintext never leaves.',
|
|
257
|
+
' open — decrypt a sealed artifact (the controlled-eval-context verb;',
|
|
258
|
+
' the organizer node decrypts to scratch, scores, then wipes).',
|
|
259
|
+
' sign-keygen / sign / verify — Ed25519 score-bundle signing for the',
|
|
260
|
+
' Phase-B airgap transport (mt-eval node export-scores / relay).',
|
|
261
|
+
' Honest label: a SINGLE node signing key, not steward custody.',
|
|
262
|
+
],
|
|
263
|
+
options: [
|
|
264
|
+
['--out <path>', 'keygen/sign-keygen: output dir; open: plaintext destination (scratch!)'],
|
|
265
|
+
['--seal-input <path>', 'seal: local corpus file to encrypt on-device'],
|
|
266
|
+
['--id <card-id>', 'seal: corpus card id (bound into the AAD)'],
|
|
267
|
+
['--custodian-group <id>', 'seal: opaque custodian group id (never a real org name pre-consent)'],
|
|
268
|
+
['--threshold-pubkey <k>', 'seal: recipient public key (file / PEM / base64 DER / keygen JSON)'],
|
|
269
|
+
['--seal-out <path>', 'seal: where to write the ciphertext artifact (off-git)'],
|
|
270
|
+
['--card-block-out <path>', 'seal: also write the content-free sealed card block JSON'],
|
|
271
|
+
['--qualifier-id <id>', 'seal: paired public qualifier card id (vYYYY)'],
|
|
272
|
+
['--qualifier-threshold <n>', 'seal: score a method must clear on the qualifier'],
|
|
273
|
+
['--key-scheme <label>', 'seal: custody label (default single-keypair-wave1 — honest)'],
|
|
274
|
+
['--artifact <path>', 'open: the sealed artifact JSON'],
|
|
275
|
+
['--privkey <k>', 'open/sign: private key (file / PEM / base64 DER / keygen JSON)'],
|
|
276
|
+
['--payload <path>', 'sign/verify: the exact bytes being signed / checked'],
|
|
277
|
+
['--sig-out <path>', 'sign: where to write the signature block JSON'],
|
|
278
|
+
['--sig <path>', 'verify: the signature block JSON'],
|
|
279
|
+
['--pubkey <k>', 'verify: Ed25519 public key (file / b64 / PEM)'],
|
|
280
|
+
],
|
|
281
|
+
examples: [
|
|
282
|
+
'champollion seal-corpus keygen --out ~/.contest-keys',
|
|
283
|
+
'champollion seal-corpus seal --seal-input ./refs.json --id eval-eng-xxx-blindtest-v1 \\',
|
|
284
|
+
' --custodian-group org-a1b2 --threshold-pubkey ~/.contest-keys/threshold-….pub.json \\',
|
|
285
|
+
' --seal-out ~/contest/refs.sealed.json --card-block-out ~/contest/sealed-block.json',
|
|
286
|
+
'champollion seal-corpus open --artifact ~/contest/refs.sealed.json \\',
|
|
287
|
+
' --privkey ~/.contest-keys/threshold-….key.json --out /tmp/scratch/refs.json',
|
|
288
|
+
'champollion seal-corpus sign-keygen --out ~/.contest-keys',
|
|
289
|
+
'champollion seal-corpus sign --payload score-bundle.json --privkey ~/.contest-keys/score-sign-….key.json',
|
|
290
|
+
'champollion seal-corpus verify --payload score-bundle.json --sig score-bundle.json.sig.json \\',
|
|
291
|
+
' --pubkey ~/.contest-keys/score-sign-….pub.json',
|
|
292
|
+
],
|
|
293
|
+
},
|
|
294
|
+
|
|
295
|
+
submit: {
|
|
296
|
+
usage: 'champollion submit [options]',
|
|
297
|
+
description: [
|
|
298
|
+
'Propose an entry for the Champollion index along a REVIEW-GATED path.',
|
|
299
|
+
'Gathers the fields for a chosen submission type and prints a PRE-FILLED',
|
|
300
|
+
'GitHub issue URL (optionally also writing a local submission JSON). The',
|
|
301
|
+
'GitHub issue is the human-review queue: a maintainer reviews every',
|
|
302
|
+
'submission against IP / license / sovereignty rules before adding it to a',
|
|
303
|
+
'source-of-truth. Nothing is auto-approved; this never writes a registry or DB.',
|
|
304
|
+
'',
|
|
305
|
+
'Six submission types:',
|
|
306
|
+
' dataset — a benchmark / corpus (metadata + fetch pointer only).',
|
|
307
|
+
' resource — a dictionary / archive / app / FST / tool (a pointer, not a copy).',
|
|
308
|
+
' method — a translation method / MT engine / LLM provider.',
|
|
309
|
+
' human-service — an opt-in human translation provider (contact PII stays out-of-band).',
|
|
310
|
+
' external-result — a published result from another system/paper (cited, never re-hosted).',
|
|
311
|
+
' card-correction — a fix to a language card (cited; applied at the data source).',
|
|
312
|
+
'',
|
|
313
|
+
'Interactive in a terminal; fully scriptable with flags (or --yes).',
|
|
314
|
+
],
|
|
315
|
+
options: [
|
|
316
|
+
['--type <key>', 'dataset | resource | method | human-service | external-result'],
|
|
317
|
+
['--values <json>', 'JSON object of field id -> value'],
|
|
318
|
+
['--field <id=val>', 'Set one field (repeatable): --field source-url=https://…'],
|
|
319
|
+
['--attest', 'Confirm the required compliance attestation (and consent)'],
|
|
320
|
+
['--consent', 'human-service: confirm the provider listing consent'],
|
|
321
|
+
['--out <path>', 'Also write a local content-free submission JSON'],
|
|
322
|
+
['--repo <url>', 'Override the GitHub repo for the issue URL (advanced/testing)'],
|
|
323
|
+
['--list', 'List the submission types (add --json for JSON)'],
|
|
324
|
+
['--json', 'Machine-readable output (for agents)'],
|
|
325
|
+
['--yes', 'Non-interactive; take values from flags'],
|
|
326
|
+
],
|
|
327
|
+
examples: [
|
|
328
|
+
'champollion submit # interactive wizard',
|
|
329
|
+
'champollion submit --list # see the submission types',
|
|
330
|
+
'champollion submit --yes --type dataset --attest \\',
|
|
331
|
+
' --field dataset-name="GlobalVoices eng-amh" --field pairs=eng-amh \\',
|
|
332
|
+
' --field license=CC-BY-4.0 --field source-url=https://globalvoices.org',
|
|
333
|
+
'champollion submit --yes --type external-result --attest --out ./submission.json \\',
|
|
334
|
+
' --values \'{"system-name":"NLLB-200","pairs":"eng-crk","dataset":"FLORES-200","metric":"chrF++","score":"28.4","citation":"https://arxiv.org/abs/2207.04672"}\'',
|
|
335
|
+
],
|
|
336
|
+
},
|
|
337
|
+
|
|
338
|
+
lint: {
|
|
339
|
+
usage: 'champollion lint [options]',
|
|
340
|
+
description: [
|
|
341
|
+
'Scans source files for hardcoded user-facing strings that should',
|
|
342
|
+
'be wrapped in t() calls. Returns exit code 1 if issues found',
|
|
343
|
+
'(unless --warn-only is set). Usable as a pre-commit hook.',
|
|
344
|
+
],
|
|
345
|
+
options: [
|
|
346
|
+
['--src <path>', 'Source directory to scan (auto-detected by default)'],
|
|
347
|
+
['--min-length <n>','Minimum string length to flag (default: 2)'],
|
|
348
|
+
['--warn-only', 'Exit 0 even if issues found'],
|
|
349
|
+
['--json', 'Machine-readable JSON output (single document with findings)'],
|
|
350
|
+
['--config <path>', 'Path to config file'],
|
|
351
|
+
],
|
|
352
|
+
examples: [
|
|
353
|
+
'champollion lint # Scan for hardcoded strings',
|
|
354
|
+
'champollion lint --warn-only # Non-blocking scan',
|
|
355
|
+
'champollion lint --src ./src --min-length 4',
|
|
356
|
+
'champollion lint --json | jq .findings # Structured findings',
|
|
357
|
+
],
|
|
358
|
+
},
|
|
359
|
+
|
|
360
|
+
wrap: {
|
|
361
|
+
usage: 'champollion wrap [options]',
|
|
362
|
+
description: [
|
|
363
|
+
'Auto-wraps hardcoded strings in t() calls. Creates a backup',
|
|
364
|
+
'before modifying files, with --undo support to restore.',
|
|
365
|
+
'',
|
|
366
|
+
'Safety gates: git-clean check, automatic backup, diff preview.',
|
|
367
|
+
],
|
|
368
|
+
options: [
|
|
369
|
+
['--dry', 'Preview changes without writing files'],
|
|
370
|
+
['--undo', 'Restore files from .champollion-backup/'],
|
|
371
|
+
['--src <path>', 'Source directory to process'],
|
|
372
|
+
['--min-length <n>','Minimum string length to wrap (default: 2)'],
|
|
373
|
+
['--config <path>', 'Path to config file'],
|
|
374
|
+
],
|
|
375
|
+
examples: [
|
|
376
|
+
'champollion wrap # Auto-wrap with backup',
|
|
377
|
+
'champollion wrap --dry # Preview wrapping changes',
|
|
378
|
+
'champollion wrap --undo # Restore from backup',
|
|
379
|
+
],
|
|
380
|
+
},
|
|
381
|
+
|
|
382
|
+
seo: {
|
|
383
|
+
usage: 'champollion seo <subcommand> [options]',
|
|
384
|
+
description: [
|
|
385
|
+
'Generates SEO artifacts for multilingual sites.',
|
|
386
|
+
],
|
|
387
|
+
subcommands: [
|
|
388
|
+
['hreflang', 'Generate <link rel="alternate" hreflang> tags'],
|
|
389
|
+
['sitemap', 'Generate multilingual sitemap.xml'],
|
|
390
|
+
['jsonld', 'Generate JSON-LD WebSite language schema'],
|
|
391
|
+
],
|
|
392
|
+
options: [
|
|
393
|
+
['--base-url <url>', 'Override site base URL (required for sitemap)'],
|
|
394
|
+
['--out <path>', 'Write output to file (sitemap only)'],
|
|
395
|
+
['--config <path>', 'Path to config file'],
|
|
396
|
+
],
|
|
397
|
+
examples: [
|
|
398
|
+
'champollion seo hreflang # Print hreflang tags',
|
|
399
|
+
'champollion seo sitemap --base-url https://example.com --out sitemap.xml',
|
|
400
|
+
'champollion seo jsonld --base-url https://example.com',
|
|
401
|
+
],
|
|
402
|
+
},
|
|
403
|
+
|
|
404
|
+
integrity: {
|
|
405
|
+
usage: 'champollion integrity [options]',
|
|
406
|
+
description: [
|
|
407
|
+
'Audits locale files for structural issues:',
|
|
408
|
+
' - Missing or extra placeholders ({name}, {count}, etc.)',
|
|
409
|
+
' - HTML tag mismatches',
|
|
410
|
+
' - Encoding problems (mojibake, BOM issues)',
|
|
411
|
+
' - Key structure drift between locales',
|
|
412
|
+
' - ICU MessageFormat plural category completeness',
|
|
413
|
+
'',
|
|
414
|
+
'Returns exit code 1 if issues found (unless --warn-only).',
|
|
415
|
+
],
|
|
416
|
+
options: [
|
|
417
|
+
['--warn-only', 'Exit 0 even if issues found'],
|
|
418
|
+
['--json', 'Machine-readable JSON output (single document, per-locale issue lists)'],
|
|
419
|
+
['--config <path>', 'Path to config file'],
|
|
420
|
+
['--dir <path>', 'Override locales directory'],
|
|
421
|
+
],
|
|
422
|
+
examples: [
|
|
423
|
+
'champollion integrity # Full integrity audit',
|
|
424
|
+
'champollion integrity --warn-only # Non-blocking audit',
|
|
425
|
+
'champollion integrity --json | jq .totalIssues',
|
|
426
|
+
],
|
|
427
|
+
},
|
|
428
|
+
|
|
429
|
+
'repair-script': {
|
|
430
|
+
usage: 'champollion repair-script [options]',
|
|
431
|
+
description: [
|
|
432
|
+
'Reverses script conversion that should never have happened.',
|
|
433
|
+
'',
|
|
434
|
+
'Before 0.3.0, locales with a script converter (tlh, x-elvish-s,',
|
|
435
|
+
'x-kryptonian) were converted to Private Use Area codepoints',
|
|
436
|
+
'unconditionally — text that renders as nothing without a purpose-built',
|
|
437
|
+
'font. This command scans locales whose configuration says conversion',
|
|
438
|
+
'is OFF, and restores any PUA values to the working script',
|
|
439
|
+
'(romanization) using the converter\'s own reverse table.',
|
|
440
|
+
'',
|
|
441
|
+
'Values without PUA are never touched. The Translation Memory and hash',
|
|
442
|
+
'manifest need no repair (the TM stores pre-conversion values). Locales',
|
|
443
|
+
'with conversion enabled ("script": "Piqd") are skipped — there the PUA',
|
|
444
|
+
'is the configured output.',
|
|
445
|
+
'',
|
|
446
|
+
'pIqaD reverses exactly. Tengwar and Kryptonian reversals cannot',
|
|
447
|
+
'recover capitalisation (the converters normalise case) — flagged',
|
|
448
|
+
'per file as case-lossy for review.',
|
|
449
|
+
'',
|
|
450
|
+
'Exit 1 when PUA remains that no registered converter can reverse.',
|
|
451
|
+
],
|
|
452
|
+
options: [
|
|
453
|
+
['--dry', 'Preview repairs without writing'],
|
|
454
|
+
['--locale <code>', 'Repair only one locale'],
|
|
455
|
+
['--json', 'Machine-readable JSON output (single document)'],
|
|
456
|
+
['--warn-only', 'Exit 0 even if unreversible PUA remains'],
|
|
457
|
+
['--config <path>', 'Path to config file'],
|
|
458
|
+
['--dir <path>', 'Override locales directory'],
|
|
459
|
+
],
|
|
460
|
+
examples: [
|
|
461
|
+
'champollion repair-script --dry # Preview what would be restored',
|
|
462
|
+
'champollion repair-script # Restore romanization in place',
|
|
463
|
+
'champollion repair-script --locale tlh # One locale only',
|
|
464
|
+
],
|
|
465
|
+
},
|
|
466
|
+
|
|
467
|
+
status: {
|
|
468
|
+
usage: 'champollion status [options]',
|
|
469
|
+
description: [
|
|
470
|
+
'Shows the project configuration summary:',
|
|
471
|
+
' - Resolved pair graph with methods and models',
|
|
472
|
+
' - Installed plugins with versions and benchmarks',
|
|
473
|
+
' - Translation cost estimates per pair',
|
|
474
|
+
' - Format and directory information',
|
|
475
|
+
],
|
|
476
|
+
options: [
|
|
477
|
+
['--config <path>', 'Path to config file'],
|
|
478
|
+
['--dir <path>', 'Override locales directory'],
|
|
479
|
+
['--json', 'Machine-readable JSON output (single document)'],
|
|
480
|
+
],
|
|
481
|
+
examples: [
|
|
482
|
+
'champollion status # Full project summary',
|
|
483
|
+
'champollion status --json | jq .pairs # Structured pair graph',
|
|
484
|
+
],
|
|
485
|
+
},
|
|
486
|
+
|
|
487
|
+
provenance: {
|
|
488
|
+
usage: 'champollion provenance [options]',
|
|
489
|
+
description: [
|
|
490
|
+
'Shows licensing and resource dependencies for all translation pairs.',
|
|
491
|
+
'Flags methods using non-commercial resources (PROPRIETARY datasets,',
|
|
492
|
+
'FST grammars, etc.) so you can verify compliance before shipping.',
|
|
493
|
+
],
|
|
494
|
+
options: [
|
|
495
|
+
['--config <path>', 'Path to config file'],
|
|
496
|
+
],
|
|
497
|
+
examples: [
|
|
498
|
+
'champollion provenance # Show all pair provenance',
|
|
499
|
+
],
|
|
500
|
+
},
|
|
501
|
+
|
|
502
|
+
plugin: {
|
|
503
|
+
usage: 'champollion plugin <subcommand> [options]',
|
|
504
|
+
description: [
|
|
505
|
+
'Manages method plugins — installable translation strategies',
|
|
506
|
+
'that bundle model config, coaching data, and benchmarks.',
|
|
507
|
+
],
|
|
508
|
+
subcommands: [
|
|
509
|
+
['list', 'List installed plugins with metadata'],
|
|
510
|
+
['install <path>', 'Install a plugin from a local directory'],
|
|
511
|
+
['remove <name>', 'Remove an installed plugin'],
|
|
512
|
+
],
|
|
513
|
+
options: [],
|
|
514
|
+
examples: [
|
|
515
|
+
'champollion plugin list # List plugins',
|
|
516
|
+
'champollion plugin install ./french-formal-v1/ # Install from dir',
|
|
517
|
+
'champollion plugin remove french-formal-v1 # Remove plugin',
|
|
518
|
+
],
|
|
519
|
+
},
|
|
520
|
+
|
|
521
|
+
fonts: {
|
|
522
|
+
usage: 'champollion fonts <subcommand> [options]',
|
|
523
|
+
description: [
|
|
524
|
+
'Downloads and manages PUA web fonts for constructed language',
|
|
525
|
+
'script converters. Klingon (pIqaD), Sindarin (Tengwar), and',
|
|
526
|
+
'Kryptonian output Private Use Area characters that need custom',
|
|
527
|
+
'fonts to render. This command downloads them from verified',
|
|
528
|
+
'open-source repositories with license attribution.',
|
|
529
|
+
'',
|
|
530
|
+
'Native Unicode converters (crk → Cree Syllabics, sr → Cyrillic)',
|
|
531
|
+
'do NOT need fonts installed — they use standard Unicode.',
|
|
532
|
+
],
|
|
533
|
+
subcommands: [
|
|
534
|
+
['list', 'Show which PUA fonts are needed and their install status'],
|
|
535
|
+
['install', 'Download fonts for configured languages'],
|
|
536
|
+
],
|
|
537
|
+
options: [
|
|
538
|
+
['--dir <path>', 'Override font output directory (auto-detected by default)'],
|
|
539
|
+
['--css', 'Also generate a CSS snippet file with @font-face declarations'],
|
|
540
|
+
['--config <path>', 'Path to config file (used to detect which languages need fonts)'],
|
|
541
|
+
],
|
|
542
|
+
examples: [
|
|
543
|
+
'champollion fonts list # Show needed fonts',
|
|
544
|
+
'champollion fonts install # Download all needed fonts',
|
|
545
|
+
'champollion fonts install --css # Also generate CSS snippet',
|
|
546
|
+
'champollion fonts install --dir ./public/fonts # Custom output directory',
|
|
547
|
+
],
|
|
548
|
+
},
|
|
549
|
+
|
|
550
|
+
tm: {
|
|
551
|
+
usage: 'champollion tm <subcommand> [options]',
|
|
552
|
+
description: [
|
|
553
|
+
'Manages the Translation Memory cache (.champollion/tm.json).',
|
|
554
|
+
'TM stores previous translations keyed by source text + locale + method.',
|
|
555
|
+
'On subsequent syncs, unchanged source values are served from cache',
|
|
556
|
+
'instead of calling the translation API — saving tokens and time.',
|
|
557
|
+
],
|
|
558
|
+
subcommands: [
|
|
559
|
+
['stats', 'Show entry count, file size, and per-locale breakdown'],
|
|
560
|
+
['clear', 'Delete TM cache (--locale for per-locale, --yes to skip prompt)'],
|
|
561
|
+
['seed', 'Back-fill the TM from existing translated content files (lock-gated; protects against a lost .champollion-content.lock)'],
|
|
562
|
+
['prune', 'Remove legacy entries missing locale/method metadata (and, with --older-than, stale ones); dry report unless --yes'],
|
|
563
|
+
],
|
|
564
|
+
options: [
|
|
565
|
+
['--locale <code>', 'Clear/seed only entries for a specific locale'],
|
|
566
|
+
['--yes', 'Skip confirmation prompt (clear); actually delete (prune)'],
|
|
567
|
+
['--dry, --dry-run', 'Show what seed would store without writing (seed)'],
|
|
568
|
+
['--older-than <days>', 'Also prune entries older than N days (prune)'],
|
|
569
|
+
['--json', 'Machine-readable JSON output, single document (stats, seed, prune)'],
|
|
570
|
+
],
|
|
571
|
+
examples: [
|
|
572
|
+
'champollion tm stats # Show cache statistics',
|
|
573
|
+
'champollion tm clear # Clear with confirmation',
|
|
574
|
+
'champollion tm clear --yes # Clear without confirmation',
|
|
575
|
+
'champollion tm clear --locale fr # Clear only French entries',
|
|
576
|
+
'champollion tm seed --dry-run # Preview what would be seeded',
|
|
577
|
+
'champollion tm seed # Seed TM from existing translations',
|
|
578
|
+
'champollion tm prune # Dry report of prunable entries',
|
|
579
|
+
'champollion tm prune --older-than 90 --yes # Delete legacy + >90-day entries',
|
|
580
|
+
],
|
|
581
|
+
},
|
|
582
|
+
|
|
583
|
+
xliff: {
|
|
584
|
+
usage: 'champollion xliff <subcommand> [options]',
|
|
585
|
+
description: [
|
|
586
|
+
'Exports and imports XLIFF 1.2 files for professional translator review.',
|
|
587
|
+
'XLIFF is the industry-standard exchange format for CAT tools like',
|
|
588
|
+
'memoQ, SDL Trados, and Phrase.',
|
|
589
|
+
],
|
|
590
|
+
subcommands: [
|
|
591
|
+
['export', 'Generate .xliff from source + target locale files'],
|
|
592
|
+
['import <file>', 'Merge reviewed .xliff translations into locale files (JSON, TOML, or YAML — written back in the project format)'],
|
|
593
|
+
],
|
|
594
|
+
options: [
|
|
595
|
+
['--locale <code>', 'Target locale for export (required)'],
|
|
596
|
+
['--out <path>', 'Custom output path or directory (export)'],
|
|
597
|
+
['--dry', 'Preview import without writing (import)'],
|
|
598
|
+
['--json', 'Machine-readable JSON output (single document)'],
|
|
599
|
+
['--config <path>', 'Path to config file'],
|
|
600
|
+
],
|
|
601
|
+
examples: [
|
|
602
|
+
'champollion xliff export --locale fr # Export French XLIFF',
|
|
603
|
+
'champollion xliff export --locale ja --out ./review/ # Custom output dir',
|
|
604
|
+
'champollion xliff import .champollion/xliff/fr.xliff # Import reviewed file',
|
|
605
|
+
'champollion xliff import ./reviewed.xliff --dry # Preview import',
|
|
606
|
+
],
|
|
607
|
+
},
|
|
608
|
+
|
|
609
|
+
models: {
|
|
610
|
+
usage: 'champollion models --method <provider>',
|
|
611
|
+
description: [
|
|
612
|
+
'Lists available models from a translation provider\'s API.',
|
|
613
|
+
'Queries the provider\'s live model endpoint and displays all',
|
|
614
|
+
'models you can use. Read-only — does not modify config.',
|
|
615
|
+
],
|
|
616
|
+
options: [
|
|
617
|
+
['--method <name>', 'Provider to query: gemini, openai, or anthropic (required)'],
|
|
618
|
+
['--json', 'Machine-readable JSON output (single document)'],
|
|
619
|
+
],
|
|
620
|
+
examples: [
|
|
621
|
+
'champollion models --method gemini # List Gemini models',
|
|
622
|
+
'champollion models --method openai # List OpenAI models',
|
|
623
|
+
'champollion models --method anthropic # List Anthropic models',
|
|
624
|
+
'champollion models --method gemini --json | jq .models',
|
|
625
|
+
],
|
|
626
|
+
},
|
|
627
|
+
|
|
628
|
+
verify: {
|
|
629
|
+
usage: 'champollion verify [options]',
|
|
630
|
+
description: [
|
|
631
|
+
'Re-reads all locale files from disk and verifies translations are',
|
|
632
|
+
'actually present and correct. Catches the gap between sync reporting',
|
|
633
|
+
'success and keys being wrong in fact.',
|
|
634
|
+
'',
|
|
635
|
+
'Checks: key parity, [EN] fallback markers, empty values, script',
|
|
636
|
+
'compliance, placeholder preservation, encoding issues, source echoes.',
|
|
637
|
+
'',
|
|
638
|
+
'Exits with code 1 if errors found — use as a CI gate.',
|
|
639
|
+
'This is the same verification that runs automatically after sync.',
|
|
640
|
+
],
|
|
641
|
+
options: [
|
|
642
|
+
['--warn-only', 'Exit 0 even if errors found'],
|
|
643
|
+
['--config <path>', 'Path to config file'],
|
|
644
|
+
['--dir <path>', 'Override locales directory'],
|
|
645
|
+
['--source <code>', 'Override source locale'],
|
|
646
|
+
],
|
|
647
|
+
examples: [
|
|
648
|
+
'champollion verify # Verify all locale files',
|
|
649
|
+
'champollion verify --warn-only # Non-blocking verification',
|
|
650
|
+
'champollion verify && echo "All good" # CI gate',
|
|
651
|
+
],
|
|
652
|
+
},
|
|
653
|
+
|
|
654
|
+
leaderboard: {
|
|
655
|
+
usage: 'champollion leaderboard [options]',
|
|
656
|
+
description: [
|
|
657
|
+
'Fetches and displays MT evaluation leaderboard data from Supabase.',
|
|
658
|
+
'Shows ranked results with composite scores, quality tiers, and metrics.',
|
|
659
|
+
'Supports filtering by language pair, sorting by any metric, and',
|
|
660
|
+
'NDJSON output for CI/CD integration.',
|
|
661
|
+
],
|
|
662
|
+
options: [
|
|
663
|
+
['--pair <pair>', 'Filter by language pair (e.g., en>crk)'],
|
|
664
|
+
['--sort <key>', 'Sort by metric: composite (default), chrf, exact, fst, equivalent, semantic, cost, date'],
|
|
665
|
+
['--top <n>', 'Show only the top N results'],
|
|
666
|
+
['--json', 'Machine-readable NDJSON output (one JSON object per line)'],
|
|
667
|
+
],
|
|
668
|
+
examples: [
|
|
669
|
+
'champollion leaderboard # All results, sorted by composite',
|
|
670
|
+
'champollion leaderboard --pair "en>crk" # Filter to English→Cree (quote the >)',
|
|
671
|
+
'champollion leaderboard --sort chrf --top 10 # Top 10 by chrF++',
|
|
672
|
+
'champollion leaderboard --json | jq .composite # Pipe to jq for processing',
|
|
673
|
+
],
|
|
674
|
+
},
|
|
675
|
+
|
|
676
|
+
recommend: {
|
|
677
|
+
usage: 'champollion recommend <src> <tgt> [options]',
|
|
678
|
+
description: [
|
|
679
|
+
'Method guidance for one source→target pair (ISO 639-3 codes): every',
|
|
680
|
+
'dispatchable engine with its live availability (API key present?',
|
|
681
|
+
'license lane?), the published evidence indexed for the pair (cited,',
|
|
682
|
+
'never reproduced by us; relative-comparison-only), and which evidenced',
|
|
683
|
+
'models are actually runnable here.',
|
|
684
|
+
'',
|
|
685
|
+
'Honest by construction: no evidence means it says so and points at',
|
|
686
|
+
'runnable corpora instead of guessing. The commercial lane is STRICT —',
|
|
687
|
+
'methods without a commercial-ready license (e.g. AGPL/GPL engines) are',
|
|
688
|
+
'excluded with reasons, never silently dropped.',
|
|
689
|
+
],
|
|
690
|
+
options: [
|
|
691
|
+
['--use <lane>', 'License lane: non-commercial (default) or commercial (STRICT)'],
|
|
692
|
+
['--json', 'Machine-readable payload (mirrors `mt-eval recommend --json`)'],
|
|
693
|
+
],
|
|
694
|
+
examples: [
|
|
695
|
+
'champollion recommend eng yor # Guidance for English→Yoruba',
|
|
696
|
+
'champollion recommend eng yor --use commercial # Commercial lane (AGPL excluded)',
|
|
697
|
+
'champollion recommend eng quy --json | jq .notes # Honest no-evidence state',
|
|
698
|
+
],
|
|
699
|
+
},
|
|
700
|
+
|
|
701
|
+
doctor: {
|
|
702
|
+
usage: 'champollion doctor [subcommand] [options]',
|
|
703
|
+
description: [
|
|
704
|
+
'Comprehensive system health check for Champollion installations.',
|
|
705
|
+
'Validates language cards, project config, FST installations,',
|
|
706
|
+
'API key configuration, and method dependencies.',
|
|
707
|
+
'',
|
|
708
|
+
'Runs all checks by default. Use subcommands for targeted diagnostics.',
|
|
709
|
+
],
|
|
710
|
+
subcommands: [
|
|
711
|
+
['cards', 'Verify language cards load correctly, report coverage stats'],
|
|
712
|
+
['config', 'Validate project config file and language code resolution'],
|
|
713
|
+
['fst [code]', 'Check FST installation (all or specific language)'],
|
|
714
|
+
['methods', 'Check API keys, server reachability, Python packages'],
|
|
715
|
+
],
|
|
716
|
+
options: [
|
|
717
|
+
['--json', 'Machine-readable JSON output (single document with all check results)'],
|
|
718
|
+
],
|
|
719
|
+
examples: [
|
|
720
|
+
'champollion doctor # Full system health check',
|
|
721
|
+
'champollion doctor cards # Language card diagnostics',
|
|
722
|
+
'champollion doctor config # Config validation',
|
|
723
|
+
'champollion doctor fst crk # Check Plains Cree FST',
|
|
724
|
+
'champollion doctor methods # Check API keys and deps',
|
|
725
|
+
'champollion doctor --json | jq .failed',
|
|
726
|
+
],
|
|
727
|
+
},
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* Format and print help for a specific command.
|
|
732
|
+
*
|
|
733
|
+
* @param {string} commandName - The command to show help for
|
|
734
|
+
* @returns {boolean} true if help was displayed, false if command not found
|
|
735
|
+
*/
|
|
736
|
+
function showCommandHelp(commandName) {
|
|
737
|
+
const help = COMMAND_HELP[commandName];
|
|
738
|
+
if (!help) return false;
|
|
739
|
+
|
|
740
|
+
console.log('');
|
|
741
|
+
console.log(` champollion ${commandName} — ${help.description[0]}`);
|
|
742
|
+
console.log('');
|
|
743
|
+
|
|
744
|
+
// Usage
|
|
745
|
+
console.log(' USAGE');
|
|
746
|
+
console.log(` ${help.usage}`);
|
|
747
|
+
console.log('');
|
|
748
|
+
|
|
749
|
+
// Description
|
|
750
|
+
if (help.description.length > 1) {
|
|
751
|
+
console.log(' DESCRIPTION');
|
|
752
|
+
for (const line of help.description) {
|
|
753
|
+
console.log(` ${line}`);
|
|
754
|
+
}
|
|
755
|
+
console.log('');
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
// Subcommands (for plugin, seo)
|
|
759
|
+
if (help.subcommands && help.subcommands.length > 0) {
|
|
760
|
+
console.log(' SUBCOMMANDS');
|
|
761
|
+
const maxLen = Math.max(...help.subcommands.map(([name]) => name.length));
|
|
762
|
+
for (const [name, desc] of help.subcommands) {
|
|
763
|
+
console.log(` ${name.padEnd(maxLen + 2)} ${desc}`);
|
|
764
|
+
}
|
|
765
|
+
console.log('');
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// Options
|
|
769
|
+
if (help.options && help.options.length > 0) {
|
|
770
|
+
console.log(' OPTIONS');
|
|
771
|
+
const maxLen = Math.max(...help.options.map(([flag]) => flag.length));
|
|
772
|
+
for (const [flag, desc] of help.options) {
|
|
773
|
+
console.log(` ${flag.padEnd(maxLen + 2)} ${desc}`);
|
|
774
|
+
}
|
|
775
|
+
console.log('');
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
// Examples
|
|
779
|
+
if (help.examples && help.examples.length > 0) {
|
|
780
|
+
console.log(' EXAMPLES');
|
|
781
|
+
for (const example of help.examples) {
|
|
782
|
+
console.log(` ${example}`);
|
|
783
|
+
}
|
|
784
|
+
console.log('');
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
return true;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
export { COMMAND_HELP, showCommandHelp };
|