Skip to content

Conversation

@appboypov
Copy link

@appboypov appboypov commented Dec 19, 2025

Summary

  • Adds plx as an alias command for all OpenSpec commands
  • Rebrands the fork as OpenSplx with new logo assets
  • Both plx and openspec commands work identically

Changes

  • New pixel art logos: assets/opensplx_pixel_light.svg, assets/opensplx_pixel_dark.svg
  • Updated README with fork notice and Quick Start section
  • Added plx bin entry to package.json
  • Created bin/plx.js entry point
  • Added src/utils/command-name.ts for dynamic command detection
  • Updated CLI and completion system to support both command names

Test plan

  • plx --version outputs version
  • plx --help shows "plx" as command name
  • openspec --version still works
  • plx completion generate zsh generates correct completions
  • Unit tests pass (399/400 - one unrelated environment failure)

Summary by CodeRabbit

  • New Features

    • Added "plx" command as an alternative CLI entry point alongside "openspec"
    • Shell completion now supports both command variants with context-aware messaging
  • Documentation

    • Updated README with OpenSplx branding, feature comparison table, and quick-start installation guide

✏️ Tip: You can customize this high-level summary in your review settings.

- 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
Copilot AI review requested due to automatic review settings December 19, 2025 23:00
@appboypov appboypov requested a review from TabishB as a code owner December 19, 2025 23:00
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This 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

Cohort / File(s) Summary
Branding and Documentation
README.md
Updated header references, badges, and dashboard image from OpenSpec to OpenSplx; added fork notice, feature comparison table, and quick-start guidance.
CLI Entry Points
bin/plx.js, package.json
Added new plx CLI executable in bin/ directory and registered it in package.json alongside existing openspec entry.
Command Name Detection
src/utils/command-name.ts, scripts/postinstall.js
Introduced new utility module to detect CLI command name from invocation path (returns 'plx' or 'openspec'); updated postinstall completion tips to include both command variants.
CLI Core
src/cli/index.ts, src/commands/completion.ts
Updated CLI root name and completion command to use dynamic commandName instead of hard-coded 'openspec'.
Completion Generator
src/core/completions/generators/zsh-generator.ts, src/core/completions/types.ts
Extended ZshGenerator.generate() signature to accept optional commandName parameter; updated internal helpers and generated output to use parameterized command name for function names and completion rules.
Tests
test/core/completions/generators/zsh-generator.test.ts
Updated test expectation comment to reflect dynamic command naming.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Public API changes: ZshGenerator.generate() and CompletionGenerator interface signatures updated; verify all call sites pass the new parameter correctly.
  • Parameter threading: Confirm commandName flows correctly from CLI entry through completion generators; trace execution paths in zsh-generator.ts to ensure all generated function names and helper invocations are properly parameterized.
  • Cross-file consistency: Review that command name detection in src/utils/command-name.ts aligns with postinstall tips and completion messaging.

Possibly related PRs

  • feature/oh-my-zsh-completions #289: Prior completion subsystem refactor that this PR extends by adding dynamic command name parameterization to Zsh generator and completion type signatures.

Suggested reviewers

  • TabishB

Poem

🐰 A fork with a name, a choice to declare,
Now "plx" and "openspec" both run in the air!
Dynamic names dance through the completion script's flow,
Two paths, one logic—watch both commands grow!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cefb471 and 19979f0.

⛔ Files ignored due to path filters (2)
  • assets/opensplx_pixel_dark.svg is excluded by !**/*.svg
  • assets/opensplx_pixel_light.svg is excluded by !**/*.svg
📒 Files selected for processing (10)
  • README.md (2 hunks)
  • bin/plx.js (1 hunks)
  • package.json (1 hunks)
  • scripts/postinstall.js (5 hunks)
  • src/cli/index.ts (1 hunks)
  • src/commands/completion.ts (5 hunks)
  • src/core/completions/generators/zsh-generator.ts (12 hunks)
  • src/core/completions/types.ts (1 hunks)
  • src/utils/command-name.ts (1 hunks)
  • test/core/completions/generators/zsh-generator.test.ts (1 hunks)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a 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 plx or openspec
  • Updates Zsh completion generator to support dynamic command names in generated scripts
  • Adds new plx binary entry point alongside existing openspec command

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.

Comment on lines +24 to +29
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';
}
Copy link

Copilot AI Dec 19, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +29
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';
}
Copy link

Copilot AI Dec 19, 2025

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.

Copilot uses AI. Check for mistakes.
if (!skipConfirmation) {
const confirmed = await confirm({
message: 'Remove OpenSpec configuration from ~/.zshrc?',
message: `Remove ${commandName} configuration from ~/.zshrc?`,
Copy link

Copilot AI Dec 19, 2025

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?

Suggested change
message: `Remove ${commandName} configuration from ~/.zshrc?`,
message: `Remove ${commandName} configuration from ${shell} configuration?`,

Copilot uses AI. Check for mistakes.
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