File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ stdenv.mkDerivation (finalAttrs: {
9090 export OPENCODE_CLI_DIST="$TMPDIR/desktop-cli"
9191 cli_package=$(bun -e 'import { getCurrentCli } from "./scripts/utils.ts"; console.log(getCurrentCli().package.replace("@opencode/", ""))')
9292 mkdir -p "$OPENCODE_CLI_DIST/$cli_package/bin"
93- cp ${ lib . getExe opencode } "$OPENCODE_CLI_DIST/$cli_package/bin/opencode2 "
93+ cp ${ lib . getExe opencode } "$OPENCODE_CLI_DIST/$cli_package/bin/opencode "
9494
9595 bun run build
9696 npx electron-builder --dir \
Original file line number Diff line number Diff line change @@ -62,9 +62,9 @@ stdenvNoCC.mkDerivation (finalAttrs: {
6262 installPhase = ''
6363 runHook preInstall
6464
65- install -Dm755 dist/cli-*/bin/opencode2 $out/bin/opencode2
65+ install -Dm755 dist/cli-*/bin/opencode $out/bin/opencode
6666
67- wrapProgram $out/bin/opencode2 \
67+ wrapProgram $out/bin/opencode \
6868 --prefix PATH : ${
6969 lib . makeBinPath (
7070 [
@@ -75,11 +75,17 @@ stdenvNoCC.mkDerivation (finalAttrs: {
7575 )
7676 }
7777
78+ ln -s opencode $out/bin/opencode2
79+
7880 runHook postInstall
7981 '' ;
8082
8183 postInstall = lib . optionalString ( stdenvNoCC . buildPlatform . canExecute stdenvNoCC . hostPlatform ) ''
8284 # trick yargs into also generating zsh completions
85+ installShellCompletion --cmd opencode \
86+ --bash <($out/bin/opencode completion) \
87+ --zsh <(SHELL=/bin/zsh $out/bin/opencode completion)
88+
8389 installShellCompletion --cmd opencode2 \
8490 --bash <($out/bin/opencode2 completion) \
8591 --zsh <(SHELL=/bin/zsh $out/bin/opencode2 completion)
@@ -101,7 +107,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
101107 description = "The open source coding agent" ;
102108 homepage = "https://opencode.ai" ;
103109 license = lib . licenses . mit ;
104- mainProgram = "opencode2 " ;
110+ mainProgram = "opencode " ;
105111 inherit ( node_modules . meta ) platforms ;
106112 } ;
107113} )
You can’t perform that action at this time.
0 commit comments