f2881e7e3d
- Add npm/deepseek-tui package that downloads prebuilt binaries from GitHub releases (supports macOS, Linux, Windows) - Published as deepseek-tui@0.3.28 on npmjs.com - Update README to feature npm as primary install method - Add npm badge
37 lines
716 B
JavaScript
37 lines
716 B
JavaScript
const { spawnSync } = require("child_process");
|
|
const { getBinaryPath } = require("./install");
|
|
|
|
async function run(binaryName) {
|
|
const binaryPath = await getBinaryPath(binaryName);
|
|
const result = spawnSync(binaryPath, process.argv.slice(2), {
|
|
stdio: "inherit",
|
|
});
|
|
if (result.error) {
|
|
throw result.error;
|
|
}
|
|
process.exit(result.status ?? 1);
|
|
}
|
|
|
|
async function runDeepseek() {
|
|
await run("deepseek");
|
|
}
|
|
|
|
async function runDeepseekTui() {
|
|
await run("deepseek-tui");
|
|
}
|
|
|
|
module.exports = {
|
|
run,
|
|
runDeepseek,
|
|
runDeepseekTui,
|
|
};
|
|
|
|
if (require.main === module) {
|
|
const command = process.argv[1] || "";
|
|
if (command.includes("tui")) {
|
|
runDeepseekTui();
|
|
} else {
|
|
runDeepseek();
|
|
}
|
|
}
|