From cc11b702d7577479d9fe706e6fd858817197b9b9 Mon Sep 17 00:00:00 2001 From: Val Alexander <68980965+BunsDev@users.noreply.github.com> Date: Tue, 7 Jul 2026 06:40:46 -0500 Subject: [PATCH] fix(npm): drop the coven bin alias to end the @opencoven/cli collision The coven command belongs to the Coven daemon CLI (@opencoven/cli), which execs into coven-code for the TUI when it is on PATH. Shipping a competing coven bin from @opencoven/coven-code made the command depend on install order for dual-install users. - npm/package.json: bin map keeps coven-code + coven-cave only - install.sh / install.ps1: stop creating the coven alias and clean up stale coven symlinks/exes left by older installers - docs + site content: alias references updated, completions use coven-code - prepare-npm-package.test.mjs: bin map expectation updated fixes #139 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- docs/index.md | 7 ++++--- docs/installation.md | 11 ++++++----- docs/src/content/getting-started.js | 2 +- docs/src/content/installation.js | 8 ++++---- install.ps1 | 8 ++++---- install.sh | 15 ++++++++------- npm/package.json | 1 - scripts/prepare-npm-package.test.mjs | 1 - 9 files changed, 28 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 3632e5b7..a5d0215b 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Recent highlights: npm install -g @opencoven/coven-code ``` -Then open a new terminal and run `coven-code`. The `coven` and `coven-cave` aliases are also installed. +Then open a new terminal and run `coven-code`. The `coven-cave` alias is also installed. (The bare `coven` command belongs to the [Coven daemon CLI](https://github.com/OpenCoven/coven) — `@opencoven/cli` — which execs into `coven-code` for the TUI.) ### Upgrade diff --git a/docs/index.md b/docs/index.md index 89cc2db5..d41ec9d5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -76,8 +76,9 @@ Cast `/incant caveman` or `/incant rocky` to compress model responses by 40–85 npm install -g @opencoven/coven-code ``` -The package installs the `coven-code` CLI (with `coven` and `coven-cave` -aliases). Run `coven-code` with no arguments for the interactive UI. See +The package installs the `coven-code` CLI (with a `coven-cave` alias). Run +`coven-code` with no arguments for the interactive UI. The bare `coven` +command belongs to the Coven daemon CLI (`@opencoven/cli`). See [Installation](installation) for npm, bun, standalone binary, and source install options. @@ -90,7 +91,7 @@ export ANTHROPIC_API_KEY=sk-ant-... **3. Run interactively** ```bash -coven +coven-code ``` Or launch a direct harness session: diff --git a/docs/installation.md b/docs/installation.md index 6145c235..861e7128 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -41,8 +41,9 @@ Releases — no compilation needed. After installation, run: coven-code ``` -The installed command is `coven-code`; `coven` and `coven-cave` are installed -as aliases for the same CLI. +The installed command is `coven-code`; `coven-cave` is installed as an alias +for the same CLI. The bare `coven` command is owned by the Coven daemon CLI +(`@opencoven/cli`) and is not installed by this package. You can also run Coven Code without a permanent install: @@ -297,15 +298,15 @@ cross build --release --locked --package claurst --target aarch64-unknown-linux- ## Shell Completions Coven does not currently ship a dedicated `completions` subcommand. All -flags can be discovered via `coven --help`. If you want basic tab completion +flags can be discovered via `coven-code --help`. If you want basic tab completion in bash or zsh you can use the generic completion helper built into your shell: ```bash # bash — add to ~/.bashrc -complete -C coven coven +complete -C coven-code coven-code # zsh — add to ~/.zshrc (requires compinit) -compdef _gnu_generic coven +compdef _gnu_generic coven-code ``` Richer completion scripts may be added in a future release. diff --git a/docs/src/content/getting-started.js b/docs/src/content/getting-started.js index 6c1e397e..4f6323a5 100644 --- a/docs/src/content/getting-started.js +++ b/docs/src/content/getting-started.js @@ -10,7 +10,7 @@ export function render() {

npm

npm install -g @opencoven/coven-code
-

This installs the coven-code CLI (with coven and coven-cave aliases). Run coven-code with no arguments for the interactive UI.

+

This installs the coven-code CLI (with a coven-cave alias). Run coven-code with no arguments for the interactive UI. The bare coven command belongs to the Coven daemon CLI (@opencoven/cli).

From Source

git clone https://github.com/OpenCoven/coven-code
diff --git a/docs/src/content/installation.js b/docs/src/content/installation.js
index e795021a..041899ad 100644
--- a/docs/src/content/installation.js
+++ b/docs/src/content/installation.js
@@ -24,7 +24,7 @@ export function render() {
 # or
 bun install -g @opencoven/coven-code
-

The installed command is coven-code; coven and coven-cave are installed as aliases for the same CLI. Run coven-code with no arguments for the interactive UI. The postinstall script downloads the correct pre-built binary from GitHub Releases — no compilation needed.

+

The installed command is coven-code; coven-cave is installed as an alias for the same CLI. The bare coven command is owned by the Coven daemon CLI (@opencoven/cli) and is not installed by this package. Run coven-code with no arguments for the interactive UI. The postinstall script downloads the correct pre-built binary from GitHub Releases — no compilation needed.

npx @opencoven/coven-code
 bunx @opencoven/coven-code
@@ -115,13 +115,13 @@ sudo pacman -S base-devel pkgconf openssl

Shell Completions

-

Coven does not currently ship a dedicated completions subcommand. All flags can be discovered via coven --help. If you want basic tab completion in bash or zsh, use the generic completion helper built into your shell:

+

Coven does not currently ship a dedicated completions subcommand. All flags can be discovered via coven-code --help. If you want basic tab completion in bash or zsh, use the generic completion helper built into your shell:

# bash — add to ~/.bashrc
-complete -C coven coven
+complete -C coven-code coven-code
 
 # zsh — add to ~/.zshrc (requires compinit)
-compdef _gnu_generic coven
+compdef _gnu_generic coven-code

Uninstalling

diff --git a/install.ps1 b/install.ps1 index d5ab73f6..f90a925b 100644 --- a/install.ps1 +++ b/install.ps1 @@ -168,12 +168,14 @@ function Install-FromBinary { function Install-Binary($source) { $target = Join-Path $InstallDir 'coven-code.exe' - $shortTarget = Join-Path $InstallDir 'coven.exe' $aliasTarget = Join-Path $InstallDir 'coven-cave.exe' + # `coven.exe` belongs to the Coven daemon CLI (@opencoven/cli); older + # installers shipped it as an alias, so clean it up on upgrade. + $staleShort = Join-Path $InstallDir 'coven.exe' # The currently running coven-code.exe (if any) holds an exclusive file lock on # Windows. Try to swap by renaming the old one first. - foreach ($path in @($target, $shortTarget, $aliasTarget)) { + foreach ($path in @($target, $aliasTarget, $staleShort)) { if (-not (Test-Path $path)) { continue } $stale = "$path.old" if (Test-Path $stale) { Remove-Item -Force $stale -ErrorAction SilentlyContinue } @@ -181,10 +183,8 @@ function Install-Binary($source) { } Copy-Item -Force $source $target - Copy-Item -Force $source $shortTarget Copy-Item -Force $source $aliasTarget Write-Success "Installed: $target" - Write-Success "Installed short command: $shortTarget" Write-Success "Installed alias: $aliasTarget" } diff --git a/install.sh b/install.sh index 5c95c302..8885ce4d 100644 --- a/install.sh +++ b/install.sh @@ -14,7 +14,6 @@ set -euo pipefail APP=coven-code ALIAS=coven-cave -SHORT=coven REPO=OpenCoven/coven-code RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m' @@ -116,8 +115,11 @@ fi ln -sf "${APP}" "${INSTALL_DIR}/${ALIAS}" || cp "${INSTALL_DIR}/${APP}" "${INSTALL_DIR}/${ALIAS}" chmod +x "${INSTALL_DIR}/${ALIAS}" -ln -sf "${APP}" "${INSTALL_DIR}/${SHORT}" || cp "${INSTALL_DIR}/${APP}" "${INSTALL_DIR}/${SHORT}" -chmod +x "${INSTALL_DIR}/${SHORT}" +# Remove any `coven` symlink left by older installers — that name belongs to +# the Coven daemon CLI (@opencoven/cli). +if [[ -L "${INSTALL_DIR}/coven" ]]; then + rm -f "${INSTALL_DIR}/coven" +fi # PATH setup shell_rc="" @@ -135,11 +137,10 @@ if [[ -n "$shell_rc" ]] && ! grep -qF "$INSTALL_DIR" "$shell_rc" 2>/dev/null; th fi print_message success "${APP} v${specific_version} installed to ${INSTALL_DIR}/${APP}" -print_message success "${SHORT} + ${ALIAS} aliases installed to ${INSTALL_DIR}" +print_message success "${ALIAS} alias installed to ${INSTALL_DIR}" echo "" -echo -e " ${GREEN}${SHORT}${NC} ${MUTED}# Interactive TUI (short command)${NC}" -echo -e " ${GREEN}${APP}${NC} ${MUTED}# Same thing, full name${NC}" +echo -e " ${GREEN}${APP}${NC} ${MUTED}# Interactive TUI${NC}" echo -e " ${GREEN}${ALIAS}${NC} ${MUTED}# Alias for ${APP}${NC}" -echo -e " ${GREEN}${SHORT} -p \"...\"${NC} ${MUTED}# Headless one-shot${NC}" +echo -e " ${GREEN}${APP} -p \"...\"${NC} ${MUTED}# Headless one-shot${NC}" echo "" echo -e " ${MUTED}Restart your shell or run: source ${shell_rc:-~/.bashrc}${NC}" diff --git a/npm/package.json b/npm/package.json index 3150fd7a..100d9e32 100644 --- a/npm/package.json +++ b/npm/package.json @@ -24,7 +24,6 @@ "author": "OpenCoven (based on Claurst by Kuber Mehta)", "bin": { "coven-code": "bin/coven-code", - "coven": "bin/coven-code", "coven-cave": "bin/coven-code" }, "scripts": { diff --git a/scripts/prepare-npm-package.test.mjs b/scripts/prepare-npm-package.test.mjs index 5fa0ba0d..bf8a128d 100644 --- a/scripts/prepare-npm-package.test.mjs +++ b/scripts/prepare-npm-package.test.mjs @@ -41,7 +41,6 @@ function readJson(file) { assert.equal(pkg.version, '1.2.3'); assert.deepEqual(pkg.bin, { 'coven-code': 'bin/coven-code', - coven: 'bin/coven-code', 'coven-cave': 'bin/coven-code', }); assert.match(readme, /^# coven-code$/m);