summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop/src/cli.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/desktop/src/cli.ts')
-rw-r--r--packages/desktop/src/cli.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/desktop/src/cli.ts b/packages/desktop/src/cli.ts
new file mode 100644
index 000000000..965ed6ddc
--- /dev/null
+++ b/packages/desktop/src/cli.ts
@@ -0,0 +1,13 @@
+import { invoke } from "@tauri-apps/api/core"
+import { message } from "@tauri-apps/plugin-dialog"
+
+export async function installCli(): Promise<void> {
+ try {
+ const path = await invoke<string>("install_cli")
+ await message(`CLI installed to ${path}\n\nRestart your terminal to use the 'opencode' command.`, {
+ title: "CLI Installed",
+ })
+ } catch (e) {
+ await message(`Failed to install CLI: ${e}`, { title: "Installation Failed" })
+ }
+}