@andocorp/cli 0.3.1 → 0.5.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/package.json CHANGED
@@ -1,41 +1,38 @@
1
1
  {
2
2
  "name": "@andocorp/cli",
3
- "version": "0.3.1",
4
- "description": "Ando CLI - agent-first terminal commands",
3
+ "version": "0.5.0",
4
+ "description": "Use Ando from a terminal: post to channels, ask agents, and let agents work on your server.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "ando": "./dist/index.js"
7
+ "ando": "./dist/cli.js"
8
8
  },
9
- "keywords": [
10
- "cli",
11
- "terminal",
12
- "chat",
13
- "collaboration"
14
- ],
15
- "author": "Asari Inc.",
16
- "license": "MIT",
17
9
  "files": [
18
- "dist"
10
+ "dist",
11
+ "README.md"
19
12
  ],
20
- "publishConfig": {
21
- "access": "public"
13
+ "engines": {
14
+ "node": ">=22"
22
15
  },
23
- "dependencies": {
24
- "@napi-rs/keyring": "^1.3.0",
25
- "@andocorp/sdk": "0.2.1"
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/Ando-Corporation/ando.git",
19
+ "directory": "packages/cli"
26
20
  },
27
21
  "devDependencies": {
28
- "@types/node": "^25.9.4",
29
- "@vitest/coverage-v8": "^4.1.9",
30
- "typescript": "^6.0.3",
31
- "vitest": "^4.1.9"
22
+ "@types/node": "^24.7.1",
23
+ "esbuild": "^0.28.2",
24
+ "tsrs": "0.18.0-ts7.1.0-dev.20260929",
25
+ "typescript": "npm:@typescript/typescript6@^6.0.2",
26
+ "@ando/machine": "0.0.0",
27
+ "@andocorp/sdk": "0.3.0-next.0"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
32
31
  },
33
32
  "scripts": {
34
- "build": "cd ../sdk && pnpm run build && cd ../cli && rm -rf dist && tsc && chmod +x ./dist/index.js",
35
- "dev": "pnpm run build && node ./dist/index.js",
36
- "lint": "tsc --noEmit",
37
- "test": "cd ../sdk && pnpm run build && cd ../cli && vitest run",
38
- "test:coverage": "cd ../sdk && pnpm run build && cd ../cli && vitest run --coverage",
39
- "typecheck": "cd ../sdk && pnpm run build && cd ../cli && tsc --noEmit"
33
+ "build": "node scripts/build.mjs",
34
+ "test": "node --experimental-strip-types --no-warnings=ExperimentalWarning --test src/*.test.ts",
35
+ "typecheck": "tsrs --noEmit -p tsconfig.json",
36
+ "pack:npm": "node scripts/pack-npm.mjs"
40
37
  }
41
38
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Ando Corp
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,297 +0,0 @@
1
- import { getStringFlag, hasFlag } from "./args.js";
2
- import { resolveConversation } from "./cli-helpers.js";
3
- import { printJson } from "./output.js";
4
- async function resolveConversationId(cliClient, parsedArgs) {
5
- const channelQuery = getStringFlag(parsedArgs, "channel", "c");
6
- const dmQuery = getStringFlag(parsedArgs, "dm", "d");
7
- const conversationQuery = getStringFlag(parsedArgs, "conversation");
8
- if (conversationQuery != null && channelQuery == null && dmQuery == null) {
9
- return conversationQuery;
10
- }
11
- const query = channelQuery ?? dmQuery ?? conversationQuery;
12
- if (query == null) {
13
- throw new Error("messages requires --channel, --dm, or --conversation.");
14
- }
15
- const memberships = await cliClient.getAllMemberships();
16
- const membership = resolveConversation(memberships, {
17
- allowChannels: dmQuery == null,
18
- allowDms: channelQuery == null,
19
- query,
20
- });
21
- return membership.conversation.id;
22
- }
23
- export async function runMessagesCommand(params) {
24
- const conversationId = await resolveConversationId(params.cliClient, params.parsedArgs);
25
- const limit = getStringFlag(params.parsedArgs, "limit", "m") ??
26
- getStringFlag(params.parsedArgs, "n", "n");
27
- const before = getStringFlag(params.parsedArgs, "before");
28
- const messageParams = {
29
- conversationId,
30
- };
31
- if (limit != null) {
32
- messageParams.limit = limit;
33
- }
34
- if (before != null) {
35
- messageParams.before = before;
36
- }
37
- const response = await params.apiClient.listConversationMessages(messageParams);
38
- if (hasFlag(params.parsedArgs, "json")) {
39
- printJson(response);
40
- return;
41
- }
42
- printMessageResults(response.items);
43
- }
44
- function printMessageResults(items) {
45
- for (const item of items) {
46
- const author = item.author_name ?? "unknown";
47
- const content = (item.content ?? "").replace(/\s+/g, " ").trim();
48
- process.stdout.write(`${item.id}\t${item.created_at}\t${author}\t${content}\n`);
49
- }
50
- }
51
- async function runSearchMessages(apiClient, parsedArgs, query, jsonFlag) {
52
- const searchParams = { q: query };
53
- const author = getStringFlag(parsedArgs, "author");
54
- const conversation = getStringFlag(parsedArgs, "conversation");
55
- const thread = getStringFlag(parsedArgs, "thread");
56
- const after = getStringFlag(parsedArgs, "after");
57
- const before = getStringFlag(parsedArgs, "before");
58
- const mode = parseSearchMode(getStringFlag(parsedArgs, "mode"));
59
- if (author != null) {
60
- searchParams.author = author;
61
- }
62
- if (conversation != null) {
63
- searchParams.conversation = conversation;
64
- }
65
- if (thread != null) {
66
- searchParams.thread = thread;
67
- }
68
- if (after != null) {
69
- searchParams.after = after;
70
- }
71
- if (before != null) {
72
- searchParams.before = before;
73
- }
74
- if (mode != null) {
75
- searchParams.mode = mode;
76
- }
77
- const response = await apiClient.searchMessages(searchParams);
78
- if (jsonFlag) {
79
- printJson(response);
80
- return;
81
- }
82
- printMessageResults(response.items);
83
- }
84
- async function runSearchMembers(apiClient, query, jsonFlag) {
85
- const response = await apiClient.searchMembers({ q: query });
86
- if (jsonFlag) {
87
- printJson(response);
88
- return;
89
- }
90
- for (const item of response.items) {
91
- const title = item.title == null || item.title === "" ? "" : ` (${item.title})`;
92
- process.stdout.write(`${item.id}\t${item.display_name ?? ""}\t${item.email ?? ""}${title}\n`);
93
- }
94
- }
95
- async function runSearchConversations(apiClient, query, jsonFlag) {
96
- const response = await apiClient.searchConversations({ q: query });
97
- if (jsonFlag) {
98
- printJson(response);
99
- return;
100
- }
101
- for (const item of response.items) {
102
- process.stdout.write(`${item.id}\t${item.type}\t${item.name ?? ""}\t${item.human_members_count} members\n`);
103
- }
104
- }
105
- async function runSearchClipboard(apiClient, query, jsonFlag) {
106
- const response = await apiClient.searchClipboards({ q: query });
107
- if (jsonFlag) {
108
- printJson(response);
109
- return;
110
- }
111
- for (const item of response.items) {
112
- process.stdout.write(`${item.id}\t${item.created_at}\t${item.title ?? ""}\t${item.item_count} items\n`);
113
- }
114
- }
115
- async function runSearchCalls(apiClient, parsedArgs, query, jsonFlag) {
116
- const searchParams = { q: query };
117
- const conversation = getStringFlag(parsedArgs, "conversation");
118
- const after = getStringFlag(parsedArgs, "after");
119
- const before = getStringFlag(parsedArgs, "before");
120
- if (conversation != null) {
121
- searchParams.conversation = conversation;
122
- }
123
- if (after != null) {
124
- searchParams.after = after;
125
- }
126
- if (before != null) {
127
- searchParams.before = before;
128
- }
129
- const response = await apiClient.searchCalls(searchParams);
130
- if (jsonFlag) {
131
- printJson(response);
132
- return;
133
- }
134
- for (const item of response.items) {
135
- process.stdout.write(`${item.id}\t${item.status}\t${item.conversation_name ?? ""}\t${item.duration_seconds ?? "-"}s\n`);
136
- }
137
- }
138
- export async function runSearchCommand(params) {
139
- const query = params.parsedArgs.positionals[1];
140
- const type = (getStringFlag(params.parsedArgs, "type", "t") ?? "messages").toLowerCase();
141
- const jsonFlag = hasFlag(params.parsedArgs, "json");
142
- if (query == null || query.trim() === "") {
143
- throw new Error('search requires a query, e.g. ando search "incident".');
144
- }
145
- switch (type) {
146
- case "messages": {
147
- await runSearchMessages(params.apiClient, params.parsedArgs, query, jsonFlag);
148
- return;
149
- }
150
- case "members": {
151
- await runSearchMembers(params.apiClient, query, jsonFlag);
152
- return;
153
- }
154
- case "conversations": {
155
- await runSearchConversations(params.apiClient, query, jsonFlag);
156
- return;
157
- }
158
- case "clipboard": {
159
- await runSearchClipboard(params.apiClient, query, jsonFlag);
160
- return;
161
- }
162
- case "calls": {
163
- await runSearchCalls(params.apiClient, params.parsedArgs, query, jsonFlag);
164
- return;
165
- }
166
- default:
167
- throw new Error(`Unknown search --type "${type}". Expected messages, members, conversations, clipboard, or calls.`);
168
- }
169
- }
170
- function parseSearchMode(value) {
171
- if (value == null) {
172
- return undefined;
173
- }
174
- if (value === "full-text" || value === "semantic") {
175
- return value;
176
- }
177
- throw new Error(`Unknown --mode "${value}". Expected full-text or semantic.`);
178
- }
179
- async function runGetMessage(apiClient, id, jsonFlag) {
180
- const response = await apiClient.getConversationMessageResult(id);
181
- if (jsonFlag) {
182
- printJson(response);
183
- return;
184
- }
185
- printMessageResults([response]);
186
- }
187
- async function runGetMember(apiClient, id, jsonFlag) {
188
- const response = await apiClient.getMember(id);
189
- if (jsonFlag) {
190
- printJson(response);
191
- return;
192
- }
193
- const title = response.title == null ? "" : ` (${response.title})`;
194
- process.stdout.write(`${response.id}\t${response.display_name ?? ""}\t${response.email ?? ""}${title}\n`);
195
- }
196
- async function runGetClipboard(apiClient, id, jsonFlag) {
197
- const response = await apiClient.getClipboard(id);
198
- if (jsonFlag) {
199
- printJson(response);
200
- return;
201
- }
202
- process.stdout.write(`${response.id}\t${response.title ?? ""}\t${response.created_at}\n`);
203
- for (const item of response.items) {
204
- process.stdout.write(` - ${item.type}\t${item.id}\t${item.name ?? item.display_name ?? item.author_name ?? ""}\n`);
205
- }
206
- }
207
- async function runGetCall(apiClient, id, jsonFlag) {
208
- const response = await apiClient.getCall(id);
209
- if (jsonFlag) {
210
- printJson(response);
211
- return;
212
- }
213
- process.stdout.write(`${response.id}\t${response.status}\t${response.conversation_name ?? ""}\t${response.duration_seconds ?? "-"}s\n`);
214
- for (const participant of response.participants) {
215
- process.stdout.write(` - ${participant.id}\t${participant.name ?? ""}\n`);
216
- }
217
- }
218
- async function runGetTranscript(apiClient, parsedArgs, id, jsonFlag) {
219
- const transcriptParams = {
220
- callId: id,
221
- };
222
- const limit = getStringFlag(parsedArgs, "limit");
223
- const cursor = getStringFlag(parsedArgs, "cursor");
224
- if (limit != null) {
225
- transcriptParams.limit = limit;
226
- }
227
- if (cursor != null) {
228
- transcriptParams.cursor = cursor;
229
- }
230
- const response = await apiClient.getCallTranscript(transcriptParams);
231
- if (jsonFlag) {
232
- printJson(response);
233
- return;
234
- }
235
- for (const segment of response.segments) {
236
- process.stdout.write(`${segment.start_ms}\t${segment.end_ms}\t${segment.speaker_name ?? ""}\t${segment.content}\n`);
237
- }
238
- }
239
- export async function runGetCommand(params) {
240
- const entity = params.parsedArgs.positionals[1];
241
- const id = params.parsedArgs.positionals[2];
242
- const jsonFlag = hasFlag(params.parsedArgs, "json");
243
- if (entity == null || id == null || id.trim() === "") {
244
- throw new Error("get requires an entity type and id, e.g. ando get message <id>.");
245
- }
246
- switch (entity) {
247
- case "message": {
248
- await runGetMessage(params.apiClient, id, jsonFlag);
249
- return;
250
- }
251
- case "member": {
252
- await runGetMember(params.apiClient, id, jsonFlag);
253
- return;
254
- }
255
- case "clipboard": {
256
- await runGetClipboard(params.apiClient, id, jsonFlag);
257
- return;
258
- }
259
- case "call": {
260
- await runGetCall(params.apiClient, id, jsonFlag);
261
- return;
262
- }
263
- case "transcript": {
264
- await runGetTranscript(params.apiClient, params.parsedArgs, id, jsonFlag);
265
- return;
266
- }
267
- default:
268
- throw new Error(`Unknown get entity "${entity}". Expected message, member, clipboard, call, or transcript.`);
269
- }
270
- }
271
- export async function runAgentThreadCommand(params) {
272
- const positionalId = params.parsedArgs.positionals[1];
273
- const messageId = positionalId ?? getStringFlag(params.parsedArgs, "message-id", "m");
274
- if (messageId == null || messageId.trim() === "") {
275
- throw new Error("thread requires a thread root message id.");
276
- }
277
- const threadParams = {
278
- messageId,
279
- };
280
- const limit = getStringFlag(params.parsedArgs, "limit");
281
- const after = getStringFlag(params.parsedArgs, "after");
282
- if (limit != null) {
283
- threadParams.limit = limit;
284
- }
285
- if (after != null) {
286
- threadParams.after = after;
287
- }
288
- const response = await params.apiClient.listThreadReplies(threadParams);
289
- if (hasFlag(params.parsedArgs, "json")) {
290
- printJson(response);
291
- return;
292
- }
293
- for (const reply of response.items) {
294
- const content = (reply.content ?? "").replace(/\s+/g, " ").trim();
295
- process.stdout.write(`${reply.id}\t${reply.created_at}\t${reply.author_name ?? ""}\t${content}\n`);
296
- }
297
- }
@@ -1,212 +0,0 @@
1
- import { requestAndoPublicApi, } from "@andocorp/sdk";
2
- import { buildBodyFromAssignments, defaultReadStdin, flagValue, parseInlineInputs, readDataFlagBody, } from "./api-inputs.js";
3
- import { applyPathParameterAssignments, buildOperationSpec, buildOperationUrl, listOperations, matchingOperations, operationCanUseConcretePath, printEndpointHelp, selectOperation, selectedMatches, validateOperationInputs, } from "./api-operations.js";
4
- import { hasFlag } from "./args.js";
5
- import { printJson } from "./output.js";
6
- import { getConfiguredApiHost } from "./session.js";
7
- import { DEFAULT_CLI_REQUEST_TIMEOUT_MS } from "./timeouts.js";
8
- function getRequestedMethod(parsedArgs) {
9
- return flagValue(parsedArgs, "method", "X")?.toUpperCase();
10
- }
11
- function printApiCommandHelp() {
12
- process.stdout.write(`
13
- ando api
14
-
15
- Usage:
16
- ando api ls [--json]
17
- ando api <path|operation-id> [--method|-X <method>] [--data|-d <json|-] [name==value] [Header:Value] [field=value] [field:=json]
18
- ando api <path|operation-id> --help
19
- ando api <path|operation-id> --spec
20
-
21
- Examples:
22
- ando api ls
23
- ando api searchMessages q==incident mode==semantic
24
- ando api getMember memberId=<member-id>
25
- ando api /v1/search/messages q==incident mode==semantic
26
- ando api /v1/conversations/<conversation-id>/messages markdown_content="hello" Idempotency-Key:<key>
27
- echo '{"markdown_content":"hello"}' | ando api /v1/conversations/<conversation-id>/messages --data -
28
-
29
- Input syntax:
30
- name==value query string parameter
31
- Header:Value declared request header
32
- field=value JSON body string field
33
- field:=json JSON body field parsed as JSON
34
- --data <json> complete JSON request body
35
- --data - read complete JSON request body from stdin
36
-
37
- Targets can be public paths or operation IDs from "ando api ls".
38
- For operation ID targets, supply required path parameters as name=value.
39
- `.trim() + "\n");
40
- }
41
- function formatErrorDetail(value) {
42
- return typeof value === "string" ? value : JSON.stringify(value, null, 2);
43
- }
44
- function printResponse(response) {
45
- if (response.empty) {
46
- process.stdout.write(`${response.status} ${response.statusText}\n`);
47
- return;
48
- }
49
- if (typeof response.body === "string") {
50
- process.stdout.write(response.body.endsWith("\n") ? response.body : `${response.body}\n`);
51
- return;
52
- }
53
- printJson(response.body);
54
- }
55
- function requestBodyFromInputs(params) {
56
- if (params.dataBody !== undefined && params.assignmentBody !== undefined) {
57
- throw new Error("Use either --data or inline body fields, not both.");
58
- }
59
- return params.dataBody !== undefined ? params.dataBody : params.assignmentBody;
60
- }
61
- function inferRequestMethod(params) {
62
- if (params.requestedMethod != null) {
63
- return params.requestedMethod;
64
- }
65
- const methods = [...new Set(params.matches.map((match) => match.operation.method))];
66
- if (methods.length === 1) {
67
- return methods[0];
68
- }
69
- if (params.body !== undefined) {
70
- const bodyMethods = [
71
- ...new Set(params.matches
72
- .filter((match) => match.operation.requestBodySchema != null)
73
- .map((match) => match.operation.method)),
74
- ];
75
- if (bodyMethods.length === 1) {
76
- return bodyMethods[0];
77
- }
78
- return bodyMethods.includes("POST") ? "POST" : (bodyMethods[0] ?? "POST");
79
- }
80
- return methods.includes("GET") ? "GET" : "POST";
81
- }
82
- function rejectMixedBodySourcesBeforeRead(params) {
83
- if (params.inlineBodyFieldCount > 0 && hasFlag(params.parsedArgs, "data", "d")) {
84
- throw new Error("Use either --data or inline body fields, not both.");
85
- }
86
- }
87
- function selectPathParameterMatch(params) {
88
- if (params.requestedMethod != null) {
89
- return selectOperation(params.rawPath, params.matches, params.requestedMethod);
90
- }
91
- const match = params.matches[0];
92
- if (match == null) {
93
- throw new Error(`No public API operation matches ${params.rawPath}.`);
94
- }
95
- return match;
96
- }
97
- function createRawApiTimeoutSignal() {
98
- const controller = new AbortController();
99
- const timeout = setTimeout(() => {
100
- controller.abort(new Error(`[ando-cli] api request timed out after ${DEFAULT_CLI_REQUEST_TIMEOUT_MS}ms`));
101
- }, DEFAULT_CLI_REQUEST_TIMEOUT_MS);
102
- return {
103
- signal: controller.signal,
104
- clear: () => {
105
- clearTimeout(timeout);
106
- },
107
- };
108
- }
109
- async function prepareApiRequest(params) {
110
- const inlineInputs = parseInlineInputs(params.parsedArgs.positionals.slice(2));
111
- const pathParameterMatch = selectPathParameterMatch({
112
- matches: params.matches,
113
- rawPath: params.rawPath,
114
- requestedMethod: params.requestedMethod,
115
- });
116
- const pathParameterInputs = applyPathParameterAssignments({
117
- bodyAssignments: inlineInputs.bodyAssignments,
118
- match: pathParameterMatch,
119
- });
120
- rejectMixedBodySourcesBeforeRead({
121
- parsedArgs: params.parsedArgs,
122
- inlineBodyFieldCount: pathParameterInputs.bodyAssignments.length,
123
- });
124
- const dataBody = await readDataFlagBody({
125
- parsedArgs: params.parsedArgs,
126
- readStdin: params.readStdin,
127
- });
128
- const assignmentBody = pathParameterInputs.bodyAssignments.length > 0
129
- ? buildBodyFromAssignments(pathParameterInputs.bodyAssignments)
130
- : undefined;
131
- const body = requestBodyFromInputs({ assignmentBody, dataBody });
132
- const method = inferRequestMethod({
133
- body,
134
- matches: params.matches,
135
- requestedMethod: params.requestedMethod,
136
- });
137
- const selectedMatch = selectOperation(params.rawPath, params.matches, method);
138
- const { match } = applyPathParameterAssignments({
139
- bodyAssignments: inlineInputs.bodyAssignments,
140
- match: selectedMatch,
141
- });
142
- if (!operationCanUseConcretePath(match)) {
143
- throw new Error(`Supply concrete path values before calling ${match.id}. Use ${match.operation.pathParameters.map((name) => `${name}=<value>`).join(" ")}.`);
144
- }
145
- validateOperationInputs({
146
- body,
147
- headers: inlineInputs.headers,
148
- inlineQuery: inlineInputs.query,
149
- match,
150
- });
151
- const config = await params.loadConfig();
152
- return {
153
- apiKey: config.apiKey,
154
- body,
155
- headers: inlineInputs.headers,
156
- method,
157
- url: buildOperationUrl({
158
- apiHost: getConfiguredApiHost(params.parsedArgs, config.apiHost ?? null),
159
- concretePath: match.concretePath,
160
- pathQueryString: match.queryString,
161
- inlineQuery: inlineInputs.query,
162
- }),
163
- };
164
- }
165
- async function runPreparedRequest(params) {
166
- const timeout = createRawApiTimeoutSignal();
167
- try {
168
- const response = await params.requestApi({
169
- ...params.request,
170
- signal: params.request.signal ?? timeout.signal,
171
- });
172
- if (!response.ok) {
173
- const detail = response.empty ? "" : `\n${formatErrorDetail(response.body)}`;
174
- throw new Error(`Public API request failed: ${response.status} ${response.statusText}${detail}`);
175
- }
176
- printResponse(response);
177
- }
178
- finally {
179
- timeout.clear();
180
- }
181
- }
182
- export async function runApiCommand({ parsedArgs, loadConfig, requestApi = requestAndoPublicApi, readStdin = defaultReadStdin, }) {
183
- const rawPath = parsedArgs.positionals[1];
184
- if (rawPath == null || rawPath === "help") {
185
- printApiCommandHelp();
186
- return;
187
- }
188
- if (rawPath === "ls" || rawPath === "list") {
189
- listOperations(parsedArgs);
190
- return;
191
- }
192
- const matches = matchingOperations(rawPath);
193
- const requestedMethod = getRequestedMethod(parsedArgs);
194
- const visibleMatches = selectedMatches(matches, requestedMethod);
195
- if (hasFlag(parsedArgs, "help", "h")) {
196
- printEndpointHelp(rawPath, visibleMatches);
197
- return;
198
- }
199
- if (hasFlag(parsedArgs, "spec")) {
200
- printJson(buildOperationSpec(visibleMatches));
201
- return;
202
- }
203
- const request = await prepareApiRequest({
204
- loadConfig,
205
- matches,
206
- parsedArgs,
207
- rawPath,
208
- readStdin,
209
- requestedMethod,
210
- });
211
- await runPreparedRequest({ request, requestApi });
212
- }