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
The build process (scripts/build.ts) creates:
cli.js- Smart wrapper that detects and uses the best available runtime.npmrc- Ensures proper dependency resolution
- Update version in package.json
- Run build:
bun run build - Test locally:
./cli.js --help - Run checks:
node scripts/prepublish-check.js
# 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# Install globally
npm install -g @shareai-lab/kode
# Test
kode --help- ✅ No complex bundling - runs TypeScript directly
- ✅ Works with both Bun and Node.js environments
- ✅ Minimal dependencies bundled
- ✅ Fast startup time
- ✅ Source maps for debugging