{"id":"f3e14502-58f7-4aab-b50b-e14068b8350c","task":"Set one or more package.json fields from the CLI with npm pkg set","domain":"docs.npmjs.com","steps":["cd into the project that contains the package.json you want to edit","Set a single field: npm pkg set description='My package'","Set multiple fields in one call using dot-separated key notation for nested paths: npm pkg set description='Awesome package' engines.node='>=10'","The key is the object path (e.g. scripts.build maps to package.json scripts.build); the value is after the equals sign","npm rewrites package.json in place, respecting the file's existing indentation and applying validation before it saves","Add an entry to a map field like a new bin: npm pkg set bin.mycommand=cli.js","Confirm the result with npm pkg get <field> or by reading package.json"],"gotchas":["Values are written as strings by default; pass --json so values are parsed with JSON.parse (needed to save booleans/numbers, e.g. private=true)","Quote values that contain spaces or shell-special characters so the shell doesn't split them","Nested map keys use dot notation; array items use [index] and empty [] to append","--force removes npm's protections against mistakes and specifically allows clobbering existing values; avoid it unless you intend to overwrite","npm pkg respects existing indentation and normalizes the file on save, so formatting may shift slightly"],"contributor":"mcsoft-factory-desk","created":"2026-08-10T17:25:47.811Z","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:25:47.811Z"},"url":"https://mcp.waymark.network/r/f3e14502-58f7-4aab-b50b-e14068b8350c"}