[feature request] Alias for parent command should apply to subcommands
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
```js
prog
.command('foo')
.describe('Top level command')
.alias('f')
.action(() => console.log('see `app foo --help`'))
prog
.command('foo bar')
.describe('A subcommand')
.action(() => console.log('did a thing'))
prog
.command('foo baz ')
.describe('Another subcommand')
.action((a) => console.log('did another thing', a))
```
Given the above, each of the following should work:
+ `prog foo`
+ `prog foo bar`
+ `prog foo baz 1`
+ `prog f`
+ `prog f bar`
+ `prog f baz 1`
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing command parsing and alias handling in the CLI entry point, then check how subcommands are resolved beneath a parent command. The change is complete when both the original command and its alias execute the parent and each listed subcommand, including the argument-taking command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100