* feat(cli): deep integration with desktop client - Package CLI binary with desktop app via extraResource in Electron Forge - Sync desktop login session to ~/.folo/config.json automatically on login/logout - Add CliService IPC with install/uninstall methods supporting macOS (osascript), Linux (pkexec), Windows (.cmd wrapper) - Add CLI settings tab in desktop app for install status and management - Create prepare-cli build script to compile and bundle CLI before packaging - Add i18n strings for CLI UI (English and Chinese) The CLI now shares the desktop app's authentication session without requiring separate login. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * fix(cli): fix CI failures in auth service and forge config - Pass `undefined` explicitly to syncSessionToCliConfig() to satisfy TS arity check - Make resources/cli conditional in extraResource so packaging doesn't fail when CLI bundle is absent Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(cli): make syncSessionToCliConfig token param optional Avoids TS2554 when called without arguments on signOut, while also satisfying the lint rule that strips explicit `undefined` arguments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(cli): address PR review feedback - Fix $@ shell expansion in privileged install path by writing to a temp file first, then using admin cp (Comment #1) - Check .cmd extension on Windows for install status and uninstall guard so the CLI is correctly detected and removed (Comment #2) - Wire prepare:cli into build:electron-vite instead of build:electron so all CI packaging paths (vite + forge) include CLI (Comment #3) - Add CLI i18n strings for ja, fr-FR, zh-TW locales (Comment #4) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
28 lines
775 B
TypeScript
28 lines
775 B
TypeScript
import { execSync } from "node:child_process"
|
|
import { cpSync, existsSync, mkdirSync } from "node:fs"
|
|
|
|
import { resolve } from "pathe"
|
|
|
|
const rootDir = resolve(import.meta.dirname, "../../..")
|
|
const cliDistDir = resolve(rootDir, "apps/cli/dist")
|
|
const targetDir = resolve(rootDir, "apps/desktop/resources/cli")
|
|
|
|
// Build CLI
|
|
console.info("Building CLI...")
|
|
execSync("pnpm --filter @follow/cli build", {
|
|
cwd: rootDir,
|
|
stdio: "inherit",
|
|
})
|
|
|
|
// Ensure CLI was built
|
|
const cliEntry = resolve(cliDistDir, "index.js")
|
|
if (!existsSync(cliEntry)) {
|
|
throw new Error(`CLI build output not found at ${cliEntry}`)
|
|
}
|
|
|
|
// Copy to desktop resources
|
|
mkdirSync(targetDir, { recursive: true })
|
|
cpSync(cliEntry, resolve(targetDir, "index.js"))
|
|
|
|
console.info("CLI prepared at", targetDir)
|