feat(cli): refactor help to give better hints for humans & ai#966
feat(cli): refactor help to give better hints for humans & ai#966
Conversation
🦋 Changeset detectedLatest commit: 14aa8f7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
commit: |
This comment was marked as outdated.
This comment was marked as outdated.
|
oooo this is nice it'd be even better if we detect any env vars and use those to just print the text directly instead of doing the hidden thing i think. Like completely disable the interactive mode when an agent is detected and have a force-interactive flag if the user really wants to do this Opencode sets AGENT=1 and OPENCODE=1 |
|
Interactive is not ideal, but it's asking not answerd question. And ai can answer them. I would like to do some more bench with even better instructions |
|
Honestly, im not sure i agree with this. Now the default help screen is dramatically making I do agree though, I wouldn't make any expectations on the currently executing agent by checking a bunch of env vars. Especially since a new agent type will popup all the time and someone will always be unhappy. I do wonder though, why does this problem even exist? Would it be helpful for the llm to know about the docs on our website. I did try around with a few prompts locally, with the main idea to point the llm to the correct markdown docs, but seems like it did not like too much as well. https://svelte.dev/docs/cli/llms.txt |
|
I think I didn't manage the "sell" well the feature here. I'll take your feedback into account and push some changes before a new review. I think that we can do better. Let's see 😁 |
|
Closes: #964 WhyAI agents (Claude Code, Cursor, OpenCode, ...) struggle with
The alternative — fetching What changed1.
|
| Version | Turns | Time | Cost | sv create result |
|---|---|---|---|---|
| Published sv | 49 | 187s | $0.41 | ❌ Wrong (manual Tailwind v3 setup) |
| This PR (initial) | 21 | 97s | $0.18 | ❌ 8 retries (usage vs usages, missing options) |
| This PR (with examples + defaults) | 6 | 32s | $0.07 | ✅ One-shot |
The key improvements that got us to one-shot:
- Showing defaults (e.g.
tailwindcss ... (default: none)) — agents know to passplugins:none - Concrete examples with exact syntax — no more guessing
vitest=unitvsvitest="usages:unit" - Non-interactive hint listing required flags — agents pass
--templateand--typesimmediately
The published version "looks fast" at 2 turns, but it actually failed — the agent got stuck on the tailwindcss plugin prompt and fell back to manually installing packages. This PR makes it succeed reliably.
Benefits for humans too
This isn't just for AI. The examples, syntax reference, and defaults are useful for anyone scripting sv or just wanting to skip prompts. The --help output is now a self-contained reference.
Closes: #964
Should be better in oneshoting things