Skip to content

feat(cli): add t and w aliases for translate and write - #110

Merged
sjsyrek merged 1 commit into
mainfrom
feat/t-w-aliases
Jul 29, 2026
Merged

feat(cli): add t and w aliases for translate and write#110
sjsyrek merged 1 commit into
mainfrom
feat/t-w-aliases

Conversation

@sjsyrek

@sjsyrek sjsyrek commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds t and w as short aliases for translate and write, the two most-used commands — community request #12.

Changes Made

  • register-translate.ts / register-write.ts — one-line .alias() on each command registration; commander surfaces the aliases in --help automatically (translate|t, write|w)
  • completion.ts — the shell-completion generator now includes command aliases as top-level completions in bash/zsh/fish, and resolves alias names back to the aliased command so zsh/fish show the real description
  • Docsdocs/API.md synopses for translate/write show the alias form; README quick-start gets a deepl t example; CHANGELOG entry under Added

Design decision

w is deliberately assigned to write over watch: write is a primary API feature, watch a workflow helper. Reassigning a shipped alias later would be a breaking change, so this is worth a conscious call now. v (voice) and s (sync) were considered and deferred: v reads like a version query and voice is not a hot path; sync lives mostly in CI scripts where spelled-out commands are preferable. Adding aliases later is additive (minor bump), so deferral costs nothing.

Test Coverage

  • Unit: alias registration asserted for both commands; w dispatch proven to invoke the write action; completion generator alias output asserted for all three shells
  • E2E (cli-aliases.e2e.test.ts, 10 tests): t --help/w --help render the aliased command's help; alias dispatch reaches command-specific validation (--tm-threshold, --format choices); unknown-option failures have identical exit codes via alias and full name; top-level --help lists both aliases; bash/zsh/fish completions offer them
  • One existing integration assertion updated for the new usage line (translate|t [options] [text])

Backward Compatibility

✅ Purely additive — no existing command, flag, or output changes. Ships in any 2.x minor.

🤖 Generated with Claude Code

Community request #12. The aliases show up in --help and
in bash/zsh/fish completion output; the completion generator now walks
command aliases and resolves alias names back to the aliased command for
descriptions. w is deliberately assigned to write over watch — write is
a primary API feature, watch a workflow helper — and v/s aliases were
considered and deferred.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sjsyrek
sjsyrek merged commit a70aee5 into main Jul 29, 2026
5 checks passed
@sjsyrek
sjsyrek deleted the feat/t-w-aliases branch July 29, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant