mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
* ♻️ refactor(cli): extract shared @lobechat/local-file-shell package Extract common file and shell operations from Desktop and CLI into a shared package to eliminate ~1500 lines of duplicated code. CLI now uses @lobechat/file-loaders for rich format support (PDF, DOCX, etc.). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * update * update commands * update version * update deps * refactor version issue * ✨ feat(local-file-shell): add cwd support, move/rename ops, improve logging - Add missing `cwd` parameter to `runCommand` (align with Desktop) - Add `moveLocalFiles` with batch support and detailed error handling - Add `renameLocalFile` with path validation and traversal prevention - Add error logging in shell runner's error/completion handlers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * support update model and provider in cli * fix desktop build * fix * 🐛 fix: pin fast-xml-parser to 5.4.2 in bun overrides Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
56 lines
2.0 KiB
TypeScript
56 lines
2.0 KiB
TypeScript
import { createRequire } from 'node:module';
|
|
|
|
import { Command } from 'commander';
|
|
|
|
import { registerAgentCommand } from './commands/agent';
|
|
import { registerConfigCommand } from './commands/config';
|
|
import { registerConnectCommand } from './commands/connect';
|
|
import { registerDocCommand } from './commands/doc';
|
|
import { registerFileCommand } from './commands/file';
|
|
import { registerGenerateCommand } from './commands/generate';
|
|
import { registerKbCommand } from './commands/kb';
|
|
import { registerEvalCommand } from './commands/eval';
|
|
import { registerLoginCommand } from './commands/login';
|
|
import { registerLogoutCommand } from './commands/logout';
|
|
import { registerMemoryCommand } from './commands/memory';
|
|
import { registerMessageCommand } from './commands/message';
|
|
import { registerModelCommand } from './commands/model';
|
|
import { registerPluginCommand } from './commands/plugin';
|
|
import { registerProviderCommand } from './commands/provider';
|
|
import { registerSearchCommand } from './commands/search';
|
|
import { registerSkillCommand } from './commands/skill';
|
|
import { registerStatusCommand } from './commands/status';
|
|
import { registerTopicCommand } from './commands/topic';
|
|
|
|
const require = createRequire(import.meta.url);
|
|
const { version } = require('../package.json');
|
|
|
|
const program = new Command();
|
|
|
|
program
|
|
.name('lh')
|
|
.description('LobeHub CLI - manage and connect to LobeHub services')
|
|
.version(version);
|
|
|
|
registerLoginCommand(program);
|
|
registerLogoutCommand(program);
|
|
registerConnectCommand(program);
|
|
registerStatusCommand(program);
|
|
registerDocCommand(program);
|
|
registerSearchCommand(program);
|
|
registerKbCommand(program);
|
|
registerMemoryCommand(program);
|
|
registerAgentCommand(program);
|
|
registerGenerateCommand(program);
|
|
registerFileCommand(program);
|
|
registerSkillCommand(program);
|
|
registerTopicCommand(program);
|
|
registerMessageCommand(program);
|
|
registerModelCommand(program);
|
|
registerProviderCommand(program);
|
|
registerPluginCommand(program);
|
|
registerConfigCommand(program);
|
|
registerEvalCommand(program);
|
|
|
|
program.parse();
|