@startanaicompany/techsaac-cli 0.0.2 → 0.0.4
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/dist/cli.js +98 -81
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -98,7 +98,15 @@ function formatTable(rows) {
|
|
|
98
98
|
if (cols.length === 0)
|
|
99
99
|
return JSON.stringify(rows, null, 2);
|
|
100
100
|
// Calculate widths
|
|
101
|
-
const widths = cols.map(c =>
|
|
101
|
+
const widths = cols.map(c => {
|
|
102
|
+
const maxDataWidth = Math.max(c.length, ...rows.map(r => String(r[c] ?? '').length));
|
|
103
|
+
// Don't truncate columns that look like keys/IDs (hashes, UUIDs)
|
|
104
|
+
const looksLikeKey = rows.some(r => {
|
|
105
|
+
const v = String(r[c] ?? '');
|
|
106
|
+
return v.length > 50 && /^[a-f0-9-]+$/i.test(v);
|
|
107
|
+
});
|
|
108
|
+
return looksLikeKey ? maxDataWidth : Math.min(50, maxDataWidth);
|
|
109
|
+
});
|
|
102
110
|
const header = cols.map((c, i) => c.padEnd(widths[i])).join(' ');
|
|
103
111
|
const separator = widths.map(w => '─'.repeat(w)).join('──');
|
|
104
112
|
const body = rows.map(r => cols
|
|
@@ -138,112 +146,112 @@ function flagsToArgs(flags) {
|
|
|
138
146
|
const COMMANDS = {
|
|
139
147
|
// Organizations
|
|
140
148
|
'list-orgs': { tool: 'list_organizations', desc: 'List organizations' },
|
|
141
|
-
'create-org': { tool: 'create_organization', desc: 'Create organization' },
|
|
142
|
-
'update-org': { tool: 'update_organization', desc: 'Update organization' },
|
|
149
|
+
'create-org': { tool: 'create_organization', desc: 'Create organization', positionalArgs: ['name'] },
|
|
150
|
+
'update-org': { tool: 'update_organization', desc: 'Update organization', positionalArgs: ['organization_id'] },
|
|
143
151
|
// Products
|
|
144
152
|
'list-products': { tool: 'list_products', desc: 'List products' },
|
|
145
|
-
'get-product': { tool: 'get_product', desc: 'Get product details' },
|
|
146
|
-
'create-product': { tool: 'create_product', desc: 'Create product' },
|
|
147
|
-
'update-product': { tool: 'update_product', desc: 'Update product' },
|
|
148
|
-
'get-product-context': { tool: 'get_product_context', desc: 'Get product context files' },
|
|
149
|
-
'update-product-context': { tool: 'update_product_context', desc: 'Update product context' },
|
|
150
|
-
'move-product': { tool: 'move_product', desc: 'Move product to another org' },
|
|
153
|
+
'get-product': { tool: 'get_product', desc: 'Get product details', positionalArgs: ['product_id'] },
|
|
154
|
+
'create-product': { tool: 'create_product', desc: 'Create product', positionalArgs: ['organization_id', 'name'] },
|
|
155
|
+
'update-product': { tool: 'update_product', desc: 'Update product', positionalArgs: ['product_id'] },
|
|
156
|
+
'get-product-context': { tool: 'get_product_context', desc: 'Get product context files', positionalArgs: ['product_id'] },
|
|
157
|
+
'update-product-context': { tool: 'update_product_context', desc: 'Update product context', positionalArgs: ['product_id'] },
|
|
158
|
+
'move-product': { tool: 'move_product', desc: 'Move product to another org', positionalArgs: ['product_id', 'target_organization_id'] },
|
|
151
159
|
// Agents — core
|
|
152
160
|
'list-agents': { tool: 'list_agents', desc: 'List agents' },
|
|
153
|
-
'get-agent': { tool: 'get_agent', desc: 'Get agent details' },
|
|
154
|
-
'create-agent': { tool: 'create_agent', desc: 'Create agent' },
|
|
155
|
-
'update-agent': { tool: 'update_agent', desc: 'Update agent' },
|
|
156
|
-
'delete-agent': { tool: 'delete_agent', desc: 'Delete agent' },
|
|
157
|
-
'clone-agent': { tool: 'clone_agent', desc: 'Clone agent with config' },
|
|
158
|
-
'move-agent': { tool: 'move_agent', desc: 'Move agent to another org' },
|
|
159
|
-
'move-agent-to-product': { tool: 'move_agent_to_product', desc: 'Move agent to another product' },
|
|
161
|
+
'get-agent': { tool: 'get_agent', desc: 'Get agent details', positionalArgs: ['agent_id'] },
|
|
162
|
+
'create-agent': { tool: 'create_agent', desc: 'Create agent', positionalArgs: ['product_id', 'name', 'agent_name'] },
|
|
163
|
+
'update-agent': { tool: 'update_agent', desc: 'Update agent', positionalArgs: ['agent_id'] },
|
|
164
|
+
'delete-agent': { tool: 'delete_agent', desc: 'Delete agent', positionalArgs: ['agent_id'] },
|
|
165
|
+
'clone-agent': { tool: 'clone_agent', desc: 'Clone agent with config', positionalArgs: ['source_agent_id', 'new_name', 'new_agent_name'] },
|
|
166
|
+
'move-agent': { tool: 'move_agent', desc: 'Move agent to another org', positionalArgs: ['agent_id', 'target_organization_id'] },
|
|
167
|
+
'move-agent-to-product': { tool: 'move_agent_to_product', desc: 'Move agent to another product', positionalArgs: ['agent_id', 'target_product_id'] },
|
|
160
168
|
// Agent config & status
|
|
161
|
-
'get-config': { tool: 'get_agent_config', desc: 'Get agent config' },
|
|
162
|
-
'update-config': { tool: 'update_agent_config', desc: 'Update agent config' },
|
|
163
|
-
'get-status': { tool: 'get_agent_status', desc: 'Get agent status' },
|
|
164
|
-
'set-status': { tool: 'set_agent_status', desc: 'Set agent status' },
|
|
165
|
-
'get-env': { tool: 'get_agent_env_vars', desc: 'Get agent env vars (merged)' },
|
|
166
|
-
'set-env': { tool: 'set_agent_env_var', desc: 'Set agent env var' },
|
|
167
|
-
'delete-env': { tool: 'delete_agent_env_var', desc: 'Delete agent env var' },
|
|
168
|
-
'set-product-env': { tool: 'set_product_env_var', desc: 'Set product env var' },
|
|
169
|
-
'delete-product-env': { tool: 'delete_product_env_var', desc: 'Delete product env var' },
|
|
169
|
+
'get-config': { tool: 'get_agent_config', desc: 'Get agent config', positionalArgs: ['agent_id'] },
|
|
170
|
+
'update-config': { tool: 'update_agent_config', desc: 'Update agent config', positionalArgs: ['agent_id'] },
|
|
171
|
+
'get-status': { tool: 'get_agent_status', desc: 'Get agent status', positionalArgs: ['agent_id'] },
|
|
172
|
+
'set-status': { tool: 'set_agent_status', desc: 'Set agent status', positionalArgs: ['agent_id', 'status'] },
|
|
173
|
+
'get-env': { tool: 'get_agent_env_vars', desc: 'Get agent env vars (merged)', positionalArgs: ['agent_id'] },
|
|
174
|
+
'set-env': { tool: 'set_agent_env_var', desc: 'Set agent env var', positionalArgs: ['agent_id', 'key', 'value'] },
|
|
175
|
+
'delete-env': { tool: 'delete_agent_env_var', desc: 'Delete agent env var', positionalArgs: ['agent_id', 'key'] },
|
|
176
|
+
'set-product-env': { tool: 'set_product_env_var', desc: 'Set product env var', positionalArgs: ['product_id', 'key', 'value'] },
|
|
177
|
+
'delete-product-env': { tool: 'delete_product_env_var', desc: 'Delete product env var', positionalArgs: ['product_id', 'key'] },
|
|
170
178
|
// Agent context
|
|
171
|
-
'get-context': { tool: 'get_agent_context', desc: 'Get agent context files' },
|
|
172
|
-
'update-context': { tool: 'update_agent_context', desc: 'Update agent context' },
|
|
179
|
+
'get-context': { tool: 'get_agent_context', desc: 'Get agent context files', positionalArgs: ['agent_id'] },
|
|
180
|
+
'update-context': { tool: 'update_agent_context', desc: 'Update agent context', positionalArgs: ['agent_id'] },
|
|
173
181
|
// Agent lifecycle
|
|
174
|
-
'start': { tool: 'start_agent', desc: 'Start agent' },
|
|
175
|
-
'stop': { tool: 'stop_agent', desc: 'Stop agent' },
|
|
176
|
-
'restart': { tool: 'restart_agent', desc: 'Restart agent' },
|
|
177
|
-
'sync-files': { tool: 'sync_agent_files', desc: 'Hot-reload agent context files' },
|
|
182
|
+
'start': { tool: 'start_agent', desc: 'Start agent', positionalArgs: ['agent_id'] },
|
|
183
|
+
'stop': { tool: 'stop_agent', desc: 'Stop agent', positionalArgs: ['agent_id'] },
|
|
184
|
+
'restart': { tool: 'restart_agent', desc: 'Restart agent', positionalArgs: ['agent_id'] },
|
|
185
|
+
'sync-files': { tool: 'sync_agent_files', desc: 'Hot-reload agent context files', positionalArgs: ['agent_id'] },
|
|
178
186
|
// Prompts
|
|
179
|
-
'list-prompts': { tool: 'list_agent_prompts', desc: 'List agent prompts' },
|
|
180
|
-
'create-prompt': { tool: 'create_agent_prompt', desc: 'Create agent prompt' },
|
|
181
|
-
'update-prompt': { tool: 'update_agent_prompt', desc: 'Update prompt' },
|
|
182
|
-
'delete-prompt': { tool: 'delete_agent_prompt', desc: 'Delete prompt' },
|
|
187
|
+
'list-prompts': { tool: 'list_agent_prompts', desc: 'List agent prompts', positionalArgs: ['agent_id'] },
|
|
188
|
+
'create-prompt': { tool: 'create_agent_prompt', desc: 'Create agent prompt', positionalArgs: ['agent_id', 'prompt_id'] },
|
|
189
|
+
'update-prompt': { tool: 'update_agent_prompt', desc: 'Update prompt', positionalArgs: ['prompt_id'] },
|
|
190
|
+
'delete-prompt': { tool: 'delete_agent_prompt', desc: 'Delete prompt', positionalArgs: ['prompt_id'] },
|
|
183
191
|
// Activation rules
|
|
184
|
-
'list-rules': { tool: 'list_activation_rules', desc: 'List activation rules' },
|
|
185
|
-
'get-rule': { tool: 'get_activation_rule', desc: 'Get activation rule' },
|
|
186
|
-
'create-rule': { tool: 'create_activation_rule', desc: 'Create activation rule' },
|
|
187
|
-
'update-rule': { tool: 'update_activation_rule', desc: 'Update activation rule' },
|
|
188
|
-
'delete-rule': { tool: 'delete_activation_rule', desc: 'Delete activation rule' },
|
|
189
|
-
'toggle-rule': { tool: 'toggle_activation_rule', desc: 'Toggle activation rule' },
|
|
190
|
-
'rule-fields': { tool: 'get_activation_rule_fields', desc: 'Get available rule condition fields' },
|
|
192
|
+
'list-rules': { tool: 'list_activation_rules', desc: 'List activation rules', positionalArgs: ['agent_id'] },
|
|
193
|
+
'get-rule': { tool: 'get_activation_rule', desc: 'Get activation rule', positionalArgs: ['rule_id'] },
|
|
194
|
+
'create-rule': { tool: 'create_activation_rule', desc: 'Create activation rule', positionalArgs: ['agent_id'] },
|
|
195
|
+
'update-rule': { tool: 'update_activation_rule', desc: 'Update activation rule', positionalArgs: ['rule_id'] },
|
|
196
|
+
'delete-rule': { tool: 'delete_activation_rule', desc: 'Delete activation rule', positionalArgs: ['rule_id'] },
|
|
197
|
+
'toggle-rule': { tool: 'toggle_activation_rule', desc: 'Toggle activation rule', positionalArgs: ['rule_id'] },
|
|
198
|
+
'rule-fields': { tool: 'get_activation_rule_fields', desc: 'Get available rule condition fields', positionalArgs: ['rule_type'] },
|
|
191
199
|
// Container & Claude accounts
|
|
192
200
|
'list-images': { tool: 'list_container_images', desc: 'List available container images' },
|
|
193
|
-
'set-image': { tool: 'set_agent_container_image', desc: 'Set agent container image' },
|
|
201
|
+
'set-image': { tool: 'set_agent_container_image', desc: 'Set agent container image', positionalArgs: ['agent_id', 'container_image'] },
|
|
194
202
|
'list-accounts': { tool: 'list_claude_accounts', desc: 'List Claude accounts' },
|
|
195
|
-
'set-account': { tool: 'set_agent_claude_account', desc: 'Assign Claude account to agent' },
|
|
203
|
+
'set-account': { tool: 'set_agent_claude_account', desc: 'Assign Claude account to agent', positionalArgs: ['agent_id', 'claude_account_id'] },
|
|
196
204
|
// Communication
|
|
197
|
-
'send': { tool: 'send_orchat_message', desc: 'Send message to agent' },
|
|
198
|
-
'history': { tool: 'get_orchat_history', desc: 'Get orchat history' },
|
|
199
|
-
'send-telegram': { tool: 'send_telegram_message', desc: 'Send Telegram message' },
|
|
205
|
+
'send': { tool: 'send_orchat_message', desc: 'Send message to agent', positionalArgs: ['agent_id', 'message'] },
|
|
206
|
+
'history': { tool: 'get_orchat_history', desc: 'Get orchat history', positionalArgs: ['agent_id'] },
|
|
207
|
+
'send-telegram': { tool: 'send_telegram_message', desc: 'Send Telegram message', positionalArgs: ['text'] },
|
|
200
208
|
// HIVE
|
|
201
|
-
'hive-status': { tool: 'get_agent_hive_status', desc: 'Get HIVE identity status' },
|
|
202
|
-
'hive-rename': { tool: 'rename_agent_hive', desc: 'Rename HIVE identity' },
|
|
203
|
-
'hive-groups': { tool: 'list_agent_hive_groups', desc: 'List agent HIVE groups' },
|
|
204
|
-
'hive-add': { tool: 'add_agent_to_hive_group', desc: 'Add agent to HIVE group' },
|
|
205
|
-
'hive-remove': { tool: 'remove_agent_from_hive_group', desc: 'Remove agent from HIVE group' },
|
|
206
|
-
'hive-repair': { tool: 'repair_agent_hive_groups', desc: 'Repair HIVE group memberships' },
|
|
207
|
-
'hive-org-groups': { tool: 'list_organization_hive_groups', desc: 'List org HIVE groups' },
|
|
208
|
-
'hive-members': { tool: 'list_hive_group_members', desc: 'List HIVE group members' },
|
|
209
|
-
'hive-connect': { tool: 'enable_agent_communication', desc: 'Enable inter-agent communication' },
|
|
209
|
+
'hive-status': { tool: 'get_agent_hive_status', desc: 'Get HIVE identity status', positionalArgs: ['agent_id'] },
|
|
210
|
+
'hive-rename': { tool: 'rename_agent_hive', desc: 'Rename HIVE identity', positionalArgs: ['agent_id', 'hive_name'] },
|
|
211
|
+
'hive-groups': { tool: 'list_agent_hive_groups', desc: 'List agent HIVE groups', positionalArgs: ['agent_id'] },
|
|
212
|
+
'hive-add': { tool: 'add_agent_to_hive_group', desc: 'Add agent to HIVE group', positionalArgs: ['agent_id', 'group_id'] },
|
|
213
|
+
'hive-remove': { tool: 'remove_agent_from_hive_group', desc: 'Remove agent from HIVE group', positionalArgs: ['agent_id', 'group_id'] },
|
|
214
|
+
'hive-repair': { tool: 'repair_agent_hive_groups', desc: 'Repair HIVE group memberships', positionalArgs: ['agent_id'] },
|
|
215
|
+
'hive-org-groups': { tool: 'list_organization_hive_groups', desc: 'List org HIVE groups', positionalArgs: ['organization_id'] },
|
|
216
|
+
'hive-members': { tool: 'list_hive_group_members', desc: 'List HIVE group members', positionalArgs: ['group_id'] },
|
|
217
|
+
'hive-connect': { tool: 'enable_agent_communication', desc: 'Enable inter-agent communication', positionalArgs: ['source_agent_id', 'target_agent_id'] },
|
|
210
218
|
// GitHub
|
|
211
219
|
'list-repos': { tool: 'list_github_repos', desc: 'List GitHub repos' },
|
|
212
220
|
'list-github-orgs': { tool: 'list_github_orgs', desc: 'List GitHub organizations' },
|
|
213
|
-
'list-org-repos': { tool: 'list_github_org_repos', desc: 'List repos in GitHub org' },
|
|
214
|
-
'list-branches': { tool: 'list_github_branches', desc: 'List repo branches' },
|
|
215
|
-
'agent-repos': { tool: 'get_agent_repositories', desc: 'Get agent linked repos' },
|
|
216
|
-
'link-repo': { tool: 'link_agent_repository', desc: 'Link repo to agent' },
|
|
217
|
-
'update-repo': { tool: 'update_agent_repository', desc: 'Update repo settings' },
|
|
218
|
-
'unlink-repo': { tool: 'unlink_agent_repository', desc: 'Unlink repo from agent' },
|
|
221
|
+
'list-org-repos': { tool: 'list_github_org_repos', desc: 'List repos in GitHub org', positionalArgs: ['org'] },
|
|
222
|
+
'list-branches': { tool: 'list_github_branches', desc: 'List repo branches', positionalArgs: ['owner', 'repo'] },
|
|
223
|
+
'agent-repos': { tool: 'get_agent_repositories', desc: 'Get agent linked repos', positionalArgs: ['agent_id'] },
|
|
224
|
+
'link-repo': { tool: 'link_agent_repository', desc: 'Link repo to agent', positionalArgs: ['agent_id', 'repository_url', 'repository_name'] },
|
|
225
|
+
'update-repo': { tool: 'update_agent_repository', desc: 'Update repo settings', positionalArgs: ['agent_id', 'repository_url'] },
|
|
226
|
+
'unlink-repo': { tool: 'unlink_agent_repository', desc: 'Unlink repo from agent', positionalArgs: ['agent_id', 'repository_url'] },
|
|
219
227
|
'list-tokens': { tool: 'list_github_tokens', desc: 'List GitHub tokens' },
|
|
220
|
-
'save-token': { tool: 'save_github_token', desc: 'Save GitHub token' },
|
|
221
|
-
'delete-token': { tool: 'delete_github_token', desc: 'Delete GitHub token' },
|
|
222
|
-
'validate-token': { tool: 'validate_github_token', desc: 'Validate GitHub token' },
|
|
228
|
+
'save-token': { tool: 'save_github_token', desc: 'Save GitHub token', positionalArgs: ['name', 'token'] },
|
|
229
|
+
'delete-token': { tool: 'delete_github_token', desc: 'Delete GitHub token', positionalArgs: ['name'] },
|
|
230
|
+
'validate-token': { tool: 'validate_github_token', desc: 'Validate GitHub token', positionalArgs: ['token'] },
|
|
223
231
|
// Scripts & cron
|
|
224
|
-
'list-scripts': { tool: 'list_agent_scripts', desc: 'List agent scripts' },
|
|
225
|
-
'get-script': { tool: 'get_agent_script', desc: 'Get agent script content' },
|
|
226
|
-
'sync-scripts': { tool: 'sync_agent_scripts', desc: 'Sync scripts from container' },
|
|
227
|
-
'list-crontabs': { tool: 'list_agent_crontabs', desc: 'List agent cron jobs' },
|
|
228
|
-
'sync-crontabs': { tool: 'sync_agent_crontabs', desc: 'Sync cron jobs from container' },
|
|
232
|
+
'list-scripts': { tool: 'list_agent_scripts', desc: 'List agent scripts', positionalArgs: ['agent_id'] },
|
|
233
|
+
'get-script': { tool: 'get_agent_script', desc: 'Get agent script content', positionalArgs: ['agent_id', 'filename'] },
|
|
234
|
+
'sync-scripts': { tool: 'sync_agent_scripts', desc: 'Sync scripts from container', positionalArgs: ['agent_id'] },
|
|
235
|
+
'list-crontabs': { tool: 'list_agent_crontabs', desc: 'List agent cron jobs', positionalArgs: ['agent_id'] },
|
|
236
|
+
'sync-crontabs': { tool: 'sync_agent_crontabs', desc: 'Sync cron jobs from container', positionalArgs: ['agent_id'] },
|
|
229
237
|
// Personas & company
|
|
230
238
|
'search-personas': { tool: 'search_persona_templates', desc: 'Search persona templates' },
|
|
231
|
-
'get-persona': { tool: 'get_persona_template', desc: 'Get persona template' },
|
|
239
|
+
'get-persona': { tool: 'get_persona_template', desc: 'Get persona template', positionalArgs: ['slug'] },
|
|
232
240
|
'persona-categories': { tool: 'get_persona_categories', desc: 'List persona categories' },
|
|
233
|
-
'create-company': { tool: 'create_company', desc: 'Create AI company (background)' },
|
|
241
|
+
'create-company': { tool: 'create_company', desc: 'Create AI company (background)', positionalArgs: ['prompt'] },
|
|
234
242
|
// Integrations
|
|
235
243
|
'list-integrations': { tool: 'list_integration_catalog', desc: 'List available integrations' },
|
|
236
|
-
'agent-integrations': { tool: 'list_agent_integrations', desc: 'List agent integrations' },
|
|
237
|
-
'connect': { tool: 'connect_integration', desc: 'Connect integration' },
|
|
238
|
-
'disconnect': { tool: 'disconnect_integration', desc: 'Disconnect integration' },
|
|
239
|
-
'integration-status': { tool: 'get_integration_status', desc: 'Get integration status' },
|
|
244
|
+
'agent-integrations': { tool: 'list_agent_integrations', desc: 'List agent integrations', positionalArgs: ['agent_id'] },
|
|
245
|
+
'connect': { tool: 'connect_integration', desc: 'Connect integration', positionalArgs: ['agent_id', 'provider'] },
|
|
246
|
+
'disconnect': { tool: 'disconnect_integration', desc: 'Disconnect integration', positionalArgs: ['connection_id'] },
|
|
247
|
+
'integration-status': { tool: 'get_integration_status', desc: 'Get integration status', positionalArgs: ['connection_id'] },
|
|
240
248
|
// Workspace
|
|
241
249
|
'workspace-keys': { tool: 'get_workspace_keys', desc: 'List Workspace API keys for all orgs' },
|
|
242
250
|
// Usage & diagnostics
|
|
243
|
-
'usage': { tool: 'get_token_usage', desc: 'Get token usage' },
|
|
244
|
-
'usage-range': { tool: 'get_token_usage_range', desc: 'Get token usage time series' },
|
|
245
|
-
'diagnose': { tool: 'diagnose_assistant', desc: 'Diagnose assistant' },
|
|
246
|
-
'logs': { tool: 'get_activity_logs', desc: 'Get activity logs' },
|
|
251
|
+
'usage': { tool: 'get_token_usage', desc: 'Get token usage', positionalArgs: ['scope', 'id'] },
|
|
252
|
+
'usage-range': { tool: 'get_token_usage_range', desc: 'Get token usage time series', positionalArgs: ['scope', 'id'] },
|
|
253
|
+
'diagnose': { tool: 'diagnose_assistant', desc: 'Diagnose assistant', positionalArgs: ['agent_id'] },
|
|
254
|
+
'logs': { tool: 'get_activity_logs', desc: 'Get activity logs', positionalArgs: ['organization_id'] },
|
|
247
255
|
};
|
|
248
256
|
// ─── Help ───────────────────────────────────────────────────────────────────
|
|
249
257
|
function printHelp() {
|
|
@@ -330,7 +338,7 @@ Examples:
|
|
|
330
338
|
`);
|
|
331
339
|
}
|
|
332
340
|
// ─── Main ───────────────────────────────────────────────────────────────────
|
|
333
|
-
const VERSION = '0.0.
|
|
341
|
+
const VERSION = '0.0.4';
|
|
334
342
|
async function main() {
|
|
335
343
|
const args = process.argv.slice(2);
|
|
336
344
|
if (args.length === 0 || args[0] === 'help' || args[0] === '--help' || args[0] === '-h') {
|
|
@@ -383,7 +391,16 @@ async function main() {
|
|
|
383
391
|
console.error(`Run 'hive help' for available commands.`);
|
|
384
392
|
process.exit(1);
|
|
385
393
|
}
|
|
394
|
+
// Map positional args to named params, then merge with --flags
|
|
386
395
|
const toolArgs = def.mapFlags ? def.mapFlags(flags) : flagsToArgs(flags);
|
|
396
|
+
if (def.positionalArgs && positional.length > 0) {
|
|
397
|
+
for (let i = 0; i < Math.min(positional.length, def.positionalArgs.length); i++) {
|
|
398
|
+
const paramName = def.positionalArgs[i];
|
|
399
|
+
if (!(paramName in toolArgs)) {
|
|
400
|
+
toolArgs[paramName] = autoType(positional[i]);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
387
404
|
const result = await client.call(def.tool, toolArgs);
|
|
388
405
|
console.log(formatOutput(result, format));
|
|
389
406
|
}
|