@zswarm/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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 zSwarm contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # @zswarm/cli
2
+
3
+ The `zswarm` command. Same ops as the MCP tool, through `@zswarm/core`. Two
4
+ conveniences: the first bare argument is `--to` and the second is `--body` for
5
+ `send`; `--key` / `--keys` repeat into an array.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g @zswarm/cli
11
+ ```
12
+
13
+ From a checkout of this repo:
14
+
15
+ ```bash
16
+ npm install ./packages/cli
17
+ ```
18
+
19
+ Requires Zellij >= 0.42 and Node >= 20.
20
+
21
+ ## Usage
22
+
23
+ ```bash
24
+ zswarm list
25
+ zswarm send terminal_2 ping
26
+ zswarm send --to terminal_2 --body ping
27
+ zswarm keys --to terminal_2 --key "Ctrl c" --key Esc
28
+ ```
29
+
30
+ Prints JSON. No arguments prints usage, generated from the same schema as the
31
+ MCP tool.
32
+
33
+ Ops, env, and the event bus: the [zswarm README](../../README.md).
34
+
35
+ ## License
36
+
37
+ MIT
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ import { ZellijError, cliUsage, dispatchZswarm, parseCliArgv } from "@zswarm/core";
3
+ const argv = process.argv.slice(2);
4
+ if (argv.length === 0 || argv[0] === "-h" || argv[0] === "--help") {
5
+ process.stderr.write(cliUsage());
6
+ process.exit(argv.length === 0 ? 2 : 0);
7
+ }
8
+ let args;
9
+ try {
10
+ args = parseCliArgv(argv);
11
+ }
12
+ catch (err) {
13
+ const message = err instanceof ZellijError ? err.message : String(err);
14
+ process.stderr.write(`${message}\n${cliUsage()}`);
15
+ process.exit(2);
16
+ }
17
+ const result = await dispatchZswarm(args);
18
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
19
+ process.exit(result.ok ? 0 : 1);
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@zswarm/cli",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "zSwarm CLI — list, send, dump Zellij panes",
6
+ "bin": {
7
+ "zswarm": "./dist/cli.js"
8
+ },
9
+ "dependencies": {
10
+ "@zswarm/core": "0.1.0"
11
+ },
12
+ "devDependencies": {
13
+ "@types/node": "22.14.1",
14
+ "typescript": "5.8.3"
15
+ },
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "license": "MIT",
20
+ "files": [
21
+ "dist",
22
+ "README.md"
23
+ ],
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "exports": {
28
+ ".": "./dist/cli.js",
29
+ "./package.json": "./package.json"
30
+ },
31
+ "scripts": {
32
+ "build": "tsc -p tsconfig.json",
33
+ "cli": "node dist/cli.js"
34
+ }
35
+ }