awesome-agents 0.1.1 → 0.1.5

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/src/cli.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Command } from "commander";
2
2
  import { PACKAGE_NAME, PACKAGE_VERSION, SUPPORTED_AGENTS } from "./constants.js";
3
+ import { configureHelp, formatMissingSourceError, ui } from "./help.js";
3
4
  import {
4
5
  initProfile,
5
6
  installFromSource,
@@ -19,12 +20,14 @@ export async function run(argv = process.argv) {
19
20
  .helpOption("-h, --help", "Show this help message")
20
21
  .showHelpAfterError();
21
22
 
23
+ configureHelp(program);
24
+
22
25
  addInstallCommand(program, "add");
23
26
  addInstallCommand(program, "install");
24
27
 
25
28
  program
26
29
  .command("use")
27
- .argument("[source]", "Source plus profile, for example pablof7z/touch-grass@ios-tester")
30
+ .argument("<source>", "Source plus profile, for example owner/repo@profile")
28
31
  .description("Print one rendered agent profile without installing it")
29
32
  .option("-s, --profile <profile>", "Profile slug to use")
30
33
  .option("--skill <profile>", "Compatibility alias for --profile")
@@ -79,7 +82,7 @@ export async function run(argv = process.argv) {
79
82
  if (options.json) {
80
83
  printJson(result);
81
84
  } else {
82
- printOperations(result.operations, result.registryPath);
85
+ printOperations(result.operations, result.registryPath, result.runInstructions);
83
86
  }
84
87
  });
85
88
 
@@ -100,7 +103,7 @@ export async function run(argv = process.argv) {
100
103
  if (options.json) {
101
104
  printJson(result);
102
105
  } else {
103
- printOperations(result.operations, result.registryPath);
106
+ printOperations(result.operations, result.registryPath, result.runInstructions);
104
107
  }
105
108
  });
106
109
 
@@ -116,9 +119,9 @@ export async function run(argv = process.argv) {
116
119
  if (options.json) {
117
120
  printJson(result);
118
121
  } else {
119
- console.log(`${result.action}:`);
122
+ console.log(`${ui.success(result.action)}:`);
120
123
  for (const file of result.files) {
121
- console.log(` ${file}`);
124
+ console.log(` ${ui.path(file)}`);
122
125
  }
123
126
  }
124
127
  });
@@ -137,7 +140,7 @@ function addInstallCommand(program, commandName) {
137
140
  .argument("[source]", "Local path, GitHub owner/repo, or GitHub URL")
138
141
  .description(commandName === "install" ? "Alias for add" : "Install agent profiles from a source")
139
142
  .option("-g, --global", "Install globally")
140
- .option("-p, --project", "Install into the current project (default)")
143
+ .option("-p, --project", "Install into the current project; not supported for Codex profiles")
141
144
  .option("-a, --agent <agents...>", "Agent profile slugs to install; accepts harness names for backward compatibility")
142
145
  .option("--harness <harnesses...>", `Target harnesses (${SUPPORTED_AGENTS.join(", ")}, or *)`)
143
146
  .option("--target <harnesses...>", "Compatibility alias for --harness")
@@ -151,6 +154,12 @@ function addInstallCommand(program, commandName) {
151
154
  .option("--json", "Output JSON")
152
155
  .option("--home <dir>", "Override HOME for path expansion")
153
156
  .action(async (source = undefined, options) => {
157
+ if (!source) {
158
+ process.stderr.write(formatMissingSourceError(commandName));
159
+ process.exitCode = 1;
160
+ return;
161
+ }
162
+
154
163
  if (options.list) {
155
164
  const profiles = await listAvailable(source, options);
156
165
  if (options.json) {
@@ -165,48 +174,72 @@ function addInstallCommand(program, commandName) {
165
174
  if (options.json) {
166
175
  printJson(result);
167
176
  } else {
168
- printOperations(result.operations, result.registryPath);
177
+ printOperations(result.operations, result.registryPath, result.runInstructions);
169
178
  }
170
179
  });
171
180
  }
172
181
 
173
182
  function printAvailable(profiles) {
174
183
  if (profiles.length === 0) {
175
- console.log("No profiles found.");
184
+ console.log(ui.warning("No profiles found."));
176
185
  return;
177
186
  }
187
+ console.log(ui.bold("Available profiles:"));
178
188
  for (const profile of profiles) {
179
- console.log(`${profile.slug} ${profile.summary || profile.name}`);
189
+ console.log(` ${ui.profile(profile.slug)} ${profile.summary || profile.name}`);
180
190
  }
181
191
  }
182
192
 
183
193
  function printInstalled(result) {
184
194
  if (result.installs.length === 0) {
185
- console.log(`No ${result.scope} profiles installed.`);
195
+ console.log(ui.warning(`No ${result.scope} profiles installed.`));
186
196
  return;
187
197
  }
188
198
 
199
+ console.log(ui.bold(`${result.scope} profiles:`));
189
200
  for (const install of result.installs) {
190
- const missing = install.exists ? "" : " (missing target)";
191
- console.log(`${install.profile} ${install.harness} ${install.target}${missing}`);
201
+ const missing = install.exists ? "" : ` ${ui.warning("(missing target)")}`;
202
+ console.log(` ${ui.profile(install.profile)} ${ui.command(install.harness)} ${ui.path(install.target)}${missing}`);
192
203
  }
193
- console.log(`Registry: ${result.registryPath}`);
204
+ console.log(`${ui.bold("Registry:")} ${ui.path(result.registryPath)}`);
194
205
  }
195
206
 
196
- function printOperations(operations, registryPath) {
207
+ function printOperations(operations, registryPath, runInstructions = []) {
197
208
  if (operations.length === 0) {
198
- console.log("No matching profiles.");
209
+ console.log(ui.warning("No matching profiles."));
199
210
  return;
200
211
  }
201
212
 
202
213
  for (const operation of operations) {
203
- console.log(`${operation.action}: ${operation.profile} -> ${operation.harness} at ${operation.target}`);
214
+ console.log(`${formatAction(operation.action)}: ${ui.profile(operation.profile)} -> ${ui.command(operation.harness)} at ${ui.path(operation.target)}`);
204
215
  }
205
216
  if (registryPath) {
206
- console.log(`Registry: ${registryPath}`);
217
+ console.log(`${ui.bold("Registry:")} ${ui.path(registryPath)}`);
218
+ }
219
+ printRunInstructions(runInstructions);
220
+ }
221
+
222
+ function printRunInstructions(runInstructions = []) {
223
+ if (runInstructions.length === 0) {
224
+ return;
225
+ }
226
+
227
+ console.log(ui.bold("Run installed profiles:"));
228
+ for (const instruction of runInstructions) {
229
+ console.log(` ${ui.profile(instruction.profile)} via ${ui.command(instruction.harness)}: ${ui.command(instruction.command)}`);
230
+ if (instruction.note) {
231
+ console.log(` ${instruction.note}`);
232
+ }
207
233
  }
208
234
  }
209
235
 
210
236
  function printJson(value) {
211
237
  console.log(JSON.stringify(value, null, 2));
212
238
  }
239
+
240
+ function formatAction(action) {
241
+ if (action.startsWith("would-")) {
242
+ return ui.warning(action);
243
+ }
244
+ return ui.success(action);
245
+ }
package/src/constants.js CHANGED
@@ -1,6 +1,5 @@
1
1
  export const PACKAGE_NAME = "awesome-agents";
2
- export const PACKAGE_VERSION = "0.1.1";
3
- export const DEFAULT_SOURCE = "pablof7z/touch-grass";
2
+ export const PACKAGE_VERSION = "0.1.5";
4
3
  export const DEFAULT_AGENT = "codex";
5
4
  export const SUPPORTED_AGENTS = ["codex", "claude-code", "opencode"];
6
5
  export const REGISTRY_DIRNAME = ".awesome-agents";
@@ -17,3 +16,10 @@ export const AGENT_ALIASES = new Map([
17
16
  ["opencode", "opencode"],
18
17
  ["open-code", "opencode"]
19
18
  ]);
19
+
20
+ // The CLI binary used to detect whether a harness is available on PATH.
21
+ export const HARNESS_COMMANDS = new Map([
22
+ ["codex", "codex"],
23
+ ["claude-code", "claude"],
24
+ ["opencode", "opencode"]
25
+ ]);