Description
Running npx @tanstack/intent@latest list (or install, or any subcommand) produces no output and exits 0 — even when intent-enabled packages with skills are present in node_modules.
The same applies when @tanstack/intent is installed as a local devDependency and invoked via pnpm intent list (which goes through the .bin symlink).
Root cause
The entry guard in dist/cli.mjs (line ~521):
if (process.argv[1] !== void 0 && import.meta.url === pathToFileURL(process.argv[1]).href) {
const exitCode = await main();
process.exit(exitCode);
}
When invoked via npx or a pnpm .bin symlink, process.argv[1] resolves to the symlink path while import.meta.url resolves to the real file path. The comparison fails, so main() is never called — the process exits silently with code 0.
Reproduction
# In any project with intent-enabled packages (e.g. @tanstack/db, @tanstack/devtools)
npx @tanstack/intent@latest list
# No output, exit code 0
# Also fails when installed as a devDependency with pnpm:
pnpm add -D @tanstack/intent
pnpm intent list
# No output, exit code 0
Calling main() directly confirms the scanner works fine:
node -e "import('@tanstack/intent/dist/cli.mjs').then(m => m.main(['list']))"
# Correctly outputs: 6 intent-enabled packages, 16 skills (pnpm)
Suggested fix
Use fs.realpathSync to normalize the symlink before comparing:
import { realpathSync } from "node:fs";
const argv1 = process.argv[1];
if (argv1 !== void 0 && import.meta.url === pathToFileURL(realpathSync(argv1)).href) {
const exitCode = await main();
process.exit(exitCode);
}
Environment
@tanstack/intent: 0.0.19
- Node: v22.12.0
- pnpm: 10.12.1
- OS: macOS (Darwin 24.6.0)
Description
Running
npx @tanstack/intent@latest list(orinstall, or any subcommand) produces no output and exits 0 — even when intent-enabled packages with skills are present innode_modules.The same applies when
@tanstack/intentis installed as a local devDependency and invoked viapnpm intent list(which goes through the.binsymlink).Root cause
The entry guard in
dist/cli.mjs(line ~521):When invoked via
npxor a pnpm.binsymlink,process.argv[1]resolves to the symlink path whileimport.meta.urlresolves to the real file path. The comparison fails, somain()is never called — the process exits silently with code 0.Reproduction
Calling
main()directly confirms the scanner works fine:Suggested fix
Use
fs.realpathSyncto normalize the symlink before comparing:Environment
@tanstack/intent: 0.0.19