CLI Agent mode#945
Conversation
🦋 Changeset detectedLatest commit: d204eeb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughThis PR adds an agent-friendly, non-interactive mode to ChangesCLI Agent Mode (single cohesive cohort)
sequenceDiagram
participant Agent as Agent
participant CLI as CLI Parser
participant Cmd as Init Command
participant Logger as Logger
participant Prompts as Prompt Wizard
participant Scaffold as Scaffold
participant Skills as Skill Installer
participant IO as stdout/stderr
Agent->>CLI: invoke (argv includes --agent / flags)
CLI->>Logger: construct Logger(flags)
CLI->>Cmd: dispatch command (init)
Cmd->>Logger: interactiveStdout(true)
Cmd->>Prompts: runPromptWizard(isAgent)
alt isAgent
Prompts-->>Cmd: fast defaults (no install prompt)
else interactive
Prompts-->>Cmd: user choices (may include installSkill)
end
Cmd->>Logger: interactiveStdout(false)
Cmd->>Scaffold: scaffold(options)
Scaffold-->>Cmd: { tsConfigResult, installCmd, packageManager }
Cmd->>Cmd: run installCmd (if present)
Cmd->>Skills: dlx skills add yamcodes/arkenv (optional)
Cmd->>Logger: finish(message, details)
alt isJson
Logger->>IO: JSON payload to stdout, other output to stderr
else normal
Logger->>IO: human-readable outro to stdout/stderr
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
…e CLI execution.
arkenv
@arkenv/bun-plugin
@arkenv/cli
@arkenv/fumadocs-ui
@arkenv/vite-plugin
commit: |
📦 Bundle Size Report✅ All size limits passed! |
� Conflicts: � packages/cli/src/visuals.ts
|
🤖 Hi @yamcodes, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
|
🤖 I'm sorry @yamcodes, but I was unable to process your request. Please see the logs for more details. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. Warning Rate limit exceeded@yamcodes has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minute and 6 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered by pushing new commits to this PR or by re-running the workflow. We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?We enforce hourly and daily rate limits to ensure stability and fair usage of resources.
|
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.changeset/gold-ideas-grin.md:
- Line 9: Update the release note phrase "non `--agent` mode" to use a
hyphenated compound modifier: change it to "non-`--agent` mode" so the modifier
correctly binds to `--agent`; locate the text containing the exact phrase "non
`--agent` mode" in the .changeset release note and replace it with
"non-`--agent` mode".
In `@openspec/changes/cli-agent-mode/proposal.md`:
- Line 3: The proposal text claims that `--yes` is the canonical instruction for
the yamcodes/arkenv skill but the rest of the change establishes `--agent` as
the agent-facing canonical flag; update the wording so the canonical flag is
consistent—either change the sentence that mentions `--yes` to reference
`--agent` or change all occurrences of `--agent` to `--yes` throughout the
proposal; ensure the canonical-flag sentence and all examples/definitions use
the same flag name (referencing `--yes` and `--agent` as unique identifiers to
locate and fix the mismatch).
In `@openspec/changes/cli-agent-mode/specs/scaffolding-cli/spec.md`:
- Line 68: Update the usage/help-text requirement to include the new flag by
adding `--agent` alongside the existing flags: change the sentence that
currently requires descriptions for `--yes`, `--quiet`, and `--json` so it now
also requires a description for `--agent`; ensure the updated wording refers to
the usage text/ help text (usage text SHALL include descriptions for `--yes`,
`--quiet`, `--json`, and `--agent`) and adjust any related examples or scenarios
that assert presence of these flags in the help output.
- Line 70: Remove the malformed trailing requirement line "ND** the process
SHALL exit with code `0`" from the spec (it is a corrupted/duplicated line);
delete that exact string so only the valid requirement "the process SHALL exit
with code `0`" remains, ensure the file ends cleanly with a single newline, and
run the spec linter/formatter to confirm no other stray tokens remain.
In `@openspec/changes/cli-agent-mode/tasks.md`:
- Around line 3-35: The tasks file was committed with all checklist items marked
complete; revert the checklist items in openspec/changes/cli-agent-mode/tasks.md
to start unchecked so progress is traceable (change each "- [x]" to "- [ ]" for
items 1.1–5.5) and leave completed state flips for follow-up commits; ensure new
openspec/changes/<branch>/tasks.md files are initialized with unchecked items by
default going forward.
In `@packages/cli/src/commands/init.ts`:
- Around line 21-60: The stdout redirection started by
logger.interactiveStdout(true) may never be restored if an exception or early
return occurs; wrap the code from logger.interactiveStdout(true) through the
point where stdout is restored in a try/finally and call
logger.interactiveStdout(false) in the finally block so restoration always runs.
Concretely, call logger.interactiveStdout(true) before the block that calls
checkTsConfig(), the confirm prompt, detectFramework(), and runPromptWizard(),
then place all that logic inside a try { ... } and put
logger.interactiveStdout(false) inside finally { ... } to guarantee cleanup even
if checkTsConfig, confirm, detectFramework, or runPromptWizard throw or return
early. Ensure no other early exits bypass the finally and remove the standalone
restore call after runPromptWizard.
In `@packages/cli/src/lib/logger.ts`:
- Around line 90-108: The JSON error responses emitted by cancel() and fatal()
should match the success shape used by finish(): use a top-level status "error"
and a details object (not a bare message or error field). Update cancel(message)
to call this.json({ status: "error", details: { message } }) and update
fatal(message, error?) to call this.json({ status: "error", details: { message,
error: error instanceof Error ? error.message : error ? String(error) :
undefined } }) (include the error message only when present). Keep the existing
process.exit(0) / process.exit(...) behavior and toggle via this.options.isJson
as currently implemented.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 179f3136-e3b8-4833-91b9-ac1af3a4461d
📒 Files selected for processing (18)
.changeset/gold-ideas-grin.md.gemini/commands/arkenv.tomlapps/www/content/docs/cli/index.mdxopenspec/changes/cli-agent-mode/.openspec.yamlopenspec/changes/cli-agent-mode/design.mdopenspec/changes/cli-agent-mode/proposal.mdopenspec/changes/cli-agent-mode/specs/cli-agent-mode/spec.mdopenspec/changes/cli-agent-mode/specs/scaffolding-cli/spec.mdopenspec/changes/cli-agent-mode/tasks.mdpackages/cli/package.jsonpackages/cli/src/cli.tspackages/cli/src/commands/help.tspackages/cli/src/commands/init.tspackages/cli/src/index.tspackages/cli/src/lib/logger.tspackages/cli/src/prompts.tspackages/cli/src/scaffold.tsskills/arkenv/SKILL.md
💤 Files with no reviewable changes (1)
- .gemini/commands/arkenv.toml
Closes #924
Summary by CodeRabbit
New Features
Behavior / UX
Documentation