Kode-cli/docs/PUBLISH.md
CrazyBoyM 7a3c4a7baa Refactor project structure and update documentation
- Update project branding from claude-cli to Kode
- Reorganize documentation with new development guides
- Add CONTRIBUTING.md and Chinese README
- Remove worktree_merge command and relocate system-design.md
- Update dependencies and package configuration
- Improve custom commands service with better error handling
- Clean up storage utilities and debug logging
2025-08-11 21:31:18 +08:00

54 lines
1.2 KiB
Markdown

# Publishing Kode to NPM
## Architecture Overview
This package uses an elegant hybrid approach:
- **Bun** for development and building
- **Direct source execution** without bundling (avoiding complex build issues)
- **Automatic runtime detection** (bun > tsx > npx tsx)
- **Full TypeScript/JSX support** out of the box
## Build System
The build process (`scripts/build.ts`) creates:
1. `cli.js` - Smart wrapper that detects and uses the best available runtime
2. `.npmrc` - Ensures proper dependency resolution
## Pre-publish Checklist
1. **Update version** in package.json
2. **Run build**: `bun run build`
3. **Test locally**: `./cli.js --help`
4. **Run checks**: `node scripts/prepublish-check.js`
## Publishing Steps
```bash
# 1. Clean and build
bun run clean
bun run build
# 2. Test the CLI
./cli.js --help
# 3. Publish to npm
npm publish --access public
```
## Post-publish Verification
```bash
# Install globally
npm install -g @shareai-lab/kode
# Test
kode --help
```
## Key Features
- ✅ No complex bundling - runs TypeScript directly
- ✅ Works with both Bun and Node.js environments
- ✅ Minimal dependencies bundled
- ✅ Fast startup time
- ✅ Source maps for debugging