ask-colleague 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +4 -4
- package/README.md +19 -10
- package/bin/colleague +1 -1
- package/bin/colleague.js +57 -0
- package/docs/publishing.md +15 -47
- package/package.json +3 -3
package/CONTRIBUTING.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
|
-
Thanks for improving
|
|
3
|
+
Thanks for improving Ask Colleague.
|
|
4
4
|
|
|
5
5
|
## Local checks
|
|
6
6
|
|
|
@@ -13,9 +13,9 @@ bash -n bin/colleague install.sh uninstall.sh scripts/ask-codex.sh scripts/ask-c
|
|
|
13
13
|
For an end-to-end local `npx` check:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm pack --pack-destination /tmp
|
|
17
|
-
npx --yes --package
|
|
18
|
-
npx --yes --package
|
|
16
|
+
tgz="/tmp/$(npm pack --pack-destination /tmp | tail -n 1)"
|
|
17
|
+
npx --yes --package "$tgz" ask-colleague --version
|
|
18
|
+
npx --yes --package "$tgz" ask-colleague install --dry-run
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Design constraints
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Ask Colleague
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/ask-colleague)
|
|
4
|
+
|
|
3
5
|
A tiny, self-contained bridge that lets one local AI coding CLI ask another local AI coding CLI for a one-shot second opinion.
|
|
4
6
|
|
|
5
7
|
The default flow:
|
|
@@ -30,8 +32,6 @@ That makes “ask a colleague” just a local shell bridge:
|
|
|
30
32
|
|
|
31
33
|
## Install with npx
|
|
32
34
|
|
|
33
|
-
After this package is published to npm:
|
|
34
|
-
|
|
35
35
|
```bash
|
|
36
36
|
npx ask-colleague@latest install
|
|
37
37
|
```
|
|
@@ -91,6 +91,10 @@ npx ask-colleague@latest uninstall
|
|
|
91
91
|
|
|
92
92
|
Uninstall removes only files recorded in `~/.ask-colleague/install-manifest.tsv` and only if their checksums still match. If you edited an installed skill or prompt, uninstall leaves it in place and tells you to use `--force` if you really want it removed.
|
|
93
93
|
|
|
94
|
+
### Windows
|
|
95
|
+
|
|
96
|
+
`colleague` is a Bash CLI. On Windows, run everything — `npx`, the install, and the `claude`/`codex` CLIs — inside WSL (recommended) or Git Bash (best effort). Running `npx ask-colleague@latest install` from PowerShell or cmd.exe prints setup guidance instead of failing on a missing Bash.
|
|
97
|
+
|
|
94
98
|
## Install from source
|
|
95
99
|
|
|
96
100
|
```bash
|
|
@@ -261,7 +265,8 @@ Good question:
|
|
|
261
265
|
|
|
262
266
|
```text
|
|
263
267
|
ask-colleague/
|
|
264
|
-
bin/colleague # main bridge CLI
|
|
268
|
+
bin/colleague # main bridge CLI (Bash)
|
|
269
|
+
bin/colleague.js # Node launcher for the npm bin (Windows-safe)
|
|
265
270
|
package.json # npm package metadata and bin mappings
|
|
266
271
|
scripts/ask-codex.sh # compatibility wrapper
|
|
267
272
|
scripts/ask-claude.sh # compatibility wrapper
|
|
@@ -278,6 +283,10 @@ ask-colleague/
|
|
|
278
283
|
|
|
279
284
|
## Troubleshooting
|
|
280
285
|
|
|
286
|
+
### `WSL ... execvpe(/bin/bash) failed: No such file or directory` on Windows
|
|
287
|
+
|
|
288
|
+
Older versions (0.1.0) pointed the npm bin directly at the Bash script, so PowerShell invoked the WSL bash stub, which fails like this when no Linux distribution is installed. Upgrade with `npx ask-colleague@latest install` — current versions detect this and print setup guidance. Then run the bridge inside WSL or Git Bash as described in the Windows section above.
|
|
289
|
+
|
|
281
290
|
### `colleague: codex CLI not found in PATH`
|
|
282
291
|
|
|
283
292
|
Install Codex CLI and confirm `codex --version` works in the same shell where Claude Code or Codex is running.
|
|
@@ -331,12 +340,14 @@ The smoke tests use dry-run and mocked CLI paths, so they do not require authent
|
|
|
331
340
|
```json
|
|
332
341
|
{
|
|
333
342
|
"bin": {
|
|
334
|
-
"ask-colleague": "bin/colleague",
|
|
335
|
-
"colleague": "bin/colleague"
|
|
343
|
+
"ask-colleague": "bin/colleague.js",
|
|
344
|
+
"colleague": "bin/colleague.js"
|
|
336
345
|
}
|
|
337
346
|
}
|
|
338
347
|
```
|
|
339
348
|
|
|
349
|
+
`bin/colleague.js` is a tiny Node launcher that delegates to the Bash CLI. It exists because npm's Windows shims would otherwise hand the Bash script to the WSL bash stub, which fails cryptically when no Linux distribution is installed. The launcher runs the script with a real Bash where one exists and prints setup guidance otherwise.
|
|
350
|
+
|
|
340
351
|
This means:
|
|
341
352
|
|
|
342
353
|
```bash
|
|
@@ -359,15 +370,13 @@ Before publishing, test the exact tarball that npm would distribute:
|
|
|
359
370
|
```bash
|
|
360
371
|
npm test
|
|
361
372
|
npm pack --dry-run
|
|
362
|
-
npm pack --pack-destination /tmp
|
|
363
|
-
npx --yes --package
|
|
364
|
-
npx --yes --package
|
|
373
|
+
tgz="/tmp/$(npm pack --pack-destination /tmp | tail -n 1)"
|
|
374
|
+
npx --yes --package "$tgz" ask-colleague --version
|
|
375
|
+
npx --yes --package "$tgz" ask-colleague install --dry-run
|
|
365
376
|
```
|
|
366
377
|
|
|
367
378
|
## Publish to npm
|
|
368
379
|
|
|
369
|
-
Before publishing, check the package name and add repository metadata to `package.json` if you have a public repo URL ready.
|
|
370
|
-
|
|
371
380
|
```bash
|
|
372
381
|
npm login
|
|
373
382
|
npm publish --access public
|
package/bin/colleague
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Works with Codex (`codex exec -`) and Claude Code (`cat prompt | claude -p ...`).
|
|
4
4
|
set -euo pipefail
|
|
5
5
|
|
|
6
|
-
VERSION="0.
|
|
6
|
+
VERSION="0.1.1"
|
|
7
7
|
DEFAULT_MAX_BYTES="${COLLEAGUE_MAX_CONTEXT_BYTES:-120000}"
|
|
8
8
|
STATE_DIR="${COLLEAGUE_STATE_DIR:-$HOME/.ask-colleague}"
|
|
9
9
|
MANIFEST="$STATE_DIR/install-manifest.tsv"
|
package/bin/colleague.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// npm bin launcher for the Bash CLI in bin/colleague.
|
|
3
|
+
//
|
|
4
|
+
// npm's Windows shims execute the shebang interpreter directly. For a Bash
|
|
5
|
+
// script in PowerShell/cmd.exe that resolves to the WSL bash stub, which fails
|
|
6
|
+
// with a cryptic "execvpe(/bin/bash) failed" error when no Linux distribution
|
|
7
|
+
// is installed. Routing the bin through Node (always present under npx) lets
|
|
8
|
+
// us delegate to a working Bash where one exists and print actionable
|
|
9
|
+
// guidance where one does not.
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
const { spawnSync } = require('child_process');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
|
|
15
|
+
const script = path.join(__dirname, 'colleague');
|
|
16
|
+
const args = process.argv.slice(2);
|
|
17
|
+
|
|
18
|
+
function fail(message) {
|
|
19
|
+
process.stderr.write(message);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const WINDOWS_HELP = [
|
|
24
|
+
'ask-colleague: this command needs Bash, which is not available in this Windows shell.',
|
|
25
|
+
'',
|
|
26
|
+
'The Claude Code <-> Codex bridge is a Bash CLI, so on Windows it runs inside',
|
|
27
|
+
'WSL or Git Bash:',
|
|
28
|
+
'',
|
|
29
|
+
' WSL (recommended):',
|
|
30
|
+
' 1. Install WSL: https://learn.microsoft.com/windows/wsl/install',
|
|
31
|
+
' 2. Open a WSL shell (e.g. Ubuntu) and run: npx ask-colleague@latest install',
|
|
32
|
+
' The claude / codex CLIs must also be installed inside WSL.',
|
|
33
|
+
'',
|
|
34
|
+
' Git Bash (best effort):',
|
|
35
|
+
' Run the same npx command from a Git Bash terminal.',
|
|
36
|
+
'',
|
|
37
|
+
'If you saw a "WSL ... execvpe(/bin/bash) failed" error, Windows invoked the',
|
|
38
|
+
'WSL bash stub without a Linux distribution installed.',
|
|
39
|
+
'',
|
|
40
|
+
].join('\n');
|
|
41
|
+
|
|
42
|
+
if (process.platform === 'win32') {
|
|
43
|
+
// Only proceed with a Bash that understands Windows paths (Git Bash/MSYS,
|
|
44
|
+
// Cygwin). The WSL stub either fails outright (no distro) or cannot read
|
|
45
|
+
// the Windows path of the script we need to hand it.
|
|
46
|
+
const probe = spawnSync('bash', ['-c', 'echo $OSTYPE'], { encoding: 'utf8' });
|
|
47
|
+
const ostype = (probe.stdout || '').trim();
|
|
48
|
+
if (probe.error || probe.status !== 0 || !/^(msys|cygwin)/.test(ostype)) {
|
|
49
|
+
fail(WINDOWS_HELP);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const result = spawnSync('bash', [script, ...args], { stdio: 'inherit' });
|
|
54
|
+
if (result.error && result.error.code === 'ENOENT') {
|
|
55
|
+
fail('ask-colleague: bash not found in PATH. Install Bash, or on Windows run inside WSL or Git Bash.\n');
|
|
56
|
+
}
|
|
57
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/docs/publishing.md
CHANGED
|
@@ -8,46 +8,15 @@ npx ask-colleague@latest install
|
|
|
8
8
|
|
|
9
9
|
`npx` runs the npm package's executable once. The executable then copies the long-lived `colleague` command and both skill files into the user's home directory, recording checksums in `~/.ask-colleague/install-manifest.tsv`.
|
|
10
10
|
|
|
11
|
-
## 1.
|
|
11
|
+
## 1. Check package metadata
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`package.json` must agree with the rest of the repo before each publish:
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Before publishing, check that the package name is available. If it is taken, use a scoped package name instead:
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
"name": "@your-scope/ask-colleague"
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
With a scoped name, the install command becomes:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
npx @your-scope/ask-colleague@latest install
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## 2. Add public repository metadata
|
|
32
|
-
|
|
33
|
-
This starter package intentionally does not include fake GitHub metadata. Before publishing from your real repo, add fields like:
|
|
34
|
-
|
|
35
|
-
```json
|
|
36
|
-
{
|
|
37
|
-
"homepage": "https://github.com/<owner>/<repo>#readme",
|
|
38
|
-
"repository": {
|
|
39
|
-
"type": "git",
|
|
40
|
-
"url": "git+https://github.com/<owner>/<repo>.git"
|
|
41
|
-
},
|
|
42
|
-
"bugs": {
|
|
43
|
-
"url": "https://github.com/<owner>/<repo>/issues"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Also replace `<your-ask-colleague-repo-url>` in `README.md`.
|
|
15
|
+
- `version` matches `VERSION` in `bin/colleague` and the version checks in `tests/smoke.sh`
|
|
16
|
+
- `homepage`, `repository`, and `bugs` point at the public GitHub repo
|
|
17
|
+
- `bin` maps both `ask-colleague` and `colleague` to `bin/colleague.js`
|
|
49
18
|
|
|
50
|
-
##
|
|
19
|
+
## 2. Run local checks
|
|
51
20
|
|
|
52
21
|
```bash
|
|
53
22
|
npm test
|
|
@@ -57,14 +26,12 @@ npm pack --dry-run
|
|
|
57
26
|
Then build a real local tarball and run it through `npx`:
|
|
58
27
|
|
|
59
28
|
```bash
|
|
60
|
-
npm pack --pack-destination /tmp
|
|
61
|
-
npx --yes --package
|
|
62
|
-
npx --yes --package
|
|
29
|
+
tgz="/tmp/$(npm pack --pack-destination /tmp | tail -n 1)"
|
|
30
|
+
npx --yes --package "$tgz" ask-colleague --version
|
|
31
|
+
npx --yes --package "$tgz" ask-colleague install --dry-run
|
|
63
32
|
```
|
|
64
33
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
## 4. Inspect package contents
|
|
34
|
+
## 3. Inspect package contents
|
|
68
35
|
|
|
69
36
|
Make sure the npm tarball includes only what users need:
|
|
70
37
|
|
|
@@ -80,6 +47,7 @@ README.md
|
|
|
80
47
|
LICENSE
|
|
81
48
|
CONTRIBUTING.md
|
|
82
49
|
bin/colleague
|
|
50
|
+
bin/colleague.js
|
|
83
51
|
install.sh
|
|
84
52
|
uninstall.sh
|
|
85
53
|
scripts/ask-codex.sh
|
|
@@ -95,7 +63,7 @@ docs/security.md
|
|
|
95
63
|
docs/publishing.md
|
|
96
64
|
```
|
|
97
65
|
|
|
98
|
-
##
|
|
66
|
+
## 4. Publish
|
|
99
67
|
|
|
100
68
|
```bash
|
|
101
69
|
npm login
|
|
@@ -104,7 +72,7 @@ npm publish --access public
|
|
|
104
72
|
|
|
105
73
|
For scoped packages, `--access public` is required unless your npm account/org has different defaults.
|
|
106
74
|
|
|
107
|
-
##
|
|
75
|
+
## 5. Verify public install
|
|
108
76
|
|
|
109
77
|
After npm finishes publishing:
|
|
110
78
|
|
|
@@ -128,7 +96,7 @@ colleague uninstall --dry-run
|
|
|
128
96
|
colleague uninstall
|
|
129
97
|
```
|
|
130
98
|
|
|
131
|
-
##
|
|
99
|
+
## 6. Optional AGENTS.md fallback
|
|
132
100
|
|
|
133
101
|
Do not enable the global Codex AGENTS.md fallback by default in release notes. Users who want it can opt in:
|
|
134
102
|
|
|
@@ -136,7 +104,7 @@ Do not enable the global Codex AGENTS.md fallback by default in release notes. U
|
|
|
136
104
|
npx ask-colleague@latest install --agents-md
|
|
137
105
|
```
|
|
138
106
|
|
|
139
|
-
##
|
|
107
|
+
## 7. Release updates
|
|
140
108
|
|
|
141
109
|
Bump the version before each publish:
|
|
142
110
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ask-colleague",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Ask a colleague, a bridge that lets Claude Code and Codex ask each other for one-shot peer advice.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/stevyhacker/ask-colleague#readme",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"coding-agent"
|
|
23
23
|
],
|
|
24
24
|
"bin": {
|
|
25
|
-
"ask-colleague": "bin/colleague",
|
|
26
|
-
"colleague": "bin/colleague"
|
|
25
|
+
"ask-colleague": "bin/colleague.js",
|
|
26
|
+
"colleague": "bin/colleague.js"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"bin/",
|