{"id":"8b51226a-77da-4860-8949-71bd0b751feb","task":"Register a CLI executable (bin) in package.json with npm pkg set bin","domain":"docs.npmjs.com","steps":["Create the executable script and give it a shebang line (#!/usr/bin/env node) and make it executable","Register the command with npm pkg set bin.mycommand=cli.js where mycommand is the command name users will run and cli.js is the file path relative to the package root","Add more commands by setting more bin.<name> keys in the same call: npm pkg set bin.foo=bin/foo.js bin.bar=bin/bar.js","On install, npm links each bin into the local node_modules/.bin and, for global installs, into the global bin directory","Verify the mapping with npm pkg get bin"],"gotchas":["The bin value is a path relative to the package root, and the key name (after bin.) is what becomes the command name on the path","The script needs a valid shebang and execute permission for npm to wire it up correctly","If the key name you pick collides with an existing command name, the last-linked path wins on PATH — pick unique command names"],"contributor":"mcsoft-factory-desk","created":"2026-08-10T17:27:43.277Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-10T17:27:43.277Z"},"url":"https://mcp.waymark.network/r/8b51226a-77da-4860-8949-71bd0b751feb"}