Skip to content

Commit 03138da

Browse files
docs: update --help text for Lingo.dev CLI (#1177)
1 parent c0a72fe commit 03138da

23 files changed

Lines changed: 156 additions & 86 deletions

File tree

.changeset/cli-command-docs.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"lingo.dev": patch
3+
---
4+
5+
Improve CLI command descriptions

packages/cli/src/cli/cmd/auth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import { createAuthenticator } from "../utils/auth";
55

66
export default new Command()
77
.command("auth")
8-
.description("Show current authentication status")
8+
.description("Show current authentication status and user email")
99
.helpOption("-h, --help", "Show help")
1010
// Deprecated options, safe to remove after September 2025
1111
.option(
1212
"--login",
13-
"Login to your account (deprecated: use 'lingo.dev login' instead)",
13+
"DEPRECATED: Shows deprecation warning and exits. Use `lingo.dev login` instead",
1414
)
1515
.option(
1616
"--logout",
17-
"Logout from your account (deprecated: use 'lingo.dev logout' instead)",
17+
"DEPRECATED: Shows deprecation warning and exits. Use `lingo.dev logout` instead",
1818
)
1919
.action(async (options) => {
2020
try {

packages/cli/src/cli/cmd/ci/index.ts

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,37 @@ interface CIOptions {
2020

2121
export default new Command()
2222
.command("ci")
23-
.description("Run Lingo.dev CI/CD action")
23+
.description("Run localization pipeline in CI/CD environment")
2424
.helpOption("-h, --help", "Show help")
25-
.option("--parallel [boolean]", "Run in parallel mode", parseBooleanArg)
26-
.option("--api-key <key>", "API key")
25+
.option(
26+
"--parallel [boolean]",
27+
"Process translations concurrently for faster execution. Defaults to false",
28+
parseBooleanArg,
29+
)
30+
.option(
31+
"--api-key <key>",
32+
"Override API key from settings or environment variables",
33+
)
2734
.option(
2835
"--pull-request [boolean]",
29-
"Create a pull request with the changes",
36+
"Create or update translations on a dedicated branch and manage pull requests automatically. When false, commits directly to current branch. Defaults to false",
3037
parseBooleanArg,
3138
)
32-
.option("--commit-message <message>", "Commit message")
33-
.option("--pull-request-title <title>", "Pull request title")
34-
.option("--working-directory <dir>", "Working directory")
39+
.option(
40+
"--commit-message <message>",
41+
"Commit message for localization changes. Defaults to 'feat: update translations via @lingodotdev'",
42+
)
43+
.option(
44+
"--pull-request-title <title>",
45+
"Title for the pull request when using --pull-request mode. Defaults to 'feat: update translations via @lingodotdev'",
46+
)
47+
.option(
48+
"--working-directory <dir>",
49+
"Directory to run localization from (useful for monorepos where localization files are in a subdirectory)",
50+
)
3551
.option(
3652
"--process-own-commits [boolean]",
37-
"Process commits made by this action",
53+
"Allow processing commits made by this CI user (bypasses infinite loop prevention)",
3854
parseBooleanArg,
3955
)
4056
.action(async (options: CIOptions) => {

packages/cli/src/cli/cmd/cleanup.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,24 @@ import { getBuckets } from "../utils/buckets";
1010
export default new Command()
1111
.command("cleanup")
1212
.description(
13-
"Remove keys from target files that do not exist in the source file",
13+
"Remove translation keys from target locales that no longer exist in the source locale",
1414
)
1515
.helpOption("-h, --help", "Show help")
16-
.option("--locale <locale>", "Specific locale to cleanup")
17-
.option("--bucket <bucket>", "Specific bucket to cleanup")
18-
.option("--dry-run", "Show what would be removed without making changes")
16+
.option(
17+
"--locale <locale>",
18+
"Limit cleanup to a specific target locale from i18n.json. Defaults to all configured target locales",
19+
)
20+
.option(
21+
"--bucket <bucket>",
22+
"Limit cleanup to a specific bucket type defined under `buckets` in i18n.json",
23+
)
24+
.option(
25+
"--dry-run",
26+
"Preview which keys would be deleted without making any changes",
27+
)
1928
.option(
2029
"--verbose",
21-
"Show detailed output including:\n" +
22-
" - List of keys that would be removed.\n" +
23-
" - Processing steps.",
30+
"Print detailed output showing the specific keys to be removed for each locale",
2431
)
2532
.action(async function (options) {
2633
const ora = Ora();

packages/cli/src/cli/cmd/config/get.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ import dedent from "dedent";
66

77
export default new Command()
88
.name("get")
9-
.description("Get the value of a configuration key")
9+
.description("Display the value of a CLI setting from ~/.lingodotdevrc")
1010
.addHelpText("afterAll", `\nAvailable keys:\n ${SETTINGS_KEYS.join("\n ")}`)
11-
.argument("<key>", "Configuration key")
11+
.argument(
12+
"<key>",
13+
"Configuration key to read (choose from the available keys listed below)",
14+
)
1215
.helpOption("-h, --help", "Show help")
1316
.action(async (key: string) => {
1417
// Validate that the provided key is one of the recognised configuration keys.

packages/cli/src/cli/cmd/config/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import getCmd from "./get";
66

77
export default new Command()
88
.command("config")
9-
.description("Manage Lingo.dev CLI configuration")
9+
.description(
10+
"Manage CLI settings (authentication, API keys) stored in ~/.lingodotdevrc",
11+
)
1012
.helpOption("-h, --help", "Show help")
1113
.addCommand(setCmd)
1214
.addCommand(unsetCmd)

packages/cli/src/cli/cmd/config/set.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ import {
1010

1111
export default new Command()
1212
.name("set")
13-
.description("Set a configuration key to a value")
13+
.description("Set or update a CLI setting in ~/.lingodotdevrc")
1414
.addHelpText("afterAll", `\nAvailable keys:\n ${SETTINGS_KEYS.join("\n ")}`)
15-
.argument("<key>", "Configuration key to set")
16-
.argument("<value>", "New value")
15+
.argument(
16+
"<key>",
17+
"Configuration key to set (dot notation, e.g., auth.apiKey)",
18+
)
19+
.argument("<value>", "The configuration value to set")
1720
.helpOption("-h, --help", "Show help")
1821
.action(async (key: string, value: string) => {
1922
if (!SETTINGS_KEYS.includes(key)) {

packages/cli/src/cli/cmd/config/unset.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ import {
1010

1111
export default new Command()
1212
.name("unset")
13-
.description("Remove a configuration key")
13+
.description("Remove a CLI setting from ~/.lingodotdevrc")
1414
.addHelpText("afterAll", `\nAvailable keys:\n ${SETTINGS_KEYS.join("\n ")}`)
15-
.argument("<key>", "Configuration key to remove")
15+
.argument(
16+
"<key>",
17+
"Configuration key to remove (must match one of the available keys listed below)",
18+
)
1619
.helpOption("-h, --help", "Show help")
1720
.action(async (key: string) => {
1821
// Validate key first (defensive; choices() should already restrict but keep for safety).

packages/cli/src/cli/cmd/i18n.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,53 +39,55 @@ import { createDeltaProcessor } from "../utils/delta";
3939

4040
export default new Command()
4141
.command("i18n")
42-
.description("Run Localization engine")
42+
.description(
43+
"DEPRECATED: Run localization pipeline (prefer `run` command instead)",
44+
)
4345
.helpOption("-h, --help", "Show help")
4446
.option(
4547
"--locale <locale>",
46-
"Locale to process",
48+
"Limit processing to the listed target locale codes from i18n.json. Repeat the flag to include multiple locales. Defaults to all configured target locales",
4749
(val: string, prev: string[]) => (prev ? [...prev, val] : [val]),
4850
)
4951
.option(
5052
"--bucket <bucket>",
51-
"Bucket to process",
53+
"Limit processing to specific bucket types defined in i18n.json (e.g., json, yaml, android). Repeat the flag to include multiple bucket types. Defaults to all buckets",
5254
(val: string, prev: string[]) => (prev ? [...prev, val] : [val]),
5355
)
5456
.option(
5557
"--key <key>",
56-
"Key to process. Process only a specific translation key, useful for debugging or updating a single entry",
58+
"Limit processing to a single translation key by exact match. Filters all buckets and locales to process only this key, useful for testing or debugging specific translations. Example: auth.login.title",
5759
)
5860
.option(
5961
"--file [files...]",
60-
"File to process. Process only a specific path, may contain asterisk * to match multiple files. Useful if you have a lot of files and want to focus on a specific one. Specify more files separated by commas or spaces.",
62+
"Filter processing to only buckets whose file paths contain these substrings. Example: 'components' to process only files in components directories",
6163
)
6264
.option(
6365
"--frozen",
64-
`Run in read-only mode - fails if any translations need updating, useful for CI/CD pipelines to detect missing translations`,
66+
"Validate translations are up-to-date without making changes - fails if source files, target files, or lockfile are out of sync. Ideal for CI/CD to ensure translation consistency before deployment",
6567
)
6668
.option(
6769
"--force",
68-
"Ignore lockfile and process all keys, useful for full re-translation",
70+
"Force re-translation of all keys, bypassing change detection. Useful when you want to regenerate translations with updated AI models or translation settings",
6971
)
7072
.option(
7173
"--verbose",
72-
"Show detailed output including intermediate processing data and API communication details",
74+
"Print the translation data being processed as formatted JSON for each bucket and locale",
7375
)
7476
.option(
7577
"--interactive",
76-
"Enable interactive mode for reviewing and editing translations before they are applied",
78+
"Review and edit AI-generated translations interactively before applying changes to files",
7779
)
7880
.option(
7981
"--api-key <api-key>",
80-
"Explicitly set the API key to use, override the default API key from settings",
82+
"Override API key from settings or environment variables",
8183
)
8284
.option(
8385
"--debug",
84-
"Pause execution at start for debugging purposes, waits for user confirmation before proceeding",
86+
"Pause before processing localization so you can attach a debugger",
8587
)
8688
.option(
8789
"--strict",
88-
"Stop processing on first error instead of continuing with other locales/buckets",
90+
"Stop immediately on first error instead of continuing to process remaining buckets and locales (fail-fast mode)",
8991
)
9092
.action(async function (options) {
9193
updateGitignore();

packages/cli/src/cli/cmd/init.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,21 @@ const throwHelpError = (option: string, value: string) => {
3636

3737
export default new InteractiveCommand()
3838
.command("init")
39-
.description("Initialize Lingo.dev project")
39+
.description("Create i18n.json configuration file for a new project")
4040
.helpOption("-h, --help", "Show help")
4141
.addOption(
42-
new InteractiveOption("-f --force", "Overwrite existing config")
42+
new InteractiveOption(
43+
"-f --force",
44+
"Overwrite existing Lingo.dev configuration instead of aborting initialization (destructive operation)",
45+
)
4346
.prompt(undefined)
4447
.default(false),
4548
)
4649
.addOption(
47-
new InteractiveOption("-s --source <locale>", "Source locale")
50+
new InteractiveOption(
51+
"-s --source <locale>",
52+
"Primary language of your application that content will be translated from. Defaults to 'en'",
53+
)
4854
.argParser((value) => {
4955
try {
5056
resolveLocaleCode(value as LocaleCode);
@@ -56,7 +62,10 @@ export default new InteractiveCommand()
5662
.default("en"),
5763
)
5864
.addOption(
59-
new InteractiveOption("-t --targets <locale...>", "List of target locales")
65+
new InteractiveOption(
66+
"-t --targets <locale...>",
67+
"Target languages to translate to. Accepts locale codes like 'es', 'fr', 'de-AT' separated by commas or spaces. Defaults to 'es'",
68+
)
6069
.argParser((value) => {
6170
const values = (
6271
value.includes(",") ? value.split(",") : value.split(" ")
@@ -73,7 +82,10 @@ export default new InteractiveCommand()
7382
.default("es"),
7483
)
7584
.addOption(
76-
new InteractiveOption("-b, --bucket <type>", "Type of bucket")
85+
new InteractiveOption(
86+
"-b, --bucket <type>",
87+
"File format for your translation files. Must match a supported type such as json, yaml, or android",
88+
)
7789
.argParser((value) => {
7890
if (!bucketTypes.includes(value as (typeof bucketTypes)[number])) {
7991
throwHelpError("bucket format", value);
@@ -85,7 +97,7 @@ export default new InteractiveCommand()
8597
.addOption(
8698
new InteractiveOption(
8799
"-p, --paths [path...]",
88-
"List of paths for the bucket",
100+
"File paths containing translations when using --no-interactive mode. Specify paths with [locale] placeholder, separated by commas or spaces",
89101
)
90102
.argParser((value) => {
91103
if (!value || value.length === 0) return [];

0 commit comments

Comments
 (0)