MCPcopy
hub / github.com/shareAI-lab/Kode-CLI / main

Function main

cli-acp.js:62–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60}
61
62function main() {
63 const packageRoot = findPackageRoot(__dirname)
64 const pkg = readPackageJson(packageRoot)
65 const version = pkg?.version || ''
66
67 const args = ['--acp', ...process.argv.slice(2)]
68
69 // Native binary (npm optionalDependencies, no GitHub postinstall).
70 const nativeBin = tryResolveNativeBinaryFromOptionalDeps()
71 if (nativeBin) {
72 run(nativeBin, args)
73 }
74
75 // Node.js runtime fallback.
76 const distEntry = path.join(packageRoot, 'dist', 'index.js')
77 if (fs.existsSync(distEntry)) {
78 run(process.execPath, [distEntry, ...args])
79 }
80
81 process.stderr.write(
82 [
83 '❌ kode-acp is not runnable on this system.',
84 '',
85 'Tried:',
86 '- Native binary (optionalDependencies)',
87 '- Node.js runtime fallback',
88 '',
89 'Fix:',
90 '- Reinstall with optionalDependencies enabled (avoid --no-optional/--omit=optional)',
91 '- Or install a platform binary package: @shareai-lab/kode-bin-<platform>-<arch>',
92 '- Or run from source: bun run apps/cli/src/dispatch.ts --acp',
93 '',
94 version ? `Package version: ${version}` : '',
95 ]
96 .filter(Boolean)
97 .join('\n'),
98 )
99 process.exit(1)
100}
101
102if (require.main === module) {
103 main()

Callers 1

cli-acp.jsFile · 0.70

Calls 6

joinMethod · 0.80
findPackageRootFunction · 0.70
readPackageJsonFunction · 0.70
runFunction · 0.70
writeMethod · 0.65

Tested by

no test coverage detected