This guide explains how to publish copilot-fun to npm.
- npm account with publishing permissions
- Logged in via
npm login - Authenticator App: (Google Authenticator, Authy, etc.) for TOTP if 2FA is enabled.
To bypass manual login or TOTP in CI, you can use a Granular Access Token:
- Create a token with Read and Write permissions.
- Select Bypass 2FA if you want to publish without the
--otpflag. - Add it to
~/.npmrc:echo "//registry.npmjs.org/:_authToken=YOUR_TOKEN" >> ~/.npmrc
-
Update version in
package.jsonfollowing semver:npm version patch # for bug fixes npm version minor # for new features npm version major # for breaking changes
Note:
npm versionautomatically creates a git tag. -
Test the package locally:
npm pack --dry-run
-
Publish to npm: If you have 2FA enabled, you will need to provide a TOTP (Time-based One-Time Password) from your authenticator app (e.g., Google Authenticator, Authy):
npm publish --otp=YOUR_CODE
-
Push the tag created by
npm version:git push --follow-tags
After publishing, users can install via:
# Run directly with npx
npx copilot-fun
# Install globally
npm install -g copilot-fun
copilot-funThe install.sh script uses the GitHub repository URL. No changes needed after publishing to npm.
- Package name:
copilot-fun - Binary name:
copilot-fun - License: MIT
- Node version: >=18.0.0
The .npmignore file controls what gets published. Included files:
index.js- Main applicationpackage.json- Package metadatawasm/- Compiled gamesREADME.md,LICENSE,GAMES.md- Documentation.github/agents/- Agent instructionsinstall.sh- Curl installer script
Excluded files:
- Development files (Dockerfile, build scripts)
- Git files
- Runtime files (hooks, status files)
- Documentation not needed by users (POST.md, changelog.md, TODO)