Skip to content

Commit 6fd9365

Browse files
authored
feat(cli): add coven-cave alias
Add coven-cave as an alias for coven-code across npm installs, standalone installers, source builds, and documentation.
1 parent 2b7b002 commit 6fd9365

9 files changed

Lines changed: 58 additions & 8 deletions

File tree

COVEN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ are rebranded. This boundary is explicit and documented below.
2424

2525
| Surface | File(s) | Current value |
2626
|---|---|---|
27-
| Binary name | `src-rust/crates/cli/Cargo.toml` `[[bin]]` | `coven-code` |
27+
| Binary name | `src-rust/crates/cli/src/main.rs`, `src-rust/crates/cli/src/bin/coven-cave.rs` | `coven-code`; `coven-cave` alias |
2828
| npm package | `npm/package.json` | `@opencoven/coven-code` |
2929
| Data/cache dirs | `src-rust/crates/core/src/snapshot/`, `skill_discovery.rs`, `update_check.rs`, `app.rs` | `coven-code/` |
3030
| Env var prefix | throughout `src-rust/` | `COVEN_CODE_*` |

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Recent highlights:
4343
npm install -g @opencoven/coven-code
4444
```
4545

46-
Then open a new terminal and run `coven-code`.
46+
Then open a new terminal and run `coven-code`. `coven-cave` is also installed as an alias for the same CLI.
4747

4848
### Upgrade
4949

@@ -74,7 +74,7 @@ Each archive contains a single `coven-code` (or `coven-code.exe`) binary.
7474
```bash
7575
git clone https://github.com/OpenCoven/coven-code.git
7676
cd coven-code/src-rust
77-
cargo build --release --package claurst # binary outputs as coven-code
77+
cargo build --release --package claurst # binary outputs as coven-code; coven-cave is an alias target
7878
```
7979

8080
> Internal Rust crate names (`claurst-core`, `claurst-tui`, etc.) are preserved from upstream for merge-friendliness. The compiled binary is named `coven-code`.

docs/installation.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ npm install -g @opencoven/coven-code
7979
bun install -g @opencoven/coven-code
8080
```
8181

82-
After installation, run `coven-code` directly from your terminal.
82+
After installation, run `coven-code` directly from your terminal. `coven-cave`
83+
is installed as an alias for the same CLI.
8384

8485
You can also run Coven Code without a permanent install:
8586

@@ -128,6 +129,7 @@ If you'd rather not run an install script, grab archives directly from
128129
| `coven-code-macos-aarch64.tar.gz` | macOS Apple Silicon |
129130

130131
Every archive contains a single binary named `coven-code` (or `coven-code.exe`).
132+
The installers also place `coven-cave` on PATH as an alias for that binary.
131133
Extract it and put it somewhere on your `PATH`. For example on Linux:
132134

133135
```bash

install.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,21 @@ function Install-FromBinary {
168168

169169
function Install-Binary($source) {
170170
$target = Join-Path $InstallDir 'coven-code.exe'
171+
$aliasTarget = Join-Path $InstallDir 'coven-cave.exe'
171172

172173
# The currently running coven-code.exe (if any) holds an exclusive file lock on
173174
# Windows. Try to swap by renaming the old one first.
174-
if (Test-Path $target) {
175-
$stale = "$target.old"
175+
foreach ($path in @($target, $aliasTarget)) {
176+
if (-not (Test-Path $path)) { continue }
177+
$stale = "$path.old"
176178
if (Test-Path $stale) { Remove-Item -Force $stale -ErrorAction SilentlyContinue }
177-
try { Move-Item -Force $target $stale } catch { }
179+
try { Move-Item -Force $path $stale } catch { }
178180
}
179181

180182
Copy-Item -Force $source $target
183+
Copy-Item -Force $source $aliasTarget
181184
Write-Success "Installed: $target"
185+
Write-Success "Installed alias: $aliasTarget"
182186
}
183187

184188
# ----- PATH modification -----
@@ -241,6 +245,7 @@ Write-Host " `$env:ANTHROPIC_API_KEY = 'sk-ant-...'"
241245
Write-Host ""
242246
Write-Muted " # Open a new terminal, then:"
243247
Write-Success " coven-code "
248+
Write-Success " coven-cave "
244249
Write-Muted " # or"
245250
Write-Success " coven-code -p `"...`" "
246251
Write-Host ""

install.sh

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

1515
APP=coven-code
16+
ALIAS=coven-cave
1617
REPO=OpenCoven/coven-code
1718

1819
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'
@@ -112,6 +113,9 @@ else
112113
chmod +x "${INSTALL_DIR}/${APP}"
113114
fi
114115

116+
ln -sf "${APP}" "${INSTALL_DIR}/${ALIAS}" || cp "${INSTALL_DIR}/${APP}" "${INSTALL_DIR}/${ALIAS}"
117+
chmod +x "${INSTALL_DIR}/${ALIAS}"
118+
115119
# PATH setup
116120
shell_rc=""
117121
case "${SHELL:-}" in
@@ -128,8 +132,10 @@ if [[ -n "$shell_rc" ]] && ! grep -qF "$INSTALL_DIR" "$shell_rc" 2>/dev/null; th
128132
fi
129133

130134
print_message success "${APP} v${specific_version} installed to ${INSTALL_DIR}/${APP}"
135+
print_message success "${ALIAS} alias installed to ${INSTALL_DIR}/${ALIAS}"
131136
echo ""
132137
echo -e " ${GREEN}${APP}${NC} ${MUTED}# Interactive TUI${NC}"
138+
echo -e " ${GREEN}${ALIAS}${NC} ${MUTED}# Alias for ${APP}${NC}"
133139
echo -e " ${GREEN}${APP} -p \"...\"${NC} ${MUTED}# Headless one-shot${NC}"
134140
echo ""
135141
echo -e " ${MUTED}Restart your shell or run: source ${shell_rc:-~/.bashrc}${NC}"

npm/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ On install, the correct pre-built native binary for your platform is automatical
2020

2121
```bash
2222
coven-code # interactive TUI
23+
coven-cave # alias for coven-code
2324
coven-code -p "fix this bug" # headless one-shot
2425
```
2526

npm/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
],
2424
"author": "OpenCoven (based on Claurst by Kuber Mehta)",
2525
"bin": {
26-
"coven-code": "bin/coven-code"
26+
"coven-code": "bin/coven-code",
27+
"coven-cave": "bin/coven-code"
2728
},
2829
"scripts": {
2930
"postinstall": "node install.js"

scripts/prepare-npm-package.test.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ function readJson(file) {
3939

4040
assert.equal(pkg.name, 'coven-code');
4141
assert.equal(pkg.version, '1.2.3');
42+
assert.deepEqual(pkg.bin, {
43+
'coven-code': 'bin/coven-code',
44+
'coven-cave': 'bin/coven-code',
45+
});
4246
assert.match(readme, /^# coven-code$/m);
4347
assert.match(readme, /npm\/v\/coven-code\?style=flat-square/);
4448
assert.match(readme, /npmjs\.com\/package\/coven-code/);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
use std::ffi::OsString;
2+
use std::process::{Command, ExitCode};
3+
4+
fn main() -> ExitCode {
5+
let mut target = match std::env::current_exe() {
6+
Ok(path) => path,
7+
Err(error) => {
8+
eprintln!("coven-cave: failed to locate executable path: {error}");
9+
return ExitCode::FAILURE;
10+
}
11+
};
12+
13+
target.set_file_name(if cfg!(windows) {
14+
"coven-code.exe"
15+
} else {
16+
"coven-code"
17+
});
18+
19+
let args: Vec<OsString> = std::env::args_os().skip(1).collect();
20+
match Command::new(&target).args(args).status() {
21+
Ok(status) => match status.code() {
22+
Some(0) => ExitCode::SUCCESS,
23+
Some(code) if (1..=255).contains(&code) => ExitCode::from(code as u8),
24+
_ => ExitCode::FAILURE,
25+
},
26+
Err(error) => {
27+
eprintln!("coven-cave: failed to run {}: {error}", target.display());
28+
ExitCode::FAILURE
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)