Skip to content

Commit cd8a4dd

Browse files
BunsDevCopilot
andauthored
fix(npm): drop the coven bin alias to end the @opencoven/cli collision (#140)
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>
1 parent a49dfdc commit cd8a4dd

9 files changed

Lines changed: 28 additions & 27 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Recent highlights:
4545
npm install -g @opencoven/coven-code
4646
```
4747

48-
Then open a new terminal and run `coven-code`. The `coven` and `coven-cave` aliases are also installed.
48+
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.)
4949

5050
### Upgrade
5151

docs/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ Cast `/incant caveman` or `/incant rocky` to compress model responses by 40–85
7676
npm install -g @opencoven/coven-code
7777
```
7878

79-
The package installs the `coven-code` CLI (with `coven` and `coven-cave`
80-
aliases). Run `coven-code` with no arguments for the interactive UI. See
79+
The package installs the `coven-code` CLI (with a `coven-cave` alias). Run
80+
`coven-code` with no arguments for the interactive UI. The bare `coven`
81+
command belongs to the Coven daemon CLI (`@opencoven/cli`). See
8182
[Installation](installation)
8283
for npm, bun, standalone binary, and source install options.
8384

@@ -90,7 +91,7 @@ export ANTHROPIC_API_KEY=sk-ant-...
9091
**3. Run interactively**
9192

9293
```bash
93-
coven
94+
coven-code
9495
```
9596

9697
Or launch a direct harness session:

docs/installation.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ Releases — no compilation needed. After installation, run:
4141
coven-code
4242
```
4343

44-
The installed command is `coven-code`; `coven` and `coven-cave` are installed
45-
as aliases for the same CLI.
44+
The installed command is `coven-code`; `coven-cave` is installed as an alias
45+
for the same CLI. The bare `coven` command is owned by the Coven daemon CLI
46+
(`@opencoven/cli`) and is not installed by this package.
4647

4748
You can also run Coven Code without a permanent install:
4849

@@ -297,15 +298,15 @@ cross build --release --locked --package claurst --target aarch64-unknown-linux-
297298
## Shell Completions
298299

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

303304
```bash
304305
# bash — add to ~/.bashrc
305-
complete -C coven coven
306+
complete -C coven-code coven-code
306307

307308
# zsh — add to ~/.zshrc (requires compinit)
308-
compdef _gnu_generic coven
309+
compdef _gnu_generic coven-code
309310
```
310311

311312
Richer completion scripts may be added in a future release.

docs/src/content/getting-started.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function render() {
1010
<h3>npm</h3>
1111
<pre><code data-lang="bash">npm install -g @opencoven/coven-code</code></pre>
1212
13-
<p>This installs the <code>coven-code</code> CLI (with <code>coven</code> and <code>coven-cave</code> aliases). Run <code>coven-code</code> with no arguments for the interactive UI.</p>
13+
<p>This installs the <code>coven-code</code> CLI (with a <code>coven-cave</code> alias). Run <code>coven-code</code> with no arguments for the interactive UI. The bare <code>coven</code> command belongs to the Coven daemon CLI (<code>@opencoven/cli</code>).</p>
1414
1515
<h3>From Source</h3>
1616
<pre><code data-lang="bash">git clone https://github.com/OpenCoven/coven-code

docs/src/content/installation.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function render() {
2424
# or
2525
bun install -g @opencoven/coven-code</code></pre>
2626
27-
<p>The installed command is <code>coven-code</code>; <code>coven</code> and <code>coven-cave</code> are installed as aliases for the same CLI. Run <code>coven-code</code> with no arguments for the interactive UI. The postinstall script downloads the correct pre-built binary from GitHub Releases — no compilation needed.</p>
27+
<p>The installed command is <code>coven-code</code>; <code>coven-cave</code> is installed as an alias for the same CLI. The bare <code>coven</code> command is owned by the Coven daemon CLI (<code>@opencoven/cli</code>) and is not installed by this package. Run <code>coven-code</code> with no arguments for the interactive UI. The postinstall script downloads the correct pre-built binary from GitHub Releases — no compilation needed.</p>
2828
2929
<pre><code data-lang="bash">npx @opencoven/coven-code
3030
bunx @opencoven/coven-code</code></pre>
@@ -115,13 +115,13 @@ sudo pacman -S base-devel pkgconf openssl</code></pre>
115115
116116
<h2>Shell Completions</h2>
117117
118-
<p>Coven does not currently ship a dedicated completions subcommand. All flags can be discovered via <code>coven --help</code>. If you want basic tab completion in bash or zsh, use the generic completion helper built into your shell:</p>
118+
<p>Coven does not currently ship a dedicated completions subcommand. All flags can be discovered via <code>coven-code --help</code>. If you want basic tab completion in bash or zsh, use the generic completion helper built into your shell:</p>
119119
120120
<pre><code data-lang="bash"># bash — add to ~/.bashrc
121-
complete -C coven coven
121+
complete -C coven-code coven-code
122122
123123
# zsh — add to ~/.zshrc (requires compinit)
124-
compdef _gnu_generic coven</code></pre>
124+
compdef _gnu_generic coven-code</code></pre>
125125
126126
<h2>Uninstalling</h2>
127127

install.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,23 +168,23 @@ function Install-FromBinary {
168168

169169
function Install-Binary($source) {
170170
$target = Join-Path $InstallDir 'coven-code.exe'
171-
$shortTarget = Join-Path $InstallDir 'coven.exe'
172171
$aliasTarget = Join-Path $InstallDir 'coven-cave.exe'
172+
# `coven.exe` belongs to the Coven daemon CLI (@opencoven/cli); older
173+
# installers shipped it as an alias, so clean it up on upgrade.
174+
$staleShort = Join-Path $InstallDir 'coven.exe'
173175

174176
# The currently running coven-code.exe (if any) holds an exclusive file lock on
175177
# Windows. Try to swap by renaming the old one first.
176-
foreach ($path in @($target, $shortTarget, $aliasTarget)) {
178+
foreach ($path in @($target, $aliasTarget, $staleShort)) {
177179
if (-not (Test-Path $path)) { continue }
178180
$stale = "$path.old"
179181
if (Test-Path $stale) { Remove-Item -Force $stale -ErrorAction SilentlyContinue }
180182
try { Move-Item -Force $path $stale } catch { }
181183
}
182184

183185
Copy-Item -Force $source $target
184-
Copy-Item -Force $source $shortTarget
185186
Copy-Item -Force $source $aliasTarget
186187
Write-Success "Installed: $target"
187-
Write-Success "Installed short command: $shortTarget"
188188
Write-Success "Installed alias: $aliasTarget"
189189
}
190190

install.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ set -euo pipefail
1414

1515
APP=coven-code
1616
ALIAS=coven-cave
17-
SHORT=coven
1817
REPO=OpenCoven/coven-code
1918

2019
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'
@@ -116,8 +115,11 @@ fi
116115

117116
ln -sf "${APP}" "${INSTALL_DIR}/${ALIAS}" || cp "${INSTALL_DIR}/${APP}" "${INSTALL_DIR}/${ALIAS}"
118117
chmod +x "${INSTALL_DIR}/${ALIAS}"
119-
ln -sf "${APP}" "${INSTALL_DIR}/${SHORT}" || cp "${INSTALL_DIR}/${APP}" "${INSTALL_DIR}/${SHORT}"
120-
chmod +x "${INSTALL_DIR}/${SHORT}"
118+
# Remove any `coven` symlink left by older installers — that name belongs to
119+
# the Coven daemon CLI (@opencoven/cli).
120+
if [[ -L "${INSTALL_DIR}/coven" ]]; then
121+
rm -f "${INSTALL_DIR}/coven"
122+
fi
121123

122124
# PATH setup
123125
shell_rc=""
@@ -135,11 +137,10 @@ if [[ -n "$shell_rc" ]] && ! grep -qF "$INSTALL_DIR" "$shell_rc" 2>/dev/null; th
135137
fi
136138

137139
print_message success "${APP} v${specific_version} installed to ${INSTALL_DIR}/${APP}"
138-
print_message success "${SHORT} + ${ALIAS} aliases installed to ${INSTALL_DIR}"
140+
print_message success "${ALIAS} alias installed to ${INSTALL_DIR}"
139141
echo ""
140-
echo -e " ${GREEN}${SHORT}${NC} ${MUTED}# Interactive TUI (short command)${NC}"
141-
echo -e " ${GREEN}${APP}${NC} ${MUTED}# Same thing, full name${NC}"
142+
echo -e " ${GREEN}${APP}${NC} ${MUTED}# Interactive TUI${NC}"
142143
echo -e " ${GREEN}${ALIAS}${NC} ${MUTED}# Alias for ${APP}${NC}"
143-
echo -e " ${GREEN}${SHORT} -p \"...\"${NC} ${MUTED}# Headless one-shot${NC}"
144+
echo -e " ${GREEN}${APP} -p \"...\"${NC} ${MUTED}# Headless one-shot${NC}"
144145
echo ""
145146
echo -e " ${MUTED}Restart your shell or run: source ${shell_rc:-~/.bashrc}${NC}"

npm/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"author": "OpenCoven (based on Claurst by Kuber Mehta)",
2525
"bin": {
2626
"coven-code": "bin/coven-code",
27-
"coven": "bin/coven-code",
2827
"coven-cave": "bin/coven-code"
2928
},
3029
"scripts": {

scripts/prepare-npm-package.test.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ function readJson(file) {
4141
assert.equal(pkg.version, '1.2.3');
4242
assert.deepEqual(pkg.bin, {
4343
'coven-code': 'bin/coven-code',
44-
coven: 'bin/coven-code',
4544
'coven-cave': 'bin/coven-code',
4645
});
4746
assert.match(readme, /^# coven-code$/m);

0 commit comments

Comments
 (0)