fix(cli): scaffolded projects validate/run with zero install (no bun required)#1113
Conversation
…required) Onboarding follow-ups to #1110, addressing user feedback that the lobu CLI should not require users to invoke bun (or any package manager) by hand. - desired-state.ts (loadProjectConfig): alias `@lobu/cli/config` and `@lobu/connector-sdk` to the running CLI's own copies via jiti's `alias` option (resolved with `import.meta.resolve`). A fresh `lobu init` project now validates/runs with no `bun install` step — the user has the CLI, that's enough. Drops the "Run `bun install` ..." error message; a real resolution failure still surfaces verbatim. - skills/lobu/SKILL.md: slim to existing-project + memory; drop First-Time Setup (now owned by the scaffolded AGENTS.md + landing prompt). This is the change that didn't land in the #1110 squash (the slim commit didn't push before merge); reapplying here. - AGENTS.md.tmpl: align the provider example with what `lobu init` generates (`id: "claude"`, not the `anthropic` alias; real model id). Verified: `lobu validate` on a config under $HOME with no node_modules anywhere in the ancestor tree → "lobu.config.ts is valid" (was: "Run `bun install`..." error). tsc + biome green on rebuild.
|
Warning Review limit reached
More reviews will be available in 18 minutes and 37 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 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 |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Removes the last user-machine bun requirement. `lobu apply`'s connector-deps install previously hard-failed with "install bun (https://bun.sh)" if bun wasn't on PATH; this was the one path #1113 didn't cover. ensure-deps-installed.ts: prefer bun (faster) when present, fall back to `npm install --ignore-scripts --no-audit --no-fund` (Node ships npm so it's always available). Honour an existing lockfile — `package-lock.json` keeps npm, `bun.lock` keeps bun — so switching installers doesn't churn formats. `installIsStale` now compares mtime against whichever lockfile exists. Drop the `hasBun()`-or-throw branch and the "install bun" error message. AGENTS.md: updated the Connectors line to reflect the fallback. Aligns with the principle from #1113: users with the lobu CLI shouldn't be required to install bun for any documented command path.
Why
User feedback after #1110: "we don't rely on people using bun when they have lobu."
A freshly-scaffolded
lobu initproject couldn'tlobu validate(orlobu run) until the user ranbun installto populatenode_modulesso jiti could resolve@lobu/cli/config. That's a manual package-manager step we shouldn't require — the user already has the CLI.What
packages/cli/src/commands/_lib/apply/desired-state.ts(loadProjectConfig): alias@lobu/cli/configand@lobu/connector-sdkto the running CLI's own copies via jiti'saliasoption (resolved withimport.meta.resolve). The "Runbun install…" error message is removed; a freshinitproject now validates/runs with zero install. Shared loader, sovalidate/run/chat/doctor/memory seedall benefit.skills/lobu/SKILL.md— slim to existing-project + memory (drop First-Time Setup, now owned by the scaffoldedAGENTS.md+ landing prompt). This is the change that didn't land in the feat(cli): teach conventions via scaffolded AGENTS.md, drop skill-install from setup prompt #1110 squash (the slim commit was committed locally but never pushed before merge); reapplying here.AGENTS.md.tmpl— align the provider example with whatlobu initactually generates (id: "claude", not theanthropicalias) — the doc drift the live cold-start flagged.How verified
Live test: a config under
$HOME/.lobu-test-noinstall— confirmed zeronode_modulesanywhere in the ancestor tree —lobu validatereturns "lobu.config.ts is valid". Before this PR the same setup errors with the manualbun installrequirement.Pre-commit
tsc --noEmit+ biome green.