@wire-protocol/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/dist/index.js ADDED
@@ -0,0 +1,114 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const commander_1 = require("commander");
8
+ const init_1 = require("./commands/init");
9
+ const validate_1 = require("./commands/validate");
10
+ const run_1 = require("./commands/run");
11
+ const registry_1 = require("./commands/registry");
12
+ const fs_1 = require("fs");
13
+ const path_1 = __importDefault(require("path"));
14
+ const core_1 = require("@wire/core");
15
+ const config_1 = require("./commands/config");
16
+ const program = new commander_1.Command();
17
+ program
18
+ .name('wire')
19
+ .description('Wire Protocol — secure API execution for LLM agents')
20
+ .version('0.1.0');
21
+ program
22
+ .command('config <agent>')
23
+ .description('Configure Wire onboarding for a specific agent (claude, cursor, antigravity)')
24
+ .option('-s, --skills <dir>', 'Directory containing .wire.yaml files', '.wire')
25
+ .action(async (agent, opts) => {
26
+ await (0, config_1.configCommand)(agent, opts);
27
+ });
28
+ program
29
+ .command('init')
30
+ .description('Scaffold a new .wire.yaml skill file interactively')
31
+ .option('-n, --name <name>', 'Skill name')
32
+ .option('-u, --url <url>', 'API base URL')
33
+ .option('-o, --output <dir>', 'Output directory', '.wire')
34
+ .action(async (opts) => {
35
+ await (0, init_1.initCommand)(opts);
36
+ });
37
+ program
38
+ .command('validate <file>')
39
+ .description('Validate a .wire.yaml skill file against the Wire schema')
40
+ .action(async (file) => {
41
+ await (0, validate_1.validateCommand)(file);
42
+ });
43
+ program
44
+ .command('context')
45
+ .description('Print the Wire LLM system context (for injecting into CLAUDE.md or system prompts)')
46
+ .option('-s, --skills <dir>', 'Directory containing .wire.yaml files', '.wire')
47
+ .action(async (opts) => {
48
+ const skillsDir = path_1.default.resolve(opts.skills);
49
+ if (!(0, fs_1.existsSync)(skillsDir)) {
50
+ console.error(`❌ Skills directory not found: ${skillsDir}`);
51
+ process.exit(1);
52
+ }
53
+ const skillFiles = (0, fs_1.readdirSync)(skillsDir)
54
+ .filter((f) => f.endsWith('.wire.yaml'))
55
+ .map((f) => path_1.default.join(skillsDir, f));
56
+ if (skillFiles.length === 0) {
57
+ console.error(`❌ No .wire.yaml files found in ${skillsDir}`);
58
+ process.exit(1);
59
+ }
60
+ const engine = new core_1.WireEngine({ skills: skillFiles, secrets: new core_1.EnvSecretsProvider() });
61
+ await engine.init();
62
+ process.stdout.write(engine.getSystemContext() + '\n');
63
+ });
64
+ program
65
+ .command('run')
66
+ .description('Start the Wire engine in stdio JSON-RPC mode')
67
+ .option('-s, --skills <dir>', 'Directory containing .wire.yaml files', '.wire')
68
+ .option('--provider <provider>', 'Secrets provider: env|aws|vault|file', 'env')
69
+ .option('--region <region>', 'AWS region (for aws provider)', 'us-east-1')
70
+ .action(async (opts) => {
71
+ await (0, run_1.runCommand)(opts);
72
+ });
73
+ program
74
+ .command('registry')
75
+ .description('Manage the Wire skill registry')
76
+ .addCommand(new commander_1.Command('install')
77
+ .alias('add')
78
+ .argument('<skill>', 'Skill name, @wire/<name>, or path to a .wire.yaml file')
79
+ .description('Install a skill from the Wire registry or a local file')
80
+ .action(async (skill) => {
81
+ await (0, registry_1.registryCommand)('install', skill);
82
+ }))
83
+ .addCommand(new commander_1.Command('list')
84
+ .description('List installed skills and what is available in the registry')
85
+ .action(async () => {
86
+ await (0, registry_1.registryCommand)('list');
87
+ }))
88
+ .addCommand(new commander_1.Command('search')
89
+ .argument('[query]', 'Search term (name, tag, or keyword)')
90
+ .description('Search for skills in the Wire registry')
91
+ .action(async (query) => {
92
+ await (0, registry_1.registryCommand)('search', query);
93
+ }))
94
+ .addCommand(new commander_1.Command('info')
95
+ .argument('<skill>', 'Skill name to inspect')
96
+ .description('Show details and endpoint list for a skill')
97
+ .action(async (skill) => {
98
+ await (0, registry_1.registryCommand)('info', skill);
99
+ }))
100
+ .addCommand(new commander_1.Command('publish')
101
+ .argument('<file>', 'Path to the .wire.yaml skill file to publish')
102
+ .description('Stage a skill for publishing to the Wire registry (opens a PR flow)')
103
+ .action(async (file) => {
104
+ await (0, registry_1.registryCommand)('publish', file);
105
+ }))
106
+ .addCommand(new commander_1.Command('remove')
107
+ .alias('uninstall')
108
+ .argument('<skill>', 'Skill name to remove')
109
+ .description('Remove a locally installed skill')
110
+ .action(async (skill) => {
111
+ await (0, registry_1.registryCommand)('remove', skill);
112
+ }));
113
+ program.parse(process.argv);
114
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AACA,yCAAmC;AACnC,0CAA6C;AAC7C,kDAAqD;AACrD,wCAA2C;AAC3C,kDAAqD;AACrD,2BAA4C;AAC5C,gDAAuB;AACvB,qCAA2D;AAE3D,8CAAiD;AAEjD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAA;AAE7B,OAAO;KACJ,IAAI,CAAC,MAAM,CAAC;KACZ,WAAW,CAAC,qDAAqD,CAAC;KAClE,OAAO,CAAC,OAAO,CAAC,CAAA;AAEnB,OAAO;KACJ,OAAO,CAAC,gBAAgB,CAAC;KACzB,WAAW,CAAC,8EAA8E,CAAC;KAC3F,MAAM,CAAC,oBAAoB,EAAE,uCAAuC,EAAE,OAAO,CAAC;KAC9E,MAAM,CAAC,KAAK,EAAE,KAAa,EAAE,IAAI,EAAE,EAAE;IACpC,MAAM,IAAA,sBAAa,EAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AAClC,CAAC,CAAC,CAAA;AAEJ,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,oDAAoD,CAAC;KACjE,MAAM,CAAC,mBAAmB,EAAE,YAAY,CAAC;KACzC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC;KACzC,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 export declare function discoverSkillFiles(dir: string): string[];
5
+ /**
6
+ * Format a duration in ms to a human-readable string
7
+ */
8
+ export declare function formatDuration(ms: number): string;
9
+ /**
10
+ * Print a section header to stdout
11
+ */
12
+ export declare function header(title: string): void;
13
+ /**
14
+ * Print an error and exit
15
+ */
16
+ export declare function fatal(msg: string): never;
package/dist/utils.js ADDED
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.discoverSkillFiles = discoverSkillFiles;
7
+ exports.formatDuration = formatDuration;
8
+ exports.header = header;
9
+ exports.fatal = fatal;
10
+ const path_1 = __importDefault(require("path"));
11
+ const fs_1 = require("fs");
12
+ /**
13
+ * Discover all .wire.yaml files in a directory (non-recursive)
14
+ */
15
+ function discoverSkillFiles(dir) {
16
+ const absDir = path_1.default.resolve(dir);
17
+ if (!(0, fs_1.existsSync)(absDir))
18
+ return [];
19
+ return (0, fs_1.readdirSync)(absDir)
20
+ .filter(f => f.endsWith('.wire.yaml'))
21
+ .map(f => path_1.default.join(absDir, f));
22
+ }
23
+ /**
24
+ * Format a duration in ms to a human-readable string
25
+ */
26
+ function formatDuration(ms) {
27
+ if (ms < 1000)
28
+ return `${ms}ms`;
29
+ return `${(ms / 1000).toFixed(1)}s`;
30
+ }
31
+ /**
32
+ * Print a section header to stdout
33
+ */
34
+ function header(title) {
35
+ const line = '─'.repeat(title.length + 4);
36
+ console.log(`\n┌${line}┐`);
37
+ console.log(`│ ${title} │`);
38
+ console.log(`└${line}┘\n`);
39
+ }
40
+ /**
41
+ * Print an error and exit
42
+ */
43
+ function fatal(msg) {
44
+ console.error(`❌ ${msg}`);
45
+ process.exit(1);
46
+ }
47
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"m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.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@wire-protocol/cli",
3
+ "version": "0.1.0",
4
+ "description": "Wire Protocol CLI — init, validate, run, registry",
5
+ "bin": {
6
+ "wire": "./dist/index.js"
7
+ },
8
+ "main": "dist/index.js",
9
+ "files": [
10
+ "dist/**/*",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "engines": {
15
+ "node": ">=20"
16
+ },
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "dev": "ts-node src/index.ts"
20
+ },
21
+ "dependencies": {
22
+ "@wire-protocol/core": "^0.1.0",
23
+ "commander": "^12.0.0",
24
+ "js-yaml": "^4.1.0",
25
+ "chalk": "^5.3.0",
26
+ "ora": "^8.0.0"
27
+ },
28
+ "devDependencies": {
29
+ "typescript": "^5.4.0",
30
+ "@types/node": "^20.0.0",
31
+ "@types/js-yaml": "^4.0.9",
32
+ "ts-node": "^10.9.0"
33
+ },
34
+ "keywords": [
35
+ "wire",
36
+ "wire-protocol",
37
+ "cli",
38
+ "llm",
39
+ "ai-agent",
40
+ "api",
41
+ "security",
42
+ "mcp-alternative"
43
+ ],
44
+ "license": "MIT",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "https://github.com/YuvakiranGC/wire-protocol.git",
48
+ "directory": "packages/cli"
49
+ },
50
+ "homepage": "https://github.com/YuvakiranGC/wire-protocol#readme",
51
+ "bugs": {
52
+ "url": "https://github.com/YuvakiranGC/wire-protocol/issues"
53
+ },
54
+ "publishConfig": {
55
+ "access": "public"
56
+ }
57
+ }