forge-cockpit 0.1.2
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 +63 -0
- package/bin/forge-cockpit.js +29 -0
- package/package.json +34 -0
- package/postinstall.js +70 -0
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# forge-cockpit
|
|
2
|
+
|
|
3
|
+
An AI coding agent with a **browser cockpit** — the same agent you drive from the
|
|
4
|
+
terminal, plus platform dashboards and one-click integrations
|
|
5
|
+
(GitHub · Jira · Sentry · Slack · Gmail · Google Calendar). **Bring your own model
|
|
6
|
+
API key.** A fork of [Forge](https://github.com/antinomyhq/forge), Apache-2.0.
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<img src="https://raw.githubusercontent.com/LeyouHong/forge-cockpit/main/docs/img/cockpit.png" alt="forge-cockpit web UI" width="820">
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install -g forge-cockpit
|
|
16
|
+
# or run without installing:
|
|
17
|
+
npx forge-cockpit --help
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
On install, the prebuilt binary for your platform (macOS arm64, Linux x64/arm64,
|
|
21
|
+
Windows x64) is downloaded from the matching GitHub Release — nothing is compiled
|
|
22
|
+
on your machine. (Install with scripts enabled, i.e. not `--ignore-scripts`.)
|
|
23
|
+
|
|
24
|
+
## Bring your own key
|
|
25
|
+
|
|
26
|
+
No hosted account is bundled or required. On first run, log in with **your own**
|
|
27
|
+
model provider key:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
forge-cockpit provider login # pick OpenAI / Anthropic / OpenRouter / …
|
|
31
|
+
forge-cockpit # interactive agent in your terminal
|
|
32
|
+
forge-cockpit serve # open the browser cockpit
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## The cockpit
|
|
36
|
+
|
|
37
|
+
`forge-cockpit serve` opens a local browser UI (bound to `127.0.0.1`, gated by a
|
|
38
|
+
per-run token):
|
|
39
|
+
|
|
40
|
+
- **💬 Chat** — the full agent: streaming responses, tool-call chips, resumable
|
|
41
|
+
turns (refresh mid-run without losing progress).
|
|
42
|
+
- **📋 Dashboard** — read-only boards over your connected platforms.
|
|
43
|
+
- **🧩 Integrations** — one-click connect to MCP servers (read **and** write).
|
|
44
|
+
|
|
45
|
+
<p align="center">
|
|
46
|
+
<img src="https://raw.githubusercontent.com/LeyouHong/forge-cockpit/main/docs/img/dashboard.png" alt="Dashboard" width="820">
|
|
47
|
+
</p>
|
|
48
|
+
<p align="center">
|
|
49
|
+
<img src="https://raw.githubusercontent.com/LeyouHong/forge-cockpit/main/docs/img/integrations.png" alt="Integrations" width="820">
|
|
50
|
+
</p>
|
|
51
|
+
|
|
52
|
+
## Docs & source
|
|
53
|
+
|
|
54
|
+
Full documentation, architecture, and build-from-source instructions:
|
|
55
|
+
**https://github.com/LeyouHong/forge-cockpit**
|
|
56
|
+
|
|
57
|
+
## Notes
|
|
58
|
+
|
|
59
|
+
- **Linux:** the binary dynamically links OpenSSL (`libssl`) for IMAP email
|
|
60
|
+
support; present on virtually all distros (`libssl3` if missing).
|
|
61
|
+
- **Intel Mac (x64):** no prebuilt binary yet — build from source.
|
|
62
|
+
- License: Apache-2.0. A community fork; "Forge" and "forgecode" are trademarks
|
|
63
|
+
of their respective owners, and this package is not affiliated with them.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// Launcher: exec the `forge` binary that postinstall.js downloaded next to this
|
|
5
|
+
// file (bin/forge or bin/forge.exe), forwarding all args and the exit code.
|
|
6
|
+
|
|
7
|
+
const { spawnSync } = require('node:child_process');
|
|
8
|
+
const fs = require('node:fs');
|
|
9
|
+
const path = require('node:path');
|
|
10
|
+
|
|
11
|
+
const exe = process.platform === 'win32' ? 'forge.exe' : 'forge';
|
|
12
|
+
const bin = path.join(__dirname, exe);
|
|
13
|
+
|
|
14
|
+
if (!fs.existsSync(bin)) {
|
|
15
|
+
console.error(
|
|
16
|
+
'forge-cockpit: the binary was not downloaded.\n' +
|
|
17
|
+
'This usually means install scripts were disabled. Reinstall with scripts enabled:\n' +
|
|
18
|
+
' npm install -g forge-cockpit\n' +
|
|
19
|
+
'or build from source: https://github.com/LeyouHong/forge-cockpit#build-from-source'
|
|
20
|
+
);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const result = spawnSync(bin, process.argv.slice(2), { stdio: 'inherit' });
|
|
25
|
+
if (result.error) {
|
|
26
|
+
console.error(`forge-cockpit: failed to launch binary: ${result.error.message}`);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "forge-cockpit",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "An AI coding agent with a browser cockpit (dashboards + one-click integrations). Bring your own model API key. A fork of Forge (Apache-2.0).",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai",
|
|
7
|
+
"agent",
|
|
8
|
+
"coding-agent",
|
|
9
|
+
"cli",
|
|
10
|
+
"mcp",
|
|
11
|
+
"dashboard",
|
|
12
|
+
"forge"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/LeyouHong/forge-cockpit#readme",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/LeyouHong/forge-cockpit.git"
|
|
18
|
+
},
|
|
19
|
+
"license": "Apache-2.0",
|
|
20
|
+
"bin": {
|
|
21
|
+
"forge-cockpit": "bin/forge-cockpit.js"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"postinstall": "node postinstall.js"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"bin/forge-cockpit.js",
|
|
28
|
+
"postinstall.js",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// Downloads the platform-specific `forge` binary from this version's GitHub
|
|
5
|
+
// Release into ./bin, at install time. Single npm package, no per-platform
|
|
6
|
+
// packages. Requires Node >=18 (uses global fetch, which follows redirects).
|
|
7
|
+
|
|
8
|
+
const fs = require('node:fs');
|
|
9
|
+
const path = require('node:path');
|
|
10
|
+
const { version } = require('./package.json');
|
|
11
|
+
|
|
12
|
+
const REPO = 'LeyouHong/forge-cockpit';
|
|
13
|
+
|
|
14
|
+
// host key -> release asset platform suffix
|
|
15
|
+
const PLATFORMS = {
|
|
16
|
+
'darwin arm64': 'darwin-arm64',
|
|
17
|
+
'linux x64': 'linux-x64',
|
|
18
|
+
'linux arm64': 'linux-arm64',
|
|
19
|
+
'win32 x64': 'win32-x64',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
async function main() {
|
|
23
|
+
const key = `${process.platform} ${process.arch}`;
|
|
24
|
+
const suffix = PLATFORMS[key];
|
|
25
|
+
if (!suffix) {
|
|
26
|
+
console.warn(
|
|
27
|
+
`forge-cockpit: no prebuilt binary for "${key}". ` +
|
|
28
|
+
`Supported: ${Object.keys(PLATFORMS).join(', ')}. ` +
|
|
29
|
+
`You can still build from source: https://github.com/${REPO}#build-from-source`
|
|
30
|
+
);
|
|
31
|
+
return; // don't hard-fail the install
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const isWin = process.platform === 'win32';
|
|
35
|
+
const ext = isWin ? '.exe' : '';
|
|
36
|
+
const asset = `forge-cockpit-${suffix}${ext}`;
|
|
37
|
+
const url = `https://github.com/${REPO}/releases/download/release-v${version}/${asset}`;
|
|
38
|
+
|
|
39
|
+
const binDir = path.join(__dirname, 'bin');
|
|
40
|
+
const dest = path.join(binDir, `forge${ext}`);
|
|
41
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
42
|
+
|
|
43
|
+
process.stdout.write(`forge-cockpit: downloading ${asset} (v${version})… `);
|
|
44
|
+
let lastErr;
|
|
45
|
+
for (let attempt = 1; attempt <= 3; attempt++) {
|
|
46
|
+
try {
|
|
47
|
+
const res = await fetch(url, { redirect: 'follow' });
|
|
48
|
+
if (!res.ok) throw new Error(`HTTP ${res.status} for ${url}`);
|
|
49
|
+
const buf = Buffer.from(await res.arrayBuffer());
|
|
50
|
+
fs.writeFileSync(dest, buf);
|
|
51
|
+
if (!isWin) fs.chmodSync(dest, 0o755);
|
|
52
|
+
console.log('done.');
|
|
53
|
+
return;
|
|
54
|
+
} catch (e) {
|
|
55
|
+
lastErr = e;
|
|
56
|
+
if (attempt < 3) await new Promise((r) => setTimeout(r, 1500 * attempt));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
console.log('failed.');
|
|
60
|
+
console.error(
|
|
61
|
+
`forge-cockpit: could not download the binary (${lastErr && lastErr.message}).\n` +
|
|
62
|
+
`Check your network, or install with scripts enabled (not --ignore-scripts).\n` +
|
|
63
|
+
`Manual: download ${url} to ${dest}`
|
|
64
|
+
);
|
|
65
|
+
// Non-fatal: leave the launcher to report a clear error if run without a binary.
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
main().catch((e) => {
|
|
69
|
+
console.error('forge-cockpit: postinstall error:', e && e.message ? e.message : e);
|
|
70
|
+
});
|