feat(cli): add positional project selector to run - #26
Merged
Conversation
Require -- before child commands so run can distinguish an optional project name or path from the command being executed.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
There are correctness and contract-alignment issues (selector conflict comparison, reference text mismatch, and missing coverage for new parsing paths) that should be addressed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates one run to support an optional positional project selector and to require a -- separator so the command can reliably distinguish a project selector from the child command being executed.
Changes:
- Add positional
[project]support toone runand enforce--as a required separator for the child command. - Introduce
RUN_USAGE_INVALIDand new localized error messages for common invalid-usage cases. - Update help snapshots and skill reference docs to reflect the revised
one runcontract.
File summaries
| File | Description |
|---|---|
| packages/skills/one-cli/references/REFERENCE.md | Updates skill reference for new positional project and adds RUN_USAGE_INVALID to the error-code table. |
| packages/cli/testdata/reference/help/run.txt | Refreshes one run help snapshot to document positional selection and required --. |
| packages/cli/internal/transport/cobra/run/cmd.go | Implements parsing/validation for positional project + required separator and wires errors to RUN_USAGE_INVALID. |
| packages/cli/internal/platform/i18n/locales/zh-CN.json | Adds new zh-CN messages for run usage errors. |
| packages/cli/internal/platform/i18n/locales/en-US.json | Adds new en-US messages for run usage errors. |
| packages/cli/internal/platform/errors/codes.go | Adds RUN_USAGE_INVALID code/definition and updates error-code registry. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: caorushizi <19359849+caorushizi@users.noreply.github.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.
Require -- before child commands so run can distinguish an optional project name or path from the command being executed.