@orchagent/cli 0.1.2 → 0.2.1

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.
@@ -1,26 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.registerAgentsCommand = registerAgentsCommand;
4
- const config_1 = require("../lib/config");
5
- const api_1 = require("../lib/api");
6
- const output_1 = require("../lib/output");
7
4
  function registerAgentsCommand(program) {
8
5
  program
9
6
  .command('agents')
10
- .description('List public agents')
11
- .option('--filter <text>', 'Filter by name (case-insensitive)')
7
+ .description('(Deprecated) Use "orchagent search" instead')
8
+ .option('--filter <text>', 'Filter by name')
12
9
  .option('--json', 'Output raw JSON')
13
- .action(async (options) => {
14
- const config = await (0, config_1.getResolvedConfig)();
15
- const agents = await (0, api_1.listPublicAgents)(config);
16
- const filter = options.filter?.toLowerCase();
17
- const filtered = filter
18
- ? agents.filter((agent) => `${agent.org_slug}/${agent.name}`.toLowerCase().includes(filter))
19
- : agents;
20
- if (options.json) {
21
- (0, output_1.printJson)(filtered);
22
- return;
23
- }
24
- (0, output_1.printAgentsTable)(filtered);
10
+ .action(async () => {
11
+ process.stdout.write('The "agents" command has been replaced by "search".\n\n' +
12
+ 'Usage:\n' +
13
+ ' orchagent search <query> Search agents by keyword\n' +
14
+ ' orchagent search --popular Top agents by stars\n' +
15
+ ' orchagent search --recent Most recently published\n' +
16
+ ' orchagent search --type agents Filter to agents only\n\n' +
17
+ 'Browse all agents at: https://orchagent.io/explore\n');
18
+ process.exit(0);
25
19
  });
26
20
  }
@@ -47,7 +47,12 @@ function registerInfoCommand(program) {
47
47
  // Fetch agent metadata
48
48
  const agentData = await (0, api_1.publicRequest)(config, `/public/agents/${org}/${agent}/${version}/download`);
49
49
  if (options.json) {
50
- process.stdout.write(JSON.stringify(agentData, null, 2) + '\n');
50
+ // Don't expose internal routing URLs in JSON output
51
+ const output = { ...agentData };
52
+ if (output.url?.includes('.internal')) {
53
+ delete output.url;
54
+ }
55
+ process.stdout.write(JSON.stringify(output, null, 2) + '\n');
51
56
  return;
52
57
  }
53
58
  // Display agent info
@@ -60,7 +65,8 @@ function registerInfoCommand(program) {
60
65
  process.stdout.write(`Type: ${agentData.type}\n`);
61
66
  process.stdout.write(`Providers: ${agentData.supported_providers.join(', ')}\n`);
62
67
  if (agentData.type === 'code') {
63
- if (agentData.url) {
68
+ // Don't show internal routing URLs - they confuse users
69
+ if (agentData.url && !agentData.url.includes('.internal')) {
64
70
  process.stdout.write(`Server: ${agentData.url}\n`);
65
71
  }
66
72
  if (agentData.source_url) {
@@ -5,42 +5,67 @@ const config_1 = require("../lib/config");
5
5
  const api_1 = require("../lib/api");
6
6
  const output_1 = require("../lib/output");
7
7
  const analytics_1 = require("../lib/analytics");
8
+ const errors_1 = require("../lib/errors");
9
+ const DEFAULT_LIMIT = 20;
8
10
  function registerSearchCommand(program) {
9
11
  program
10
12
  .command('search')
11
- .description('Search for public agents')
12
- .argument('[query]', 'Search query')
13
- .option('--sort <field>', 'Sort by: stars, recent, name (default: stars)', 'stars')
13
+ .description('Search for agents and skills')
14
+ .argument('[query]', 'Search query (required unless using --popular or --recent)')
15
+ .option('--popular', 'Show top agents/skills by stars')
16
+ .option('--recent', 'Show most recently published')
17
+ .option('--type <type>', 'Filter by type: agents, skills, all (default: all)', 'all')
18
+ .option('--limit <n>', `Max results (default: ${DEFAULT_LIMIT})`, String(DEFAULT_LIMIT))
14
19
  .option('--json', 'Output raw JSON')
15
20
  .action(async (query, options) => {
16
21
  const config = await (0, config_1.getResolvedConfig)();
22
+ const limit = parseInt(options.limit, 10) || DEFAULT_LIMIT;
23
+ // Require query OR --popular/--recent
24
+ if (!query && !options.popular && !options.recent) {
25
+ throw new errors_1.CliError('Search requires a query or flag.\n\n' +
26
+ 'Usage:\n' +
27
+ ' orchagent search <query> Search by keyword\n' +
28
+ ' orchagent search --popular Top agents by stars\n' +
29
+ ' orchagent search --recent Most recently published\n\n' +
30
+ 'Browse all agents at: https://orchagent.io/explore');
31
+ }
17
32
  let agents;
18
33
  if (query) {
19
34
  agents = await (0, api_1.searchAgents)(config, query);
20
- await (0, analytics_1.track)('cli_search', { query });
35
+ await (0, analytics_1.track)('cli_search', { query, type: options.type });
21
36
  }
22
37
  else {
23
38
  agents = await (0, api_1.listPublicAgents)(config);
24
- await (0, analytics_1.track)('cli_search');
39
+ await (0, analytics_1.track)('cli_search', { mode: options.popular ? 'popular' : 'recent', type: options.type });
40
+ }
41
+ // Filter by type
42
+ if (options.type === 'agents') {
43
+ agents = agents.filter(a => a.type !== 'skill');
44
+ }
45
+ else if (options.type === 'skills') {
46
+ agents = agents.filter(a => a.type === 'skill');
25
47
  }
26
48
  // Sort results
27
- if (options.sort === 'stars') {
49
+ if (options.popular || (!query && !options.recent)) {
28
50
  agents.sort((a, b) => (b.stars_count ?? 0) - (a.stars_count ?? 0));
29
51
  }
30
- else if (options.sort === 'recent') {
52
+ else if (options.recent) {
31
53
  agents.sort((a, b) => (b.created_at ?? '').localeCompare(a.created_at ?? ''));
32
54
  }
33
- else {
34
- agents.sort((a, b) => a.name.localeCompare(b.name));
35
- }
55
+ // Apply limit
56
+ agents = agents.slice(0, limit);
36
57
  if (options.json) {
37
58
  (0, output_1.printJson)(agents);
38
59
  return;
39
60
  }
40
61
  if (agents.length === 0) {
41
- process.stdout.write(query ? 'No agents found matching your search.\n' : 'No public agents found.\n');
62
+ process.stdout.write(query ? 'No results found matching your search.\n' : 'No public agents found.\n');
63
+ process.stdout.write('\nBrowse all agents at: https://orchagent.io/explore\n');
42
64
  return;
43
65
  }
44
66
  (0, output_1.printAgentsTable)(agents);
67
+ if (agents.length === limit) {
68
+ process.stdout.write(`\nShowing top ${limit} results. Use --limit <n> for more.\n`);
69
+ }
45
70
  });
46
71
  }
@@ -10,7 +10,6 @@ const os_1 = __importDefault(require("os"));
10
10
  const config_1 = require("../lib/config");
11
11
  const api_1 = require("../lib/api");
12
12
  const errors_1 = require("../lib/errors");
13
- const output_1 = require("../lib/output");
14
13
  const analytics_1 = require("../lib/analytics");
15
14
  const DEFAULT_VERSION = 'v1';
16
15
  /**
@@ -52,28 +51,19 @@ function parseSkillRef(value) {
52
51
  }
53
52
  function registerSkillCommand(program) {
54
53
  const skill = program.command('skill').description('Manage and install skills');
55
- // orch skill list
54
+ // orch skill list (deprecated)
56
55
  skill
57
56
  .command('list')
58
- .description('List available skills')
57
+ .description('(Deprecated) Use "orchagent search --type skills" instead')
59
58
  .option('--json', 'Output raw JSON')
60
- .action(async (options) => {
61
- const resolved = await (0, config_1.getResolvedConfig)();
62
- const skills = await (0, api_1.publicRequest)(resolved, '/public/agents?type=skills');
63
- await (0, analytics_1.track)('cli_skill_list');
64
- if (options.json) {
65
- (0, output_1.printJson)(skills);
66
- return;
67
- }
68
- if (!skills.length) {
69
- process.stdout.write('No skills found.\n');
70
- return;
71
- }
72
- for (const skill of skills) {
73
- const stars = skill.stars_count ? ` ⭐${skill.stars_count}` : '';
74
- process.stdout.write(`${skill.org_slug}/${skill.name}@${skill.version}${stars}\n` +
75
- ` ${skill.description || 'No description'}\n\n`);
76
- }
59
+ .action(async () => {
60
+ process.stdout.write('The "skill list" command has been replaced by "search".\n\n' +
61
+ 'Usage:\n' +
62
+ ' orchagent search <query> --type skills Search skills by keyword\n' +
63
+ ' orchagent search --popular --type skills Top skills by stars\n' +
64
+ ' orchagent search --recent --type skills Most recently published\n\n' +
65
+ 'Browse all skills at: https://orchagent.io/explore\n');
66
+ process.exit(0);
77
67
  });
78
68
  // orch skill install <skill>
79
69
  skill
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchagent/cli",
3
- "version": "0.1.2",
3
+ "version": "0.2.1",
4
4
  "description": "Command-line interface for the OrchAgent AI agent marketplace",
5
5
  "license": "MIT",
6
6
  "author": "OrchAgent <hello@orchagent.io>",