@pygg/cli 0.0.0-stage → 0.1.0-dev.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 +17 -2
- package/bin/pygg.js +42 -0
- package/package.json +24 -4
package/README.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @pygg/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Pygg from the command line. **Developer preview: Windows x64 only, and the program is not code-signed**, so Windows SmartScreen or an antivirus may warn about it.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm install -g @pygg/cli@dev
|
|
7
|
+
pygg status # is Pygg serving, on which store, and is its gateway answering
|
|
8
|
+
pygg doctor # status, plus the store's schema, the agents found and whether Pygg is set up in each
|
|
9
|
+
pygg mcp # the MCP server for coding agents (Claude Code, Codex CLI, OpenCode, Cursor)
|
|
10
|
+
pygg gateway … # the headless gateway: serve, connections, clients, combos, usage
|
|
11
|
+
pygg agent … # agent detection, one-off runs, smart tasks
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The `pygg` command runs the native `pygg-cli` program from the package `@pygg/win32-x64`, which npm installs with it. Without that package it uses an installed Pygg app's `pygg-cli.exe` (`%LOCALAPPDATA%\Pygg`), or the program named by `PYGG_CLI`.
|
|
15
|
+
|
|
16
|
+
To let a coding agent start Pygg tasks, register `pygg mcp` as an MCP server with the agent, with `PYGG_TOKEN` set to a client token that may start tasks (Pygg → Clients). The Pygg app's Agents → From Your IDE does this for you.
|
|
17
|
+
|
|
18
|
+
MIT licence.
|
package/bin/pygg.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `pygg` from npm (@pygg/cli): finds the native `pygg-cli` program and runs it with the same arguments, standard input
|
|
3
|
+
// and output (so `pygg mcp` works as an MCP server for coding agents) and exits with its code. The program comes from the
|
|
4
|
+
// platform package npm installed next to this one (@pygg/<platform>-<arch>); failing that, from an installed Pygg app.
|
|
5
|
+
'use strict';
|
|
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' ? 'pygg-cli.exe' : 'pygg-cli';
|
|
12
|
+
|
|
13
|
+
function fromPackage() {
|
|
14
|
+
const name = `@pygg/${process.platform}-${process.arch}`;
|
|
15
|
+
try {
|
|
16
|
+
return path.join(path.dirname(require.resolve(`${name}/package.json`)), 'bin', exe);
|
|
17
|
+
} catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function fromInstalledApp() {
|
|
23
|
+
if (process.platform !== 'win32' || !process.env.LOCALAPPDATA) return null;
|
|
24
|
+
return path.join(process.env.LOCALAPPDATA, 'Pygg', exe);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const program = process.env.PYGG_CLI || [fromPackage(), fromInstalledApp()].find(p => p && fs.existsSync(p));
|
|
28
|
+
if (!program) {
|
|
29
|
+
console.error(`pygg: no pygg-cli program for ${process.platform}-${process.arch}.\n`
|
|
30
|
+
+ 'This developer preview ships one for Windows x64 only. Install the Pygg app, or set PYGG_CLI to a pygg-cli program.');
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const result = spawnSync(program, process.argv.slice(2), { stdio: 'inherit', windowsHide: true });
|
|
35
|
+
if (result.error) {
|
|
36
|
+
console.error(`pygg: could not start ${program}: ${result.error.message}`);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
if (result.signal) {
|
|
40
|
+
process.kill(process.pid, result.signal);
|
|
41
|
+
}
|
|
42
|
+
process.exit(result.status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pygg/cli",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-dev.0",
|
|
4
|
+
"description": "Pygg from the command line: status, doctor, the MCP server for coding agents, the gateway and agent tools. Developer preview, unsigned, Windows x64 only.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"bin": {
|
|
7
|
+
"pygg": "bin/pygg.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=18"
|
|
15
|
+
},
|
|
16
|
+
"optionalDependencies": {
|
|
17
|
+
"@pygg/win32-x64": "0.1.0-dev.0"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"llm",
|
|
21
|
+
"router",
|
|
22
|
+
"gateway",
|
|
23
|
+
"mcp",
|
|
24
|
+
"coding-agent"
|
|
25
|
+
]
|
|
26
|
+
}
|