oneharness-cli 0.3.11
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/README.md +23 -0
- package/bin/oneharness.js +83 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# oneharness
|
|
2
|
+
|
|
3
|
+
One CLI to drive many agentic coding harnesses (Claude Code, Codex, OpenCode,
|
|
4
|
+
Goose, Qwen Code, Crush, Copilot CLI, Cursor) non-interactively and return one
|
|
5
|
+
stable JSON shape.
|
|
6
|
+
|
|
7
|
+
```console
|
|
8
|
+
npm install -g oneharness-cli # installs the `oneharness` command
|
|
9
|
+
oneharness detect --all # which harnesses are installed?
|
|
10
|
+
oneharness run --all --prompt "reply with pong"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This package ships the **prebuilt** `oneharness` binary — no Rust toolchain and
|
|
14
|
+
no compile step. The platform-specific binary is delivered through a
|
|
15
|
+
per-platform optional dependency (`@oneharness/cli-<platform>-<arch>`); npm
|
|
16
|
+
installs only the one matching your OS and CPU. Supported platforms: Linux and
|
|
17
|
+
macOS (x64, arm64) and Windows (x64).
|
|
18
|
+
|
|
19
|
+
Other install paths — PyPI (`pip install oneharness-cli`), the install script,
|
|
20
|
+
crates.io, and building from source — plus full docs are in the
|
|
21
|
+
[project README](https://github.com/nickderobertis/oneharness#readme).
|
|
22
|
+
|
|
23
|
+
MIT licensed.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Launcher for the `oneharness` command installed from the `oneharness-cli` npm
|
|
3
|
+
// package.
|
|
4
|
+
//
|
|
5
|
+
// Like the PyPI wheels (maturin `bindings = "bin"`), the npm distribution
|
|
6
|
+
// carries the *prebuilt* Rust binary — no Rust toolchain, no compile, no
|
|
7
|
+
// download at install time. The platform-specific binary ships inside a
|
|
8
|
+
// per-platform package (`@oneharness/cli-<platform>-<arch>`) declared in this
|
|
9
|
+
// package's `optionalDependencies`; npm installs only the one whose `os`/`cpu`
|
|
10
|
+
// match the host, and this shim resolves it and execs it with the caller's argv.
|
|
11
|
+
//
|
|
12
|
+
// This file is committed source (the version + optionalDependency versions are
|
|
13
|
+
// stamped at publish time by scripts/npm-build.mjs). The per-platform packages
|
|
14
|
+
// are generated per target from the release binaries — see that script.
|
|
15
|
+
|
|
16
|
+
"use strict";
|
|
17
|
+
|
|
18
|
+
const { spawnSync } = require("node:child_process");
|
|
19
|
+
|
|
20
|
+
// process.platform-process.arch -> the platform package that carries the binary.
|
|
21
|
+
// The keys mirror the Rust target matrix in .github/workflows/release.yml and the
|
|
22
|
+
// optionalDependencies in package.json; keep the three in lockstep.
|
|
23
|
+
const PACKAGES = {
|
|
24
|
+
"linux-x64": "@oneharness/cli-linux-x64",
|
|
25
|
+
"linux-arm64": "@oneharness/cli-linux-arm64",
|
|
26
|
+
"darwin-x64": "@oneharness/cli-darwin-x64",
|
|
27
|
+
"darwin-arm64": "@oneharness/cli-darwin-arm64",
|
|
28
|
+
"win32-x64": "@oneharness/cli-win32-x64",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
function fail(message) {
|
|
32
|
+
process.stderr.write(`oneharness: ${message}\n`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function binaryPath() {
|
|
37
|
+
const key = `${process.platform}-${process.arch}`;
|
|
38
|
+
const pkg = PACKAGES[key];
|
|
39
|
+
if (!pkg) {
|
|
40
|
+
fail(
|
|
41
|
+
`unsupported platform ${key}. Prebuilt binaries exist for: ` +
|
|
42
|
+
`${Object.keys(PACKAGES).join(", ")}. ` +
|
|
43
|
+
"Install another way instead: 'pip install oneharness-cli', " +
|
|
44
|
+
"'cargo install oneharness --locked', or the install script at " +
|
|
45
|
+
"https://github.com/nickderobertis/oneharness#install"
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const binName = process.platform === "win32" ? "oneharness.exe" : "oneharness";
|
|
50
|
+
try {
|
|
51
|
+
// Resolve the platform package's manifest, then locate the binary beside it.
|
|
52
|
+
// Resolving package.json (rather than the binary file directly) is portable
|
|
53
|
+
// across Node resolution modes and does not require an `exports` entry for a
|
|
54
|
+
// non-JS asset.
|
|
55
|
+
const path = require("node:path");
|
|
56
|
+
const manifest = require.resolve(`${pkg}/package.json`);
|
|
57
|
+
return path.join(path.dirname(manifest), "bin", binName);
|
|
58
|
+
} catch (_err) {
|
|
59
|
+
fail(
|
|
60
|
+
`the platform package ${pkg} is not installed. This usually means npm ` +
|
|
61
|
+
"skipped optional dependencies (e.g. --no-optional / --omit=optional) " +
|
|
62
|
+
`or the install was for a different platform. Reinstall with optional ` +
|
|
63
|
+
"dependencies enabled, or install another way: 'pip install " +
|
|
64
|
+
"oneharness-cli', 'cargo install oneharness --locked', or the install " +
|
|
65
|
+
"script at https://github.com/nickderobertis/oneharness#install"
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const result = spawnSync(binaryPath(), process.argv.slice(2), {
|
|
71
|
+
stdio: "inherit",
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
if (result.error) {
|
|
75
|
+
fail(`failed to launch the oneharness binary: ${result.error.message}`);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Re-raise a terminating signal so callers observe the true cause; otherwise
|
|
79
|
+
// propagate the child's exit code verbatim (the JSON report is on its stdout).
|
|
80
|
+
if (result.signal) {
|
|
81
|
+
process.kill(process.pid, result.signal);
|
|
82
|
+
}
|
|
83
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "oneharness-cli",
|
|
3
|
+
"version": "0.3.11",
|
|
4
|
+
"description": "One CLI to drive many agentic coding harnesses non-interactively and return uniform JSON.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cli",
|
|
7
|
+
"agent",
|
|
8
|
+
"claude",
|
|
9
|
+
"codex",
|
|
10
|
+
"harness"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/nickderobertis/oneharness",
|
|
13
|
+
"bugs": "https://github.com/nickderobertis/oneharness/issues",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/nickderobertis/oneharness.git"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "Nick DeRobertis",
|
|
20
|
+
"bin": {
|
|
21
|
+
"oneharness": "bin/oneharness.js"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"bin/oneharness.js"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=16"
|
|
28
|
+
},
|
|
29
|
+
"optionalDependencies": {
|
|
30
|
+
"@oneharness/cli-linux-x64": "0.3.11",
|
|
31
|
+
"@oneharness/cli-linux-arm64": "0.3.11",
|
|
32
|
+
"@oneharness/cli-darwin-x64": "0.3.11",
|
|
33
|
+
"@oneharness/cli-darwin-arm64": "0.3.11",
|
|
34
|
+
"@oneharness/cli-win32-x64": "0.3.11"
|
|
35
|
+
}
|
|
36
|
+
}
|