Skip to content

fix(cli): accept a bare tool name for veryfront install - #3609

Merged
kojiwakayama merged 2 commits into
mainfrom
fix/dx-20260811-r2-24
Aug 11, 2026
Merged

fix(cli): accept a bare tool name for veryfront install#3609
kojiwakayama merged 2 commits into
mainfrom
fix/dx-20260811-r2-24

Conversation

@kojiwakayama

@kojiwakayama kojiwakayama commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Symptom (reproduced on published 0.1.1229)

$ npm i veryfront@0.1.1229
$ mkdir t && cd t && printf '{"name":"t","type":"module"}' > package.json
$ mkdir app && printf 'export default function P(){return <div/>}' > app/page.tsx
$ veryfront install agents --no-input

  Installing AI integrations...

  ✓ SKILL.md          # <- not AGENTS.md

  ✓ Your AI assistants now know Veryfront!
$ echo $?
0

veryfront install read its target from --target only. A bare positional was
dropped on the floor, the command fell through to auto-detection, and in a fresh
project auto-detection resolves to SKILL.md. No warning, no error, exit 0. The
same silent drop hit every documented variant (veryfront install claude-code,
... cursor, ...).

That matters because the live docs still print the positional form:

$ curl -s -H 'Accept: text/markdown' https://veryfront.com/docs/code/guides/coding-agents.md | grep 'veryfront install'
veryfront install agents
veryfront install claude-code
...

Why the previous doc fix did not make the symptom go away

#3558 (125f290e2) rewrote docs/getting-started/installation.md and
docs/guides/coding-agents.md in this repo to use --target. That landed
and is correct. But veryfront.com/docs/code/** is served from the
veryfront-docs repo, which receives these pages through a periodic sync commit
(docs: update code docs from veryfront-code@<sha>). The last sync predates
#3558, so the live pages still print the broken form and will keep printing it
until the next sync. A docs-only fix therefore could not close this: readers
follow the deployed page, not the source page.

This PR fixes the CLI instead, so the invocation the live docs print does the
right thing regardless of when the sync lands.

Fix

cli/shared/args.ts already supports positional arg specs; the install spec
simply never declared one. One line:

target: { keys: ["target", "t"], type: "string", positional: 0 },
  • veryfront install agents now resolves the same target as
    veryfront install --target agents.
  • --target still wins when both a flag and a positional are given.
  • An unknown positional (veryfront install bogus) now fails validation and
    exits 1 rather than quietly installing something else.
  • uninstall shares the parser, so veryfront uninstall cursor works too.
  • Help usage updated to veryfront install [tools] [options] with an example.

docs/** is left as #3558 wrote it — --target is still the form to
recommend for scripts, and the docs contract test in
tests/docs/cli-install-commands.test.ts keeps enforcing that every documented
command actually selects a target. Its header comment is updated, since the
"positional is silently ignored" statement it was written against is no longer
true.

Regression tests (written first, confirmed red)

cli/commands/install/handler.test.ts — bare positional resolves to the target,
comma-separated positional, --target beats the positional, no positional
leaves it unset, same for uninstall.

Before the fix:

commands/install/handler ... bare positional target ... reads the target from the first positional argument
error: AssertionError: Values are not equal.
-   undefined
+   "agents"
FAILED | 0 passed (27 steps) | 1 failed (4 steps)

cli/commands/install/install.integration.test.ts — drives the real CLI binary
in a temp dir and asserts veryfront install agents --force --no-input writes
AGENTS.md and not SKILL.md (plus the claude-code and flag-beats-positional
cases). Before the fix both new end-to-end cases failed on the missing
AGENTS.md / .claude/CLAUDE.md.

Original symptom, re-run against this build

$ cd /tmp/t2   # fresh project, same shape as the repro above
$ deno run --allow-all <worktree>/cli/main.ts install agents --no-input

  Installing AI integrations...

  ✓ AGENTS.md

exit=0
$ ls
AGENTS.md  app  package.json

veryfront install bogus --no-input now exits 1 instead of writing SKILL.md.

Follow-up owned elsewhere

The veryfront-docs sync still needs to run for the live pages to match this
repo's docs. After that sync,
https://veryfront.com/docs/code/getting-started/installation and
https://veryfront.com/docs/code/guides/coding-agents should show
veryfront install --target agents. With this PR shipped, the currently-live
positional form is no longer wrong either way.

Summary by CodeRabbit

  • New Features

    • Install and uninstall commands now accept optional positional tool targets.
    • Added support for comma-separated targets.
    • Explicit --target options take precedence over positional targets.
    • Updated command help with the new syntax and usage examples.
  • Documentation

    • Clarified target selection, auto-detection behavior, and possible SKILL.md creation.

`veryfront install agents` silently dropped the positional and fell back to
auto-detection, which in a fresh project writes SKILL.md and exits 0. The
published installation and coding-agents pages still print that exact line
while promising AGENTS.md, so a reader following the docs gets the wrong file
with no warning.

The arg parser already supports positionals; the install/uninstall spec just
never declared one. Declaring `positional: 0` makes `veryfront install agents`
resolve the same target as `--target agents`, with the explicit flag still
winning when both are given. An unknown positional now fails validation
instead of installing something else.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kojiwakayama, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ee4aa921-2dc2-43f0-859d-ec747e0bdc15

📥 Commits

Reviewing files that changed from the base of the PR and between d9ae823 and bdb2647.

📒 Files selected for processing (2)
  • cli/commands/install/command-help.ts
  • cli/commands/install/install.integration.test.ts
📝 Walkthrough

Walkthrough

The install and uninstall commands now accept optional positional targets. Named --target values remain supported and take precedence. Help text, unit tests, integration tests, and documentation cover the new behavior.

Changes

Install target selection

Layer / File(s) Summary
Positional target parsing
cli/commands/install/handler.ts, cli/commands/install/handler.test.ts
The parser reads the first positional argument as the target. Unit tests cover aliases, comma-separated targets, precedence, and missing targets.
Install command integration
cli/commands/install/install.integration.test.ts
Integration tests cover positional agents and claude-code targets and verify that --target cursor overrides positional agents.
Help and documentation updates
cli/commands/install/command-help.ts, tests/docs/cli-install-commands.test.ts
Help and documentation describe positional install and uninstall targets and auto-detection when no target is selected.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: kwakayama

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main CLI change: accepting a bare tool name for veryfront install.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dx-20260811-r2-24

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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 `@cli/commands/install/command-help.ts`:
- Line 42: Update the uninstall command examples near the usage entry in
command-help to include a positional invocation, veryfront uninstall agents,
alongside the existing --target example. Preserve the current usage text and
other examples.

In `@cli/commands/install/install.integration.test.ts`:
- Around line 165-195: Add an integration test in the “bare positional target”
suite that invokes runInstallArgs with an unknown positional target and the
existing noninteractive/force options, then assert the CLI returns exit code 1.
Keep the existing successful-target and --target precedence tests unchanged.
🪄 Autofix

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: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f440b205-db5d-464a-98a7-2b6a4456b94b

📥 Commits

Reviewing files that changed from the base of the PR and between 64d6850 and d9ae823.

📒 Files selected for processing (5)
  • cli/commands/install/command-help.ts
  • cli/commands/install/handler.test.ts
  • cli/commands/install/handler.ts
  • cli/commands/install/install.integration.test.ts
  • tests/docs/cli-install-commands.test.ts

Comment thread cli/commands/install/command-help.ts
Comment thread cli/commands/install/install.integration.test.ts
Review follow-up: add the uninstall positional example to the command help
and an end-to-end case asserting an unknown positional exits 1 without
writing any integration file.
@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 99963e5 Aug 11, 2026
33 checks passed
@kojiwakayama
kojiwakayama deleted the fix/dx-20260811-r2-24 branch August 11, 2026 21:35
kojiwakayama added a commit that referenced this pull request Aug 12, 2026
`veryfront install not-a-tool` exited 1. The target was only checked inside
`installCommand`, where `parseTargetFlag` throws a plain runtime error, so a
typo was indistinguishable from an installation failure. AGENTS.md reserves
exit 1 for runtime errors and exit 2 for usage and argument errors.

Validate the target while parsing arguments instead, so the failure goes
through `parseArgsOrThrow` and the router's "Invalid ..." usage path and the
message names the valid targets. `--target not-a-tool` takes the same path and
also exits 2 now. `parseTargetFlag` keeps its own check for programmatic
callers.

The positional-target fix this branch originally carried landed on main in
#3609, so only the exit-code correction remains here. The end-to-end case
#3609 added for an unknown positional asserted exit 1 and is updated to 2.
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