CLI

# CLI reference

The lingo command — subcommands, shared options, and exit codes.

## Shape

lingo <command> [options]

The canonical form is a subcommand followed by options. With no command, `lingo` prints `status`.

```ruby
lingo status                    # translation status per locale
lingo translate --locale de     # translate missing / changed keys
lingo validate --strict         # CI gate (exit 1 on strict-tier issues)
lingo quality --ai              # quality linting + optional AI pass
lingo fix-quality --locale en   # auto-fix the fixable issues
lingo accept-edits --locale de  # mark current translations as intentional
lingo sync                      # rebuild drift state from current files
lingo hash                      # source-translation fingerprint
```

Each command is described in detail on the [Commands](https://locallingo.zoolutions.llc/docs/commands) page.

## Shared options

| Option | Meaning |
| --- | --- |
| `-l`, `--locale LOCALE` | Restrict to a single target locale |
| `-f`, `--force` | Re-translate all keys (not just missing/changed) |
| `--force-key KEY` | Re-translate one specific key (repeatable) |
| `-v`, `--verbose` | Verbose logging |
| `-n`, `--dry-run` | Show what would happen without writing files |
| `--strict` | Fail on the strict-tier violation types |
| `--strict-all` | Fail on the strict-all-tier violation types |
| `--ai` | Use the AI pass for quality suggestions |
| `--json` | Emit machine-readable JSON |
| `--package PATH` | Scope to a package from `.locallingo.yml` |
| `-h`, `--help` | Show help |

## Legacy flag aliases

If you're migrating from a `bin/translate` script, the old `--flag` command forms still work — they print a one-line deprecation notice and map onto the new subcommands, so you can move CI and docs over incrementally.

```ruby
--status       → status
--translate    → translate
--validate     → validate
--check-quality → quality
--fix-quality  → fix-quality
--sync-state   → sync
```

## Exit codes

`validate` is the only command that sets a failing exit code, and only under `--strict` / `--strict-all`. It returns `1` when any violation whose type is listed in the matching `strict` tier is present, and `0` otherwise — so it slots straight into a CI step.