HamzaHassanain / HamzaHassanain/polyman
Add Shell Auto-Completion Support
- Dominant language
- TypeScript
- Stars
- 35
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
Description
Add shell auto-completion scripts for bash, zsh, and fish to improve developer experience and command discoverability. Users should be able to tab-complete commands, options, testset names, solution names, and other context-aware arguments.
Features
Command Completion:
```bash
polyman gen → polyman generate
polyman rem → polyman remote
```
Option Completion:
```bash
polyman generate --
→ --all --testset --group --index
polyman remote push --
→ --all --solutions --checker --validator --tests
```
Context-Aware Completion:
```bash
# Complete testset names from Config.json
polyman generate -t
→ tests samples pretests
# Complete solution names from Config.json
polyman run
→ main correct2 wa-solution tle-solution
# Complete generator names
polyman generate -t tests -g
→ samples main stress
```
Implementation Approach
Using commander-completion
```ts
import completion from 'commander-completion';
program
.command('completion')
.description('Generate shell completion script')
.action(() => {
completion(program);
});
```
**Success Criteria**
- Completion works for all shells (bash, zsh, fish)
- Static command/option completion works
- Dynamic completion reads Config.json
- Handles missing Config.json gracefully (fallback to static completion)
- Installation instructions in README
- Auto-suggest during npm install -g polyman-cli
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.