@nordsym/apiclaw 2.1.0 → 2.2.1
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/README.md +15 -2
- package/dist/bin-http.js +0 -0
- package/dist/bin.bundled.js +79288 -0
- package/dist/funnel-client.d.ts +24 -0
- package/dist/funnel-client.d.ts.map +1 -0
- package/dist/funnel-client.js +131 -0
- package/dist/funnel-client.js.map +1 -0
- package/dist/funnel.test.d.ts +2 -0
- package/dist/funnel.test.d.ts.map +1 -0
- package/dist/funnel.test.js +145 -0
- package/dist/funnel.test.js.map +1 -0
- package/dist/gateway-client.d.ts.map +1 -1
- package/dist/gateway-client.js +24 -2
- package/dist/gateway-client.js.map +1 -1
- package/dist/index.bundled.js +61263 -0
- package/dist/index.js +161 -74
- package/dist/index.js.map +1 -1
- package/dist/postinstall.d.ts +0 -5
- package/dist/postinstall.d.ts.map +1 -1
- package/dist/postinstall.js +24 -3
- package/dist/postinstall.js.map +1 -1
- package/dist/registration-guard.d.ts +29 -0
- package/dist/registration-guard.d.ts.map +1 -0
- package/dist/registration-guard.js +87 -0
- package/dist/registration-guard.js.map +1 -0
- package/package.json +7 -2
- package/.claude/settings.local.json +0 -9
- package/.env.prod +0 -1
- package/apiclaw-README.md +0 -494
- package/convex/_generated/api.d.ts +0 -137
- package/convex/_generated/api.js +0 -23
- package/convex/_generated/dataModel.d.ts +0 -60
- package/convex/_generated/server.d.ts +0 -143
- package/convex/_generated/server.js +0 -93
- package/convex/adminActivate.ts +0 -53
- package/convex/adminStats.ts +0 -306
- package/convex/agents.ts +0 -939
- package/convex/analytics.ts +0 -187
- package/convex/apiKeys.ts +0 -220
- package/convex/backfillAnalytics.ts +0 -272
- package/convex/backfillSearchLogs.ts +0 -35
- package/convex/billing.ts +0 -834
- package/convex/capabilities.ts +0 -157
- package/convex/chains.ts +0 -1318
- package/convex/credits.ts +0 -211
- package/convex/crons.ts +0 -50
- package/convex/debugFilestackLogs.ts +0 -16
- package/convex/debugGetToken.ts +0 -18
- package/convex/directCall.ts +0 -713
- package/convex/earnProgress.ts +0 -753
- package/convex/email.ts +0 -329
- package/convex/feedback.ts +0 -265
- package/convex/http.ts +0 -3430
- package/convex/inbound.ts +0 -32
- package/convex/logs.ts +0 -701
- package/convex/migrateFilestack.ts +0 -81
- package/convex/migratePartnersProd.ts +0 -174
- package/convex/migratePratham.ts +0 -126
- package/convex/migrateProviderWorkspaces.ts +0 -175
- package/convex/mou.ts +0 -91
- package/convex/providerKeys.ts +0 -289
- package/convex/providers.ts +0 -1135
- package/convex/purchases.ts +0 -183
- package/convex/ratelimit.ts +0 -104
- package/convex/schema.ts +0 -869
- package/convex/searchLogs.ts +0 -265
- package/convex/seedAPILayerAPIs.ts +0 -191
- package/convex/seedDirectCallConfigs.ts +0 -336
- package/convex/seedPratham.ts +0 -149
- package/convex/spendAlerts.ts +0 -442
- package/convex/stripeActions.ts +0 -607
- package/convex/teams.ts +0 -243
- package/convex/telemetry.ts +0 -81
- package/convex/tsconfig.json +0 -25
- package/convex/updateAPIStatus.ts +0 -44
- package/convex/usage.ts +0 -260
- package/convex/usageReports.ts +0 -357
- package/convex/waitlist.ts +0 -55
- package/convex/webhooks.ts +0 -494
- package/convex/workspaceSettings.ts +0 -143
- package/convex/workspaces.ts +0 -1331
- package/convex.json +0 -3
- package/direct-test.mjs +0 -51
- package/email-templates/filestack-provider-outreach.html +0 -162
- package/email-templates/partnership-template.html +0 -116
- package/email-templates/pratham-draft-preview.txt +0 -57
- package/email-templates/pratham-partnership-draft.html +0 -141
- package/reports/APIClaw-Session-Report-2026-04-05.pdf +0 -0
- package/reports/pipeline/PIPELINE-REPORT.json +0 -153
- package/reports/pipeline/acquire_apisguru.json +0 -17
- package/reports/pipeline/capabilities.json +0 -38
- package/reports/pipeline/discover_azure_recursive.json +0 -1551
- package/reports/pipeline/discover_github.json +0 -25
- package/reports/pipeline/discover_github_repos.json +0 -49
- package/reports/pipeline/discover_swaggerhub.json +0 -24
- package/reports/pipeline/discover_well_known.json +0 -23
- package/reports/pipeline/fetch_specs.json +0 -19
- package/reports/pipeline/generate_providers.json +0 -14
- package/reports/pipeline/match_registry.json +0 -11
- package/reports/pipeline/parse_specs.json +0 -17
- package/reports/pipeline/promote_candidates.json +0 -34
- package/reports/pipeline/validate.json +0 -30
- package/reports/pipeline/validate_smoke_details.json +0 -3835
- package/reports/session-report-2026-04-05.html +0 -433
- package/seed-apis-direct.mjs +0 -106
- package/src/access-control.ts +0 -174
- package/src/adapters/base.ts +0 -364
- package/src/adapters/claude-desktop.ts +0 -41
- package/src/adapters/cline.ts +0 -88
- package/src/adapters/continue.ts +0 -91
- package/src/adapters/cursor.ts +0 -43
- package/src/adapters/custom.ts +0 -188
- package/src/adapters/detect.ts +0 -202
- package/src/adapters/index.ts +0 -47
- package/src/adapters/windsurf.ts +0 -44
- package/src/bin-http.ts +0 -45
- package/src/bin.ts +0 -34
- package/src/capability-router.ts +0 -331
- package/src/chainExecutor.ts +0 -730
- package/src/chainResolver.test.ts +0 -246
- package/src/chainResolver.ts +0 -658
- package/src/cli/commands/demo.ts +0 -109
- package/src/cli/commands/doctor.ts +0 -435
- package/src/cli/commands/index.ts +0 -9
- package/src/cli/commands/login.ts +0 -203
- package/src/cli/commands/mcp-install.ts +0 -373
- package/src/cli/commands/restore.ts +0 -333
- package/src/cli/commands/setup.ts +0 -297
- package/src/cli/commands/uninstall.ts +0 -240
- package/src/cli/index.ts +0 -148
- package/src/cli.ts +0 -370
- package/src/confirmation.ts +0 -296
- package/src/credentials.ts +0 -455
- package/src/credits.ts +0 -329
- package/src/crypto.ts +0 -75
- package/src/discovery.ts +0 -568
- package/src/enterprise/env.ts +0 -156
- package/src/enterprise/index.ts +0 -7
- package/src/enterprise/script-generator.ts +0 -481
- package/src/execute-dynamic.ts +0 -617
- package/src/execute.ts +0 -2386
- package/src/gateway-client.ts +0 -192
- package/src/hivr-whitelist.ts +0 -110
- package/src/http-api.ts +0 -286
- package/src/http-server-minimal.ts +0 -154
- package/src/index.ts +0 -2611
- package/src/intelligent-gateway.ts +0 -339
- package/src/mcp-analytics.ts +0 -156
- package/src/metered.ts +0 -149
- package/src/open-apis-generated.ts +0 -157
- package/src/open-apis.ts +0 -558
- package/src/postinstall.ts +0 -18
- package/src/product-whitelist.ts +0 -246
- package/src/proxy.ts +0 -36
- package/src/session.ts +0 -129
- package/src/stripe.ts +0 -497
- package/src/telemetry.ts +0 -71
- package/src/test.ts +0 -135
- package/src/types/convex-api.d.ts +0 -20
- package/src/types/convex-api.ts +0 -21
- package/src/types.ts +0 -109
- package/src/ui/colors.ts +0 -219
- package/src/ui/errors.ts +0 -394
- package/src/ui/index.ts +0 -17
- package/src/ui/prompts.ts +0 -390
- package/src/ui/spinner.ts +0 -325
- package/src/utils/backup.ts +0 -224
- package/src/utils/config.ts +0 -318
- package/src/utils/os.ts +0 -124
- package/src/utils/paths.ts +0 -203
- package/src/webhook.ts +0 -107
- package/test-10-working.cjs +0 -97
- package/test-14-final.cjs +0 -96
- package/test-actual-handlers.ts +0 -92
- package/test-apilayer-all-14.ts +0 -249
- package/test-apilayer-fixed.ts +0 -248
- package/test-direct-endpoints.ts +0 -174
- package/test-exact-endpoints.ts +0 -144
- package/test-final.ts +0 -83
- package/test-full-routing.ts +0 -100
- package/test-handlers-correct.ts +0 -217
- package/test-numverify-key.ts +0 -41
- package/test-via-handlers.ts +0 -92
- package/test-worldnews.mjs +0 -26
- package/tsconfig.json +0 -20
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Uninstall Command
|
|
3
|
-
* Remove APIClaw configuration from MCP clients
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { existsSync } from 'fs';
|
|
7
|
-
import { getAllClients, getClientConfig, MCPClient, parseClientArg } from '../../utils/paths.js';
|
|
8
|
-
import { readConfig, writeConfig, removeApiclawConfig, hasApiclawConfig } from '../../utils/config.js';
|
|
9
|
-
import { createBackup } from '../../utils/backup.js';
|
|
10
|
-
|
|
11
|
-
export interface UninstallOptions {
|
|
12
|
-
client?: string; // Specific client to uninstall from
|
|
13
|
-
all?: boolean; // Uninstall from all clients
|
|
14
|
-
serverName?: string; // Server name to remove (default: 'apiclaw')
|
|
15
|
-
noBackup?: boolean; // Skip backup creation
|
|
16
|
-
dryRun?: boolean; // Show what would be done
|
|
17
|
-
force?: boolean; // Remove even if not configured
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface UninstallResult {
|
|
21
|
-
success: boolean;
|
|
22
|
-
client: string;
|
|
23
|
-
action: 'removed' | 'skipped' | 'not-found' | 'error';
|
|
24
|
-
message: string;
|
|
25
|
-
backupPath?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Remove APIClaw from a single client
|
|
30
|
-
*/
|
|
31
|
-
export function uninstallFromClient(
|
|
32
|
-
client: MCPClient,
|
|
33
|
-
options: UninstallOptions = {}
|
|
34
|
-
): UninstallResult {
|
|
35
|
-
const config = getClientConfig(client);
|
|
36
|
-
const configPath = config.configPath;
|
|
37
|
-
const serverName = options.serverName || 'apiclaw';
|
|
38
|
-
|
|
39
|
-
// Check if config file exists
|
|
40
|
-
if (!existsSync(configPath)) {
|
|
41
|
-
return {
|
|
42
|
-
success: true,
|
|
43
|
-
client: config.displayName,
|
|
44
|
-
action: 'not-found',
|
|
45
|
-
message: 'Config file not found (client not installed)',
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Read config
|
|
50
|
-
const readResult = readConfig(configPath);
|
|
51
|
-
|
|
52
|
-
if (!readResult.success || !readResult.config) {
|
|
53
|
-
return {
|
|
54
|
-
success: false,
|
|
55
|
-
client: config.displayName,
|
|
56
|
-
action: 'error',
|
|
57
|
-
message: readResult.error || 'Failed to read config',
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Check if APIClaw is configured
|
|
62
|
-
if (!hasApiclawConfig(readResult.config, serverName)) {
|
|
63
|
-
if (options.force) {
|
|
64
|
-
return {
|
|
65
|
-
success: true,
|
|
66
|
-
client: config.displayName,
|
|
67
|
-
action: 'skipped',
|
|
68
|
-
message: `${serverName} not configured (forced check)`,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
success: true,
|
|
74
|
-
client: config.displayName,
|
|
75
|
-
action: 'skipped',
|
|
76
|
-
message: `${serverName} not configured`,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Dry run - just report what would happen
|
|
81
|
-
if (options.dryRun) {
|
|
82
|
-
return {
|
|
83
|
-
success: true,
|
|
84
|
-
client: config.displayName,
|
|
85
|
-
action: 'skipped',
|
|
86
|
-
message: `Would remove ${serverName} (dry run)`,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Create backup before modifying
|
|
91
|
-
let backupPath: string | undefined;
|
|
92
|
-
if (!options.noBackup) {
|
|
93
|
-
const backupResult = createBackup(configPath);
|
|
94
|
-
if (backupResult.success) {
|
|
95
|
-
backupPath = backupResult.backupPath || undefined;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Remove APIClaw from config
|
|
100
|
-
const updatedConfig = removeApiclawConfig(readResult.config, serverName);
|
|
101
|
-
|
|
102
|
-
// Write updated config (without creating another backup)
|
|
103
|
-
const writeResult = writeConfig(configPath, updatedConfig, false);
|
|
104
|
-
|
|
105
|
-
if (!writeResult.success) {
|
|
106
|
-
return {
|
|
107
|
-
success: false,
|
|
108
|
-
client: config.displayName,
|
|
109
|
-
action: 'error',
|
|
110
|
-
message: writeResult.error || 'Failed to write config',
|
|
111
|
-
backupPath,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return {
|
|
116
|
-
success: true,
|
|
117
|
-
client: config.displayName,
|
|
118
|
-
action: 'removed',
|
|
119
|
-
message: `${serverName} removed`,
|
|
120
|
-
backupPath,
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Uninstall from all clients
|
|
126
|
-
*/
|
|
127
|
-
export function uninstallFromAll(options: UninstallOptions = {}): UninstallResult[] {
|
|
128
|
-
const results: UninstallResult[] = [];
|
|
129
|
-
|
|
130
|
-
for (const client of getAllClients()) {
|
|
131
|
-
results.push(uninstallFromClient(client, options));
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return results;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Format uninstall results for display
|
|
139
|
-
*/
|
|
140
|
-
export function formatUninstallResults(results: UninstallResult[]): string {
|
|
141
|
-
const lines: string[] = [];
|
|
142
|
-
|
|
143
|
-
lines.push('');
|
|
144
|
-
lines.push('🗑️ Uninstall Results');
|
|
145
|
-
lines.push('====================');
|
|
146
|
-
lines.push('');
|
|
147
|
-
|
|
148
|
-
const removed = results.filter(r => r.action === 'removed');
|
|
149
|
-
const skipped = results.filter(r => r.action === 'skipped');
|
|
150
|
-
const notFound = results.filter(r => r.action === 'not-found');
|
|
151
|
-
const errors = results.filter(r => r.action === 'error');
|
|
152
|
-
|
|
153
|
-
// Show removed
|
|
154
|
-
if (removed.length > 0) {
|
|
155
|
-
lines.push('Removed:');
|
|
156
|
-
for (const result of removed) {
|
|
157
|
-
lines.push(` ✓ ${result.client}`);
|
|
158
|
-
if (result.backupPath) {
|
|
159
|
-
lines.push(` Backup: ${result.backupPath}`);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
lines.push('');
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// Show skipped
|
|
166
|
-
if (skipped.length > 0) {
|
|
167
|
-
lines.push('Skipped (not configured):');
|
|
168
|
-
for (const result of skipped) {
|
|
169
|
-
lines.push(` ○ ${result.client}`);
|
|
170
|
-
}
|
|
171
|
-
lines.push('');
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// Show not found
|
|
175
|
-
if (notFound.length > 0) {
|
|
176
|
-
lines.push('Not installed:');
|
|
177
|
-
for (const result of notFound) {
|
|
178
|
-
lines.push(` ○ ${result.client}`);
|
|
179
|
-
}
|
|
180
|
-
lines.push('');
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// Show errors
|
|
184
|
-
if (errors.length > 0) {
|
|
185
|
-
lines.push('Errors:');
|
|
186
|
-
for (const result of errors) {
|
|
187
|
-
lines.push(` ✗ ${result.client}: ${result.message}`);
|
|
188
|
-
}
|
|
189
|
-
lines.push('');
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Summary
|
|
193
|
-
if (removed.length > 0) {
|
|
194
|
-
lines.push(`✓ APIClaw removed from ${removed.length} client(s).`);
|
|
195
|
-
lines.push(' Restart your MCP clients for changes to take effect.');
|
|
196
|
-
} else if (errors.length === 0) {
|
|
197
|
-
lines.push('No changes made - APIClaw was not configured in any client.');
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
lines.push('');
|
|
201
|
-
|
|
202
|
-
return lines.join('\n');
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Uninstall command handler
|
|
207
|
-
*/
|
|
208
|
-
export async function uninstallCommand(options: UninstallOptions = {}): Promise<void> {
|
|
209
|
-
const serverName = options.serverName || 'apiclaw';
|
|
210
|
-
|
|
211
|
-
// Dry run notice
|
|
212
|
-
if (options.dryRun) {
|
|
213
|
-
console.log('\n🔍 Dry run - no changes will be made\n');
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
let results: UninstallResult[];
|
|
217
|
-
|
|
218
|
-
// Uninstall from specific client
|
|
219
|
-
if (options.client) {
|
|
220
|
-
const client = parseClientArg(options.client);
|
|
221
|
-
|
|
222
|
-
if (!client) {
|
|
223
|
-
console.error(`\n✗ Unknown client: ${options.client}\n`);
|
|
224
|
-
console.error('Valid clients: claude, cursor, windsurf, cline, continue\n');
|
|
225
|
-
process.exit(1);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
results = [uninstallFromClient(client, options)];
|
|
229
|
-
} else {
|
|
230
|
-
// Uninstall from all clients
|
|
231
|
-
results = uninstallFromAll(options);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
console.log(formatUninstallResults(results));
|
|
235
|
-
|
|
236
|
-
const errors = results.filter(r => r.action === 'error');
|
|
237
|
-
if (errors.length > 0) {
|
|
238
|
-
process.exit(1);
|
|
239
|
-
}
|
|
240
|
-
}
|
package/src/cli/index.ts
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* APIClaw MCP Auto-Setup CLI
|
|
4
|
-
* Enterprise-grade, platform-agnostic configuration tool
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { Command } from 'commander';
|
|
8
|
-
import { writeFileSync } from 'fs';
|
|
9
|
-
import { setupCommand } from './commands/setup.js';
|
|
10
|
-
import { mcpInstallCommand } from './commands/mcp-install.js';
|
|
11
|
-
import { doctorCommand } from './commands/doctor.js';
|
|
12
|
-
import { restoreCommand } from './commands/restore.js';
|
|
13
|
-
import { uninstallCommand } from './commands/uninstall.js';
|
|
14
|
-
import { loginCommand } from './commands/login.js';
|
|
15
|
-
import { demoCommand } from './commands/demo.js';
|
|
16
|
-
import { generateScript } from '../enterprise/script-generator.js';
|
|
17
|
-
import { detectOS, getOSDisplayName } from '../utils/os.js';
|
|
18
|
-
|
|
19
|
-
const VERSION = '1.0.0';
|
|
20
|
-
|
|
21
|
-
const program = new Command();
|
|
22
|
-
|
|
23
|
-
program
|
|
24
|
-
.name('apiclaw')
|
|
25
|
-
.description('APIClaw MCP Auto-Setup - Configure APIClaw across all your AI coding assistants')
|
|
26
|
-
.version(VERSION);
|
|
27
|
-
|
|
28
|
-
// Setup command - main entry point
|
|
29
|
-
program
|
|
30
|
-
.command('setup')
|
|
31
|
-
.description('Configure APIClaw for MCP clients')
|
|
32
|
-
.option('-c, --client <client>', 'Target specific client (claude-desktop, cursor, windsurf, cline, continue)')
|
|
33
|
-
.option('--config <path>', 'Custom config file path')
|
|
34
|
-
.option('-w, --workspace <id>', 'Pre-link APIClaw workspace ID')
|
|
35
|
-
.option('--dry-run', 'Show what would happen without making changes')
|
|
36
|
-
.option('-f, --force', 'Overwrite existing APIClaw configuration')
|
|
37
|
-
.option('--wizard', 'Interactive setup wizard')
|
|
38
|
-
.option('--all', 'Configure all detected clients')
|
|
39
|
-
.option('-v, --verbose', 'Verbose output')
|
|
40
|
-
.option('--enterprise', 'Generate enterprise deployment script')
|
|
41
|
-
.option('--output <file>', 'Output file for enterprise script')
|
|
42
|
-
.option('--script-type <type>', 'Script type: bash or powershell (default: auto)')
|
|
43
|
-
.action(async (options) => {
|
|
44
|
-
// Enterprise script generation mode
|
|
45
|
-
if (options.enterprise) {
|
|
46
|
-
const scriptType = options.scriptType || 'auto';
|
|
47
|
-
const result = generateScript(scriptType, {
|
|
48
|
-
workspace: options.workspace,
|
|
49
|
-
verbose: options.verbose,
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
if (options.output) {
|
|
53
|
-
writeFileSync(options.output, result.script);
|
|
54
|
-
console.log(`\n✓ Enterprise script written to: ${options.output}`);
|
|
55
|
-
console.log(` Type: ${result.platform}`);
|
|
56
|
-
console.log(`\nUsage:`);
|
|
57
|
-
if (result.platform === 'bash') {
|
|
58
|
-
console.log(` chmod +x ${options.output}`);
|
|
59
|
-
console.log(` ./${options.output}`);
|
|
60
|
-
} else {
|
|
61
|
-
console.log(` powershell -ExecutionPolicy Bypass -File ${options.output}`);
|
|
62
|
-
}
|
|
63
|
-
console.log('');
|
|
64
|
-
} else {
|
|
65
|
-
console.log(result.script);
|
|
66
|
-
}
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Normal setup
|
|
71
|
-
await setupCommand(options);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
// MCP Install command - simple focused installation
|
|
75
|
-
program
|
|
76
|
-
.command('mcp-install')
|
|
77
|
-
.description('Install APIClaw into Claude Desktop or Claude Code MCP config')
|
|
78
|
-
.option('-c, --client <client>', 'Target specific client (claude-desktop, claude-code)')
|
|
79
|
-
.option('--dry-run', 'Show what would happen without making changes')
|
|
80
|
-
.action(mcpInstallCommand);
|
|
81
|
-
|
|
82
|
-
// Doctor command - health check
|
|
83
|
-
program
|
|
84
|
-
.command('doctor')
|
|
85
|
-
.description('Diagnose APIClaw setup and connectivity')
|
|
86
|
-
.option('--server-name <name>', 'Server name to check (default: apiclaw)')
|
|
87
|
-
.option('--json', 'Output as JSON')
|
|
88
|
-
.action(doctorCommand);
|
|
89
|
-
|
|
90
|
-
// Restore command - rollback from backup
|
|
91
|
-
program
|
|
92
|
-
.command('restore')
|
|
93
|
-
.description('Restore config from backup')
|
|
94
|
-
.option('-c, --client <client>', 'Target specific client')
|
|
95
|
-
.option('-l, --list', 'List available backups')
|
|
96
|
-
.option('-b, --backup <file>', 'Specific backup file to restore')
|
|
97
|
-
.option('--dry-run', 'Show what would be done without making changes')
|
|
98
|
-
.action(restoreCommand);
|
|
99
|
-
|
|
100
|
-
// Uninstall command - remove APIClaw
|
|
101
|
-
program
|
|
102
|
-
.command('uninstall')
|
|
103
|
-
.description('Remove APIClaw from all configured clients')
|
|
104
|
-
.option('-c, --client <client>', 'Target specific client')
|
|
105
|
-
.option('--all', 'Remove from all clients')
|
|
106
|
-
.option('--server-name <name>', 'Server name to remove (default: apiclaw)')
|
|
107
|
-
.option('--no-backup', 'Skip backup creation')
|
|
108
|
-
.option('--dry-run', 'Show what would be done without making changes')
|
|
109
|
-
.option('-f, --force', 'Remove even if not configured')
|
|
110
|
-
.action(uninstallCommand);
|
|
111
|
-
|
|
112
|
-
// Login / signup command — in-terminal email verification
|
|
113
|
-
program
|
|
114
|
-
.command('login')
|
|
115
|
-
.description('Sign in or create a free APIClaw workspace (no browser needed)')
|
|
116
|
-
.option('-e, --email <email>', 'Email address to use')
|
|
117
|
-
.option('-f, --force', 'Force re-login even if already signed in')
|
|
118
|
-
.option('--no-demo', 'Skip the demo after login')
|
|
119
|
-
.action(async (options) => {
|
|
120
|
-
const result = await loginCommand({ email: options.email, force: options.force });
|
|
121
|
-
if (result && options.demo !== false) {
|
|
122
|
-
await demoCommand();
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
// Demo command — fire a live API call in the terminal
|
|
127
|
-
program
|
|
128
|
-
.command('demo')
|
|
129
|
-
.description('Run a live API call to see APIClaw in action')
|
|
130
|
-
.action(async () => {
|
|
131
|
-
await demoCommand();
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
// MCP Uninstall alias - same as uninstall but for consistency with mcp-install
|
|
135
|
-
program
|
|
136
|
-
.command('mcp-uninstall')
|
|
137
|
-
.description('Remove APIClaw from Claude Desktop or Claude Code MCP config')
|
|
138
|
-
.option('-c, --client <client>', 'Target specific client (claude-desktop, claude-code)')
|
|
139
|
-
.option('--dry-run', 'Show what would be done without making changes')
|
|
140
|
-
.action(uninstallCommand);
|
|
141
|
-
|
|
142
|
-
// Parse and execute
|
|
143
|
-
program.parse();
|
|
144
|
-
|
|
145
|
-
// Show help if no command provided
|
|
146
|
-
if (!process.argv.slice(2).length) {
|
|
147
|
-
program.outputHelp();
|
|
148
|
-
}
|