Files
Hermes-ui/bin/hermes-web-ui.mjs
T
ekko cd58797f4c init: hermes-web-ui v0.1.0
Hermes Agent Web 管理面板,支持对话交互和定时任务管理。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 15:59:14 +08:00

25 lines
884 B
JavaScript
Executable File

#!/usr/bin/env node
import { spawn } from 'child_process'
import { resolve, dirname } from 'path'
import { fileURLToPath } from 'url'
const __dirname = dirname(fileURLToPath(import.meta.url))
const projectRoot = resolve(__dirname, '..')
const args = process.argv.slice(2)
const command = args[0]
if (!command || command === 'start' || command === 'dev') {
const viteBin = resolve(projectRoot, 'node_modules/.bin/vite')
spawn(viteBin, ['--host', '--port', '8648'], { stdio: 'inherit', cwd: projectRoot })
} else if (command === 'build') {
const viteBin = resolve(projectRoot, 'node_modules/.bin/vite')
spawn(viteBin, ['build'], { stdio: 'inherit', cwd: projectRoot })
} else {
console.log(`Usage: hermes-web-ui [command]`)
console.log()
console.log('Commands:')
console.log(' start Start dev server (default)')
console.log(' build Build for production')
}