statuslinesSource-backedReview first Safety ✓ Privacy ✓
npm Publish Readiness Statusline
Claude Code statusline that checks package publish readiness from package.json, npm login visibility, package privacy, and dirty package metadata files.
by MkDev11·added 2026-06-04·
Claude Code
HarnessClaude Code
Language:bash
Review first — review before installing
Open the source and read safety notes before installing.
Safety notes
- The script does not run `npm publish`; it only reads metadata and login visibility.
- Readiness is a checklist signal, not approval to publish; run `npm pack --dry-run` and project release checks separately.
- Dirty lockfiles or package metadata should be reviewed before release tagging.
Privacy notes
- The output prints package name and version, which can reveal unreleased package plans in screenshots.
- npm login visibility follows local npm configuration but does not print account names.
- package.json can contain private package names; avoid sharing terminal output when those names are sensitive.
Prerequisites
- Node.js project with package.json.
- jq available for reading package metadata.
- npm CLI installed if login visibility should be shown.
Schema details
- Install type
- config
- Troubleshooting
- No
Runtime and command metadata
- Script language
- bash
Script body
#!/usr/bin/env bash
set -u
main() {
if [ ! -f package.json ]; then
echo "npm: no package.json"
exit 0
fi
if ! command -v jq >/dev/null 2>&1; then
echo "npm: jq missing"
exit 0
fi
name=$(jq -r '.name // "unnamed"' package.json)
version=$(jq -r '.version // "0.0.0"' package.json)
private=$(jq -r '.private // false' package.json)
dirty=$(git status --porcelain=v1 -- package.json package-lock.json npm-shrinkwrap.json pnpm-lock.yaml yarn.lock 2>/dev/null | wc -l | tr -d ' ')
if command -v npm >/dev/null 2>&1 && npm whoami >/dev/null 2>&1; then
login="logged-in"
else
login="login-missing"
fi
if [ "$private" = "true" ]; then
state="blocked"
elif [ "$dirty" -gt 0 ]; then
state="review"
elif [ "$login" = "login-missing" ]; then
state="auth"
else
state="ready"
fi
cleanliness="clean"
if [ "$dirty" -gt 0 ]; then
cleanliness="dirty"
fi
printf 'npm: %s@%s | %s | %s | %s\n' "$name" "$version" "$cleanliness" "$login" "$state"
}
case $- in
*n*) ;;
*) main "$@" ;;
esacFull copyable content
{
"statusLine": {
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/npm-publish-readiness-statusline.sh"
}
}About this resource
Source notes
- npm documents
npm publishbehavior and package metadata that affects publication. - npm also documents
npm pack --dry-run; this statusline intentionally stays read-only and leaves dry-run verification to a separate release command.
Duplicate check
Checked existing statuslines, live HeyClaude statuslines, open pull requests, and repository content for npm-publish-readiness-statusline, package publish readiness, npm publish, release readiness, and package statuslines. No statusline entry or open PR with this slug or npm publish-readiness focus was found.
Disclosure
Editorial statusline recipe. No paid placement or affiliate link is used.
#npm#package#publish#claude-code
Source citations
Signals
Loading live community signals…
More like this, weekly
A short, calm digest of reviewed Claude resources. Unsubscribe any time.