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