Desktop: Install CLI (#6526)
Co-authored-by: Brendan Allan <git@brendonovich.dev>
This commit is contained in:
parent
ced093e646
commit
8e9a0c4ad0
7 changed files with 364 additions and 185 deletions
13
packages/desktop/src/cli.ts
Normal file
13
packages/desktop/src/cli.ts
Normal file
|
|
@ -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" })
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue