specli 0.0.32 → 0.0.33

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.
Files changed (2) hide show
  1. package/dist/cli/main.js +15 -7
  2. package/package.json +3 -3
package/dist/cli/main.js CHANGED
@@ -152,6 +152,7 @@ export async function main(argv, options = {}) {
152
152
  .description("Print indexed operations (machine-readable when --json)")
153
153
  .option("--pretty", "Pretty-print JSON when used with --json")
154
154
  .option("--min", "Minimal JSON output (commands + metadata only)")
155
+ .option("--commands", "List all <resource> <action> commands (can be large)")
155
156
  .action(async (_opts, command) => {
156
157
  const flags = command.optsWithGlobals();
157
158
  if (flags.json) {
@@ -165,11 +166,17 @@ export async function main(argv, options = {}) {
165
166
  }
166
167
  process.stdout.write(`${ctx.schema.openapi.title ?? "(untitled)"}\n`);
167
168
  process.stdout.write(`OpenAPI: ${ctx.schema.openapi.version}\n`);
168
- process.stdout.write(`Spec: ${ctx.schema.spec.id} (${ctx.schema.spec.source})\n`);
169
- process.stdout.write(`Fingerprint: ${ctx.schema.spec.fingerprint}\n`);
170
169
  process.stdout.write(`Servers: ${ctx.schema.servers.length}\n`);
171
170
  process.stdout.write(`Auth Schemes: ${ctx.schema.authSchemes.length}\n`);
172
- if (ctx.schema.planned?.length) {
171
+ process.stdout.write(`Spec: ${ctx.schema.spec.id} (${ctx.schema.spec.source})\n`);
172
+ // Token-efficient default output: list resources (top-level commands)
173
+ // and push the user/agent toward --help for details.
174
+ process.stdout.write(`\nResources: ${ctx.commands.resources.length}\n\n`);
175
+ const resources = [...ctx.commands.resources].sort((a, b) => a.resource.localeCompare(b.resource));
176
+ for (const r of resources) {
177
+ process.stdout.write(`- ${r.resource} (${r.actions.length} actions)\n`);
178
+ }
179
+ if (flags.commands && ctx.schema.planned?.length) {
173
180
  process.stdout.write(`\nCommands: ${ctx.schema.planned.length}\n\n`);
174
181
  for (const op of ctx.schema.planned) {
175
182
  const args = op.pathArgs.length
@@ -178,10 +185,10 @@ export async function main(argv, options = {}) {
178
185
  process.stdout.write(`- ${program.name()} ${op.resource} ${op.action}${args}\n`);
179
186
  }
180
187
  }
181
- process.stdout.write("\nTip: explore required flags with --help at each level:\n" +
182
- `- ${program.name()} --help\n` +
188
+ process.stdout.write("\nNext:\n" +
183
189
  `- ${program.name()} <resource> --help\n` +
184
- `- ${program.name()} <resource> <action> --help\n`);
190
+ `- ${program.name()} <resource> <action> --help\n` +
191
+ "\nNote: Use --help to discover required flags; avoid __schema --json for agent use (too verbose).\n");
185
192
  });
186
193
  addGeneratedCommands(program, {
187
194
  servers: ctx.servers,
@@ -256,9 +263,10 @@ export async function main(argv, options = {}) {
256
263
  }
257
264
  lines.push("");
258
265
  lines.push("Agent workflow:");
259
- lines.push(` 1) ${name} __schema --json --min`);
266
+ lines.push(` 1) ${name} __schema`);
260
267
  lines.push(` 2) ${name} <resource> --help`);
261
268
  lines.push(` 3) ${name} <resource> <action> --help`);
269
+ lines.push(` 4) ${name} <resource> <action> --curl`);
262
270
  lines.push("");
263
271
  return lines.join("\n");
264
272
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specli",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "Run any OpenAPI spec as a CLI. Built for Agents.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,7 +31,7 @@
31
31
  ],
32
32
  "scripts": {
33
33
  "build": "tsc",
34
- "prepublishOnly": "tsc",
34
+ "prepublishOnly": "rm -rf dist && tsc",
35
35
  "lint": "biome ci",
36
36
  "lint:check": "biome check --write --unsafe",
37
37
  "lint:format": "biome format --write",
@@ -54,7 +54,7 @@
54
54
  "@tsconfig/node22": "^22.0.5",
55
55
  "@types/bun": "^1.3.6",
56
56
  "@types/node": "^22.19.7",
57
- "@typescript/native-preview": "^7.0.0-dev.20260122.3",
57
+ "@typescript/native-preview": "^7.0.0-dev.20260122.4",
58
58
  "typescript": "^5.9.3"
59
59
  }
60
60
  }