feat(cli): add t and w aliases for translate and write - #110
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
tandwas short aliases fortranslateandwrite, 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--helpautomatically (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 descriptiondocs/API.mdsynopses for translate/write show the alias form; README quick-start gets adeepl texample; CHANGELOG entry under AddedDesign decision
wis 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) ands(sync) were considered and deferred:vreads 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
wdispatch proven to invoke the write action; completion generator alias output asserted for all three shellscli-aliases.e2e.test.ts, 10 tests):t --help/w --helprender the aliased command's help; alias dispatch reaches command-specific validation (--tm-threshold,--formatchoices); unknown-option failures have identical exit codes via alias and full name; top-level--helplists both aliases; bash/zsh/fish completions offer themtranslate|t [options] [text])Backward Compatibility
✅ Purely additive — no existing command, flag, or output changes. Ships in any 2.x minor.
🤖 Generated with Claude Code