feat: add build system, stubs, and npm packaging — openclaude is now runnable
- package.json with all 70+ dependencies - Bun build script with feature flag shims, native module stubs, otel externals - Stubs for ~15 missing source files (snapshot gaps) - tsconfig.json for TypeScript - bin/openclaude entry point - Builds to single 19MB dist/cli.mjs - Verified: --version and --help work Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fd108243eb
commit
3e652cafdf
32
bin/openclaude
Executable file
32
bin/openclaude
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* OpenClaude — Claude Code with any LLM
|
||||
*
|
||||
* If dist/cli.mjs exists (built), run that.
|
||||
* Otherwise, tell the user to build first or use `bun run dev`.
|
||||
*/
|
||||
|
||||
import { existsSync } from 'fs'
|
||||
import { join, dirname } from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||
const distPath = join(__dirname, '..', 'dist', 'cli.mjs')
|
||||
|
||||
if (existsSync(distPath)) {
|
||||
await import(distPath)
|
||||
} else {
|
||||
console.error(`
|
||||
openclaude: dist/cli.mjs not found.
|
||||
|
||||
Build first:
|
||||
bun run build
|
||||
|
||||
Or run directly with Bun:
|
||||
bun run dev
|
||||
|
||||
See README.md for setup instructions.
|
||||
`)
|
||||
process.exit(1)
|
||||
}
|
||||
Reference in New Issue
Block a user