allorc-app-cli 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.
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# allorc-app-cli
|
|
2
|
+
|
|
3
|
+
Go-based CLI that combines the current MCP and trigger publishing workflows into one package.
|
|
4
|
+
|
|
5
|
+
## Status
|
|
6
|
+
|
|
7
|
+
- Primary distribution target: npm
|
|
8
|
+
- Python packaging: scaffold only for later work
|
|
9
|
+
- Existing `klasto` and `klasto-trigger-cli` packages are left untouched in this repo
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
```powershell
|
|
14
|
+
allorc init
|
|
15
|
+
allorc validate
|
|
16
|
+
allorc --profile dev publish --dry-run
|
|
17
|
+
allorc --profile dev publish
|
|
18
|
+
allorc --profile prod publish --only mcp
|
|
19
|
+
allorc --profile prod publish --only trigger
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Local dev endpoints
|
|
23
|
+
|
|
24
|
+
The merged package now follows the same local values already used in the older packages:
|
|
25
|
+
|
|
26
|
+
- MCP local host: `http://localhost:9000`
|
|
27
|
+
- Trigger local API base URL: `http://127.0.0.1:8090/api/v1`
|
|
28
|
+
- Trigger local host header: `clastines-server.localhost`
|
|
29
|
+
|
|
30
|
+
Those values are prefilled in the generated `.env.dev`.
|
|
31
|
+
|
|
32
|
+
## Combined manifest
|
|
33
|
+
|
|
34
|
+
Create `allorc-app.json`:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"name": "my-allorc-app",
|
|
39
|
+
"version": "0.1.0",
|
|
40
|
+
"env": {
|
|
41
|
+
"dev": ".env.dev",
|
|
42
|
+
"prod": ".env.prod"
|
|
43
|
+
},
|
|
44
|
+
"mcp": {
|
|
45
|
+
"enabled": true,
|
|
46
|
+
"manifest": "clastines-toolkit.json"
|
|
47
|
+
},
|
|
48
|
+
"trigger": {
|
|
49
|
+
"enabled": true,
|
|
50
|
+
"manifest": "clastines-trigger.json"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`publish` reads this manifest, loads the selected env file, validates the referenced manifests, then publishes both enabled components unless `--only` narrows the scope.
|
|
56
|
+
|
|
57
|
+
## Scaffold output
|
|
58
|
+
|
|
59
|
+
`allorc init` creates:
|
|
60
|
+
|
|
61
|
+
- `allorc-app.json`
|
|
62
|
+
- `clastines-toolkit.json`
|
|
63
|
+
- `clastines-trigger.json`
|
|
64
|
+
- `.env.dev`
|
|
65
|
+
- `.env.prod`
|
|
66
|
+
- `package.json`
|
|
67
|
+
- `tsconfig.json`
|
|
68
|
+
- `src/server.ts`
|
|
69
|
+
- `.allorc/identity.json`
|
|
70
|
+
|
|
71
|
+
## Build the Go CLI
|
|
72
|
+
|
|
73
|
+
From this directory:
|
|
74
|
+
|
|
75
|
+
```powershell
|
|
76
|
+
go build -o .\allorc.exe .\cmd\allorc-app-cli
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## npm packaging
|
|
80
|
+
|
|
81
|
+
The npm wrapper lives in `packages/npm`, but the repo root now contains the publishable `package.json` so you can publish directly from `allorc-app-cli`.
|
|
82
|
+
|
|
83
|
+
Typical flow:
|
|
84
|
+
|
|
85
|
+
```powershell
|
|
86
|
+
go build -o .\allorc.exe .\cmd\allorc-app-cli
|
|
87
|
+
npm run stage-binary -- --source .\allorc.exe --target win32-x64
|
|
88
|
+
npm run check-binaries
|
|
89
|
+
npm publish
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
For a real public release, stage all supported platform binaries before publishing.
|
|
93
|
+
|
|
94
|
+
## Python packaging
|
|
95
|
+
|
|
96
|
+
The Python scaffold lives in `packages/pip`. It is intentionally not wired for binary shipping yet; the folder exists to keep the future wheel and sdist work scoped and documented.
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "allorc-app-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "npm wrapper for the Allorc App Go CLI",
|
|
5
|
+
"private": false,
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public",
|
|
9
|
+
"registry": "https://registry.npmjs.org/"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"allorc": "packages/npm/bin/allorc.js",
|
|
13
|
+
"allorc-app-cli": "packages/npm/bin/allorc.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"README.md",
|
|
17
|
+
"packages/npm/bin",
|
|
18
|
+
"packages/npm/dist"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18.0.0"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"stage-binary": "node .\\packages\\npm\\scripts\\stage-binary.js",
|
|
25
|
+
"check-binaries": "node .\\packages\\npm\\scripts\\check-binaries.js",
|
|
26
|
+
"prepack": "npm run check-binaries"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"allorc",
|
|
30
|
+
"clastines",
|
|
31
|
+
"mcp",
|
|
32
|
+
"trigger",
|
|
33
|
+
"cli",
|
|
34
|
+
"go"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# allorc-app-cli
|
|
2
|
+
|
|
3
|
+
npm wrapper for the Go-based `allorc` CLI.
|
|
4
|
+
|
|
5
|
+
## Recommended command name
|
|
6
|
+
|
|
7
|
+
The package exposes both of these commands:
|
|
8
|
+
|
|
9
|
+
```powershell
|
|
10
|
+
allorc --help
|
|
11
|
+
allorc-app-cli --help
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`allorc` is the better npm-facing command because it is shorter and easier to script.
|
|
15
|
+
|
|
16
|
+
## Local dev defaults
|
|
17
|
+
|
|
18
|
+
For the generated project scaffold, the npm-distributed CLI expects:
|
|
19
|
+
|
|
20
|
+
- MCP local host at `http://localhost:9000`
|
|
21
|
+
- Trigger local base URL at `http://127.0.0.1:8090/api/v1`
|
|
22
|
+
- Trigger host override `clastines-server.localhost`
|
|
23
|
+
|
|
24
|
+
## Packaging flow
|
|
25
|
+
|
|
26
|
+
Build the Go binaries from the package root:
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
go build -o .\allorc.exe .\cmd\allorc-app-cli
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Cross-compile examples:
|
|
33
|
+
|
|
34
|
+
```powershell
|
|
35
|
+
$env:GOOS='linux'
|
|
36
|
+
$env:GOARCH='amd64'
|
|
37
|
+
go build -o .\allorc-linux .\cmd\allorc-app-cli
|
|
38
|
+
Remove-Item Env:GOOS
|
|
39
|
+
Remove-Item Env:GOARCH
|
|
40
|
+
|
|
41
|
+
$env:GOOS='darwin'
|
|
42
|
+
$env:GOARCH='arm64'
|
|
43
|
+
go build -o .\allorc-darwin .\cmd\allorc-app-cli
|
|
44
|
+
Remove-Item Env:GOOS
|
|
45
|
+
Remove-Item Env:GOARCH
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Stage them into the npm package:
|
|
49
|
+
|
|
50
|
+
```powershell
|
|
51
|
+
npm run stage-binary -- --source ..\..\allorc.exe --target win32-x64
|
|
52
|
+
npm run stage-binary -- --source ..\..\allorc-linux --target linux-x64
|
|
53
|
+
npm run stage-binary -- --source ..\..\allorc-darwin --target darwin-arm64
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Verify contents:
|
|
57
|
+
|
|
58
|
+
```powershell
|
|
59
|
+
npm run check-binaries
|
|
60
|
+
npm pack --dry-run
|
|
61
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
const { existsSync } = require("node:fs");
|
|
5
|
+
const { join } = require("node:path");
|
|
6
|
+
|
|
7
|
+
const platform = process.platform;
|
|
8
|
+
const arch = process.arch;
|
|
9
|
+
const rootDir = join(__dirname, "..");
|
|
10
|
+
|
|
11
|
+
function resolveBinaryPath() {
|
|
12
|
+
const envOverride = process.env.ALLORC_APP_CLI_BINARY;
|
|
13
|
+
if (envOverride) {
|
|
14
|
+
return envOverride;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const extension = platform === "win32" ? ".exe" : "";
|
|
18
|
+
return join(rootDir, "dist", `${platform}-${arch}`, `allorc${extension}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const binaryPath = resolveBinaryPath();
|
|
22
|
+
|
|
23
|
+
if (!existsSync(binaryPath)) {
|
|
24
|
+
const targetDir = join(rootDir, "dist", `${platform}-${arch}`);
|
|
25
|
+
console.error("Missing packaged binary for this platform.");
|
|
26
|
+
console.error(`Expected: ${binaryPath}`);
|
|
27
|
+
console.error("");
|
|
28
|
+
console.error("Build and stage the Go binary before publishing:");
|
|
29
|
+
console.error(` go build -o allorc${platform === "win32" ? ".exe" : ""} .\\cmd\\allorc-app-cli`);
|
|
30
|
+
console.error(` npm run stage-binary -- --source <path-to-built-binary> --target ${platform}-${arch}`);
|
|
31
|
+
console.error("");
|
|
32
|
+
console.error("Or run with an explicit binary path using ALLORC_APP_CLI_BINARY.");
|
|
33
|
+
console.error(`Target directory: ${targetDir}`);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const result = spawnSync(binaryPath, process.argv.slice(2), { stdio: "inherit" });
|
|
38
|
+
|
|
39
|
+
if (result.error) {
|
|
40
|
+
console.error(result.error.message);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (typeof result.status === "number") {
|
|
45
|
+
process.exit(result.status);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
process.exit(1);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|