cloach 0.1.0

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.
Files changed (3) hide show
  1. package/README.md +50 -0
  2. package/bin/cloach.js +65 -0
  3. package/package.json +39 -0
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # cloach
2
+
3
+ AI pair-programmer coach for Claude Code. Launches Claude Code inside a tmux session with a real-time coaching side panel that evaluates your prompts and provides educational commentary as you work.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g cloach
9
+ ```
10
+
11
+ `cloach` ships native binaries for macOS and Linux as platform-specific optional dependencies. npm picks the right one at install time — no postinstall download, no compilation.
12
+
13
+ | Platform | Architecture |
14
+ |----------|--------------|
15
+ | macOS | arm64, x64 |
16
+ | Linux | x64, arm64 |
17
+
18
+ ## Runtime requirements
19
+
20
+ `cloach` is a launcher — it does not bundle these. You must have them on your `PATH`:
21
+
22
+ - [`tmux`](https://github.com/tmux/tmux) — the coaching panel runs in a tmux pane next to Claude Code
23
+ - [`claude`](https://docs.anthropic.com/en/docs/claude-code) — the Claude Code CLI
24
+
25
+ ## Usage
26
+
27
+ ```bash
28
+ # Launch a coaching session in the current directory
29
+ cloach
30
+
31
+ # Launch with debug logging
32
+ cloach -d
33
+
34
+ # Launch in a specific directory
35
+ cloach -c /path/to/project
36
+
37
+ # Show coaching progress stats
38
+ cloach progress
39
+ ```
40
+
41
+ Run `cloach --help` for the full command list.
42
+
43
+ ## Links
44
+
45
+ - Source: <https://github.com/roihala/coach>
46
+ - Issues: <https://github.com/roihala/coach/issues>
47
+
48
+ ## License
49
+
50
+ MIT
package/bin/cloach.js ADDED
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+ // Cloach launcher.
3
+ // Resolves the platform-specific sub-package installed by npm via
4
+ // optionalDependencies, then execs its bundled binary with the same argv.
5
+
6
+ const { spawnSync } = require("node:child_process");
7
+ const path = require("node:path");
8
+ const fs = require("node:fs");
9
+
10
+ const PLATFORM = process.platform;
11
+ const ARCH = process.arch;
12
+
13
+ // Map Node platform/arch tuples to the cloach sub-package that ships
14
+ // the matching binary. Keep in sync with the matrix in the release workflow.
15
+ const PACKAGES = {
16
+ "darwin-arm64": "cloach-darwin-arm64",
17
+ "darwin-x64": "cloach-darwin-x64",
18
+ "linux-x64": "cloach-linux-x64",
19
+ "linux-arm64": "cloach-linux-arm64",
20
+ };
21
+
22
+ const key = `${PLATFORM}-${ARCH}`;
23
+ const pkg = PACKAGES[key];
24
+
25
+ if (!pkg) {
26
+ console.error(
27
+ `cloach: unsupported platform ${key}. Supported: ${Object.keys(PACKAGES).join(", ")}.`
28
+ );
29
+ console.error(
30
+ "cloach: see https://github.com/roihala/coach for native install instructions."
31
+ );
32
+ process.exit(1);
33
+ }
34
+
35
+ let binaryPath;
36
+ try {
37
+ // Resolve the sub-package's package.json, then locate its bundled binary.
38
+ // require.resolve handles npm/pnpm/yarn hoisting transparently.
39
+ const pkgJsonPath = require.resolve(`${pkg}/package.json`);
40
+ binaryPath = path.join(path.dirname(pkgJsonPath), "bin", "cloach");
41
+ } catch (err) {
42
+ console.error(
43
+ `cloach: platform package "${pkg}" is not installed.`
44
+ );
45
+ console.error(
46
+ "cloach: this usually means npm skipped it during install — try reinstalling with --include=optional."
47
+ );
48
+ process.exit(1);
49
+ }
50
+
51
+ if (!fs.existsSync(binaryPath)) {
52
+ console.error(`cloach: binary missing at ${binaryPath}.`);
53
+ process.exit(1);
54
+ }
55
+
56
+ const result = spawnSync(binaryPath, process.argv.slice(2), {
57
+ stdio: "inherit",
58
+ });
59
+
60
+ if (result.error) {
61
+ console.error(`cloach: failed to launch binary: ${result.error.message}`);
62
+ process.exit(1);
63
+ }
64
+
65
+ process.exit(result.status ?? 0);
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "cloach",
3
+ "version": "0.1.0",
4
+ "description": "AI pair-programmer coach for Claude Code — launches Claude Code in tmux with a real-time coaching side panel.",
5
+ "bin": {
6
+ "cloach": "bin/cloach.js"
7
+ },
8
+ "files": [
9
+ "bin/cloach.js",
10
+ "README.md"
11
+ ],
12
+ "keywords": [
13
+ "claude",
14
+ "claude-code",
15
+ "coach",
16
+ "tmux",
17
+ "cli",
18
+ "ai-pair-programming"
19
+ ],
20
+ "homepage": "https://github.com/roihala/coach",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/roihala/coach.git"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/roihala/coach/issues"
27
+ },
28
+ "author": "roihala",
29
+ "license": "MIT",
30
+ "engines": {
31
+ "node": ">=18"
32
+ },
33
+ "optionalDependencies": {
34
+ "cloach-darwin-arm64": "0.1.0",
35
+ "cloach-darwin-x64": "0.1.0",
36
+ "cloach-linux-x64": "0.1.0",
37
+ "cloach-linux-arm64": "0.1.0"
38
+ }
39
+ }