docs: add RFC for task listing without no-intractive (--no-interactive and --json flags)#320
docs: add RFC for task listing without no-intractive (--no-interactive and --json flags)#320kazupon wants to merge 2 commits intovoidzero-dev:mainfrom
--no-interactive and --json flags)#320Conversation
|
I want an alias for So that AI and others can understand it, I’d like |
|
Alternative: Implement (Though this might be more of a Vite+ issue than a Vite Task issue.) |
I've just updated for docs/listing.md The
I’m concerned that the new Personally, I don’t think it’s necessary. |
|
|
||
| ### AI/LLM Integration | ||
|
|
||
| LLMs and AI agents can retrieve structured task information to understand the project: |
There was a problem hiding this comment.
Ideally we auto-detect the agent and print that by default (or generally in non-interactive mode)
There was a problem hiding this comment.
Thank you for your feedback!
Ideally auto-detecting the agent and adapting stdout accordingly would be great, but I can't see how to implement it reliably, there's no standardized way to detect which agent (Claude Code, Cursor, Copilot, Cline, etc.) is running, and each uses different environment variables (or none at all) 😅
We'd also need to keep adding detection logic as new agents appear.
For now, --list / --json as explicit flags feels like the pragmatic approach.
If a standard for agent detection emerges in the future, we can revisit auto-detection then.
There was a problem hiding this comment.
Nice!
I didn't know about std-env's agent detection 🙈
That changes things. With this, when an agent is detected and vp run is executed, we could default to non-tractive output.
This comment was marked as off-topic.
This comment was marked as off-topic.
| "packagePath": "." | ||
| }, | ||
| { | ||
| "package": null, |
There was a problem hiding this comment.
| "package": null, | |
| "packageName": "", |
Internally, we treat a package.json file without a name field as if the name is an empty string. Tasks within these packages can be matched with #task.
Also, every package is allowed to have an empty name, not just the workspace root.
There was a problem hiding this comment.
It makes sense to use an empty string since it's easier to handle!
I had the same thought 😅 I was planning to propose a Once |
| Prints a flat list of all tasks with their commands: | ||
|
|
||
| ``` | ||
| @vrowzer/fs#build tsdown | ||
| @vrowzer/fs#build:docs typedoc --excludeInternal | ||
| @vrowzer/example-vue#build vite build | ||
| @vrowzer/example-vue#dev vite | ||
| test:unit:vite pnpm run --color "/^test:unit:vite:/" | ||
| test:unit:vrowzer vitest run --project vrowzer:unit | ||
| typecheck pnpm -r --if-present typecheck | ||
| ``` | ||
|
|
||
| Tasks from named packages use the `package#task` format. Tasks from the workspace root (when the root `package.json` has no `name` field) are shown without a prefix. | ||
|
|
||
| The flag is mutually exclusive with `--last-details`. |
There was a problem hiding this comment.
The flat list is already implemented when the stdin is non-interactive (as is the case for AI agents). You can try it with echo '' | vp run. So --list doesn't seem necessary.
Our current flat list implementation is slightly different from the proposed one: tasks in the current package (detected with cwd) don't have the package# prefix, whereas tasks in other packages always have: they are consistent with what you'd type after vp run.
--list and --json flags)--list and --json flags)
|
Thanks for working on this! The flat list already shows up when stdin is non-interactive, which covers AI agents out of the box. So rather than
We'll skip AI agent detection since piped stdin already handles it naturally. |
|
Sounds good, I'll go with I initially thought |
--list and --json flags)--no-interactive and --json flags)
|
I changed the title of this PR. |
About details, see docs/listing.md