@orchagent/cli 0.2.5 → 0.2.7

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.
@@ -109,6 +109,15 @@ function registerCallCommand(program) {
109
109
  .option('--no-skills', 'Ignore default skills')
110
110
  .option('--file <path...>', 'File(s) to upload (can specify multiple)')
111
111
  .option('--metadata <json>', 'JSON metadata to send with files')
112
+ .addHelpText('after', `
113
+ Examples:
114
+ orch call orchagent/invoice-scanner invoice.pdf
115
+ orch call orchagent/leak-finder --data '{"repo_url": "https://github.com/org/repo"}'
116
+ cat input.json | orch call acme/agent --data @-
117
+ orch call acme/image-processor photo.jpg --output result.png
118
+
119
+ Note: Use 'call' for server-side execution (requires login), 'run' for local execution.
120
+ `)
112
121
  .action(async (agentRef, file, options) => {
113
122
  const resolved = await (0, config_1.getResolvedConfig)();
114
123
  if (!resolved.apiKey) {
@@ -14,6 +14,24 @@ function parseAgentRef(value) {
14
14
  }
15
15
  throw new errors_1.CliError('Invalid agent reference. Use org/agent format (e.g., joe/leak-finder)');
16
16
  }
17
+ function formatSchema(schema, indent = ' ') {
18
+ const lines = [];
19
+ const props = schema.properties || {};
20
+ const required = schema.required || [];
21
+ for (const [key, value] of Object.entries(props)) {
22
+ let typeStr = value.type || 'any';
23
+ if (typeStr === 'array' && value.items?.type) {
24
+ typeStr = `${value.items.type}[]`;
25
+ }
26
+ const reqMark = required.includes(key) ? '' : '?';
27
+ let line = `${indent}${key}${reqMark}: ${typeStr}`;
28
+ if (value.description) {
29
+ line += ` - ${value.description}`;
30
+ }
31
+ lines.push(line);
32
+ }
33
+ return lines.join('\n');
34
+ }
17
35
  function deriveReadmeUrl(sourceUrl) {
18
36
  // Parse GitHub URLs like:
19
37
  // git+https://github.com/user/repo.git#subdirectory=path
@@ -76,6 +94,16 @@ function registerInfoCommand(program) {
76
94
  process.stdout.write(`Run: ${agentData.run_command}\n`);
77
95
  }
78
96
  }
97
+ // Display input schema if available
98
+ if (agentData.input_schema?.properties && Object.keys(agentData.input_schema.properties).length > 0) {
99
+ process.stdout.write('\nInput Schema:\n');
100
+ process.stdout.write(formatSchema(agentData.input_schema) + '\n');
101
+ }
102
+ // Display output schema if available
103
+ if (agentData.output_schema?.properties && Object.keys(agentData.output_schema.properties).length > 0) {
104
+ process.stdout.write('\nOutput Schema:\n');
105
+ process.stdout.write(formatSchema(agentData.output_schema) + '\n');
106
+ }
79
107
  // Fetch and display README if available
80
108
  if (agentData.source_url) {
81
109
  const readmeUrl = deriveReadmeUrl(agentData.source_url);
@@ -496,6 +496,15 @@ function registerRunCommand(program) {
496
496
  .option('--skills <skills>', 'Add skills (comma-separated)')
497
497
  .option('--skills-only <skills>', 'Use only these skills')
498
498
  .option('--no-skills', 'Ignore default skills')
499
+ .addHelpText('after', `
500
+ Examples:
501
+ orch run orchagent/leak-finder --input '{"path": "."}'
502
+ orch run orchagent/leak-finder --input '{"repo_url": "https://github.com/org/repo"}'
503
+ orch run joe/summarizer --input '{"text": "Hello world"}'
504
+ orch run orchagent/leak-finder --download-only
505
+
506
+ Note: Use 'run' for local execution, 'call' for server-side execution.
507
+ `)
499
508
  .action(async (agentRef, args, options) => {
500
509
  const resolved = await (0, config_1.getResolvedConfig)();
501
510
  const parsed = parseAgentRef(agentRef);
package/dist/index.js CHANGED
@@ -51,7 +51,13 @@ const program = new commander_1.Command();
51
51
  program
52
52
  .name('orchagent')
53
53
  .description('OrchAgent CLI')
54
- .version(package_json_1.default.version);
54
+ .version(package_json_1.default.version)
55
+ .addHelpText('after', `
56
+ Quick Reference:
57
+ run Download and run an agent locally (your machine)
58
+ call Execute an agent on OrchAgent servers (requires login)
59
+ info Show agent details and input/output schemas
60
+ `);
55
61
  (0, commands_1.registerCommands)(program);
56
62
  program
57
63
  .parseAsync(process.argv)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchagent/cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Command-line interface for the OrchAgent AI agent marketplace",
5
5
  "license": "MIT",
6
6
  "author": "OrchAgent <hello@orchagent.io>",
@@ -38,6 +38,8 @@
38
38
  "test": "vitest run",
39
39
  "test:watch": "vitest",
40
40
  "test:coverage": "vitest run --coverage",
41
+ "test:e2e": "vitest run --config vitest.e2e.config.ts",
42
+ "test:all": "vitest run && vitest run --config vitest.e2e.config.ts",
41
43
  "prepublishOnly": "npm run build"
42
44
  },
43
45
  "dependencies": {