@forcefield/forcefield 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 +20 -0
- package/bin/forcefield.js +46 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# forcefield
|
|
2
|
+
|
|
3
|
+
Public alias package for the Forcefield CLI.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -g @forcefield/forcefield
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Use
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
forcefield setup
|
|
15
|
+
forcefield doctor
|
|
16
|
+
forcefield status
|
|
17
|
+
forcefield mcp
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This package delegates to `@forcefield/mcp-server`.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from 'node:child_process';
|
|
4
|
+
import { createRequire } from 'node:module';
|
|
5
|
+
import { accessSync } from 'node:fs';
|
|
6
|
+
import { dirname, join } from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
10
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
|
|
12
|
+
let cliEntry;
|
|
13
|
+
try {
|
|
14
|
+
cliEntry = require.resolve('@forcefield/mcp-server/build/cli/index.js');
|
|
15
|
+
} catch (error) {
|
|
16
|
+
const localFallback = join(__dirname, '..', '..', 'server', 'build', 'cli', 'index.js');
|
|
17
|
+
try {
|
|
18
|
+
accessSync(localFallback);
|
|
19
|
+
cliEntry = localFallback;
|
|
20
|
+
} catch {
|
|
21
|
+
const message = error instanceof Error ? error.message : 'Unknown resolve error';
|
|
22
|
+
process.stderr.write(
|
|
23
|
+
`[fatal] Could not resolve @forcefield/mcp-server CLI entry.\n${message}\n`,
|
|
24
|
+
);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const child = spawn(process.execPath, [cliEntry, ...process.argv.slice(2)], {
|
|
30
|
+
stdio: 'inherit',
|
|
31
|
+
env: process.env,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
child.on('error', (error) => {
|
|
35
|
+
const message = error instanceof Error ? error.message : 'Unknown spawn error';
|
|
36
|
+
process.stderr.write(`[fatal] Failed to launch Forcefield CLI: ${message}\n`);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
child.on('exit', (code, signal) => {
|
|
41
|
+
if (signal) {
|
|
42
|
+
process.kill(process.pid, signal);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
process.exit(code ?? 0);
|
|
46
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@forcefield/forcefield",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Forcefield CLI alias package",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public",
|
|
9
|
+
"tag": "beta"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"forcefield": "bin/forcefield.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin/",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=20.0.0"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/forcefield-ai/forcefield.git"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"forcefield",
|
|
27
|
+
"mcp",
|
|
28
|
+
"compliance"
|
|
29
|
+
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@forcefield/mcp-server": "^0.1.4"
|
|
32
|
+
}
|
|
33
|
+
}
|