-
Notifications
You must be signed in to change notification settings - Fork 966
feat(cli): add plx command alias and rebrand as OpenSplx #375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add `plx` as an alias command alongside `openspec` - Create OpenSplx pixel art logo assets (light/dark themes) - Update README with fork notice and Quick Start section - Make CLI command name dynamic based on invocation - Update completion system to support both command names - Add command-name utility for detecting invoked command
|
Caution Review failedThe pull request is closed. WalkthroughThis PR adds support for an alternative CLI command alias "plx" alongside the existing "openspec" command. It introduces command name detection utilities, updates the CLI entry points, and parameterizes the completion generation system to support dynamic command names. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds the plx command alias to the OpenSpec CLI and rebrands the fork as OpenSplx. The implementation introduces dynamic command name detection that allows both openspec and plx commands to work identically by detecting which command was used to invoke the CLI and adjusting output accordingly.
- Adds command name detection utility that determines whether CLI was invoked via
plxoropenspec - Updates Zsh completion generator to support dynamic command names in generated scripts
- Adds new
plxbinary entry point alongside existingopenspeccommand
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
bin/plx.js |
New binary entry point that loads the CLI, enabling plx command invocation |
package.json |
Adds plx bin entry to make the new command available after installation |
src/utils/command-name.ts |
New utility that detects command name from process.argv path |
src/cli/index.ts |
Updates CLI program name to use detected command name dynamically |
src/commands/completion.ts |
Updates completion command to pass detected command name to generators and use it in messages |
src/core/completions/types.ts |
Updates CompletionGenerator interface to accept optional commandName parameter |
src/core/completions/generators/zsh-generator.ts |
Updates all generated completion script elements to use dynamic command name |
scripts/postinstall.js |
Adds getCommandName function and updates messages to mention both commands |
test/core/completions/generators/zsh-generator.test.ts |
Fixes test expectation to match lowercase command name in comment |
README.md |
Adds fork notice, feature comparison table, and OpenSplx quick start instructions |
assets/opensplx_pixel_light.svg |
New pixel art logo for light mode |
assets/opensplx_pixel_dark.svg |
New pixel art logo for dark mode |
Comments suppressed due to low confidence (1)
scripts/postinstall.js:24
- Unused function getCommandName.
function getCommandName() {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function getCommandName() { | ||
| const scriptPath = process.argv[1] || ''; | ||
| const scriptName = path.basename(scriptPath).replace(/\.js$/, ''); | ||
| // Default to 'openspec' for postinstall context | ||
| return scriptName === 'plx' ? 'plx' : 'openspec'; | ||
| } |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The getCommandName() function is defined but never used in this script. During postinstall, the completion script should be generated with the appropriate command name. Line 91 calls generator.generate(COMMAND_REGISTRY) without passing a commandName parameter, which will default to 'openspec'. This means the installed completions will only work for the openspec command, not for plx.
| function getCommandName() { | ||
| const scriptPath = process.argv[1] || ''; | ||
| const scriptName = path.basename(scriptPath).replace(/\.js$/, ''); | ||
| // Default to 'openspec' for postinstall context | ||
| return scriptName === 'plx' ? 'plx' : 'openspec'; | ||
| } |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a postinstall context, this function will almost always return 'openspec' since the script is being executed by npm during installation. The logic to detect 'plx' from the script name won't work in this context. Consider if this function serves any useful purpose during postinstall, or if a different approach is needed to handle command name detection during installation.
| if (!skipConfirmation) { | ||
| const confirmed = await confirm({ | ||
| message: 'Remove OpenSpec configuration from ~/.zshrc?', | ||
| message: `Remove ${commandName} configuration from ~/.zshrc?`, |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The confirmation message is hardcoded to mention ~/.zshrc, but this function accepts a shell parameter that could potentially support other shells in the future. Consider making this message dynamic to reference the shell being uninstalled from, e.g., Remove ${commandName} configuration from ${shell} configuration?
| message: `Remove ${commandName} configuration from ~/.zshrc?`, | |
| message: `Remove ${commandName} configuration from ${shell} configuration?`, |
Summary
plxas an alias command for all OpenSpec commandsplxandopenspeccommands work identicallyChanges
assets/opensplx_pixel_light.svg,assets/opensplx_pixel_dark.svgplxbin entry topackage.jsonbin/plx.jsentry pointsrc/utils/command-name.tsfor dynamic command detectionTest plan
plx --versionoutputs versionplx --helpshows "plx" as command nameopenspec --versionstill worksplx completion generate zshgenerates correct completionsSummary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.