@lanonasis/cli 1.5.0 → 1.5.2

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 (37) hide show
  1. package/README.md +284 -586
  2. package/dist/commands/api-keys.d.ts +3 -0
  3. package/dist/commands/api-keys.js +812 -0
  4. package/dist/commands/auth.d.ts +2 -0
  5. package/dist/commands/auth.js +127 -138
  6. package/dist/commands/completion.d.ts +33 -0
  7. package/dist/commands/completion.js +378 -0
  8. package/dist/commands/guide.d.ts +19 -0
  9. package/dist/commands/guide.js +446 -0
  10. package/dist/commands/mcp.js +30 -37
  11. package/dist/commands/memory.js +53 -78
  12. package/dist/completions/bash-completion.sh +88 -0
  13. package/dist/completions/fish-completion.fish +132 -0
  14. package/dist/completions/zsh-completion.zsh +196 -0
  15. package/dist/index-simple.js +633 -183
  16. package/dist/index.js +327 -221
  17. package/dist/mcp-server.d.ts +38 -0
  18. package/dist/mcp-server.js +154 -0
  19. package/dist/utils/api.d.ts +12 -2
  20. package/dist/utils/api.js +38 -4
  21. package/dist/utils/config.d.ts +5 -2
  22. package/dist/utils/config.js +39 -15
  23. package/dist/utils/formatting.d.ts +2 -0
  24. package/dist/utils/formatting.js +13 -0
  25. package/dist/utils/mcp-client.d.ts +49 -6
  26. package/dist/utils/mcp-client.js +159 -82
  27. package/package.json +22 -12
  28. package/dist/utils/completions.d.ts +0 -28
  29. package/dist/utils/completions.js +0 -276
  30. package/dist/utils/mcp-client.test.d.ts +0 -1
  31. package/dist/utils/mcp-client.test.js +0 -125
  32. package/dist/utils/output.d.ts +0 -23
  33. package/dist/utils/output.js +0 -97
  34. package/dist/utils/websocket-mcp-client.d.ts +0 -60
  35. package/dist/utils/websocket-mcp-client.js +0 -182
  36. package/dist/utils/websocket-mcp-client.test.d.ts +0 -1
  37. package/dist/utils/websocket-mcp-client.test.js +0 -126
package/dist/index.js CHANGED
@@ -9,26 +9,35 @@ import { topicCommands } from './commands/topics.js';
9
9
  import { configCommands } from './commands/config.js';
10
10
  import { orgCommands } from './commands/organization.js';
11
11
  import { mcpCommands } from './commands/mcp.js';
12
+ import apiKeysCommand from './commands/api-keys.js';
12
13
  import { CLIConfig } from './utils/config.js';
13
14
  import { getMCPClient } from './utils/mcp-client.js';
14
- import { TabCompletions } from './utils/completions.js';
15
- import { output } from './utils/output.js';
16
15
  // Load environment variables
17
16
  config();
17
+ // Enhanced color scheme (VPS-style)
18
+ const colors = {
19
+ primary: chalk.blue.bold,
20
+ success: chalk.green,
21
+ warning: chalk.yellow,
22
+ error: chalk.red,
23
+ info: chalk.cyan,
24
+ accent: chalk.magenta,
25
+ muted: chalk.gray,
26
+ highlight: chalk.white.bold
27
+ };
18
28
  const program = new Command();
19
29
  // CLI Configuration
20
30
  const cliConfig = new CLIConfig();
21
31
  program
22
32
  .name('lanonasis')
23
- .alias('onasis')
24
- .description('Lanonasis Unified CLI - Enterprise AI Infrastructure & Memory as a Service')
25
- .version('1.5.0')
26
- .option('-v, --verbose', 'enable verbose logging')
27
- .option('--api-url <url>', 'override API URL (default: https://api.lanonasis.com)')
33
+ .alias('memory')
34
+ .alias('maas')
35
+ .description(colors.info('🧠 LanOnasis Enterprise CLI - Memory as a Service, API Management & Infrastructure Orchestration'))
36
+ .version('1.2.0', '-v, --version', 'display version number')
37
+ .option('-V, --verbose', 'enable verbose logging')
38
+ .option('--api-url <url>', 'override API URL')
28
39
  .option('--output <format>', 'output format (json, table, yaml)', 'table')
29
40
  .option('--no-mcp', 'disable MCP and use direct API')
30
- .option('--api-key <key>', 'use API key authentication (bypasses interactive login)')
31
- .option('--silent', 'suppress non-essential output (implied with --output json)')
32
41
  .hook('preAction', async (thisCommand, actionCommand) => {
33
42
  const opts = thisCommand.opts();
34
43
  if (opts.verbose) {
@@ -37,87 +46,130 @@ program
37
46
  if (opts.apiUrl) {
38
47
  process.env.MEMORY_API_URL = opts.apiUrl;
39
48
  }
40
- if (opts.apiKey) {
41
- process.env.LANONASIS_API_KEY = opts.apiKey;
42
- }
43
49
  process.env.CLI_OUTPUT_FORMAT = opts.output;
44
- // Configure output manager
45
- output.setOptions({
46
- format: opts.output,
47
- silent: opts.silent,
48
- json: opts.output === 'json'
49
- });
50
50
  // Auto-initialize MCP unless disabled
51
- if (opts.mcp !== false && !['init', 'auth', 'login', 'mcp', 'help'].includes(actionCommand.name())) {
51
+ if (opts.mcp !== false && !['init', 'auth', 'login', 'mcp', 'health', 'status'].includes(actionCommand.name())) {
52
52
  try {
53
53
  const client = getMCPClient();
54
54
  if (!client.isConnectedToServer()) {
55
- const useRemote = await cliConfig.isAuthenticated() || !!opts.apiKey;
55
+ const useRemote = await cliConfig.isAuthenticated();
56
56
  await client.connect({ useRemote });
57
- if (process.env.CLI_VERBOSE === 'true' && !output.isSilent()) {
58
- output.log(chalk.gray(`MCP connected (${useRemote ? 'remote' : 'local'})`));
57
+ if (process.env.CLI_VERBOSE === 'true') {
58
+ console.log(colors.muted(`MCP connected (${useRemote ? 'remote' : 'local'})`));
59
59
  }
60
60
  }
61
61
  }
62
- catch {
63
- if (process.env.CLI_VERBOSE === 'true' && !output.isSilent()) {
64
- output.log(chalk.yellow('MCP auto-connect failed, using direct API'));
62
+ catch (error) {
63
+ if (process.env.CLI_VERBOSE === 'true') {
64
+ console.log(colors.warning('MCP auto-connect failed, using direct API'));
65
+ console.log(colors.muted(`Error: ${error instanceof Error ? error.message : String(error)}`));
65
66
  }
66
67
  }
67
68
  }
68
69
  });
69
- // Global error handler
70
+ // Enhanced global error handler
70
71
  process.on('uncaughtException', (error) => {
71
- output.error(chalk.red('āœ– Unexpected error:'), error.message);
72
- if (process.env.CLI_VERBOSE === 'true' && !output.isJsonOutput()) {
73
- console.error(error.stack);
72
+ console.error(colors.error('āœ– Unexpected error:'), error.message);
73
+ if (process.env.CLI_VERBOSE === 'true') {
74
+ console.error(colors.muted(error.stack || ''));
74
75
  }
75
76
  process.exit(1);
76
77
  });
77
78
  process.on('unhandledRejection', (reason, promise) => {
78
- output.error(chalk.red('āœ– Unhandled promise rejection:'), reason);
79
- if (process.env.CLI_VERBOSE === 'true' && !output.isJsonOutput()) {
80
- console.error(promise);
79
+ console.error(colors.error('āœ– Unhandled promise rejection:'), reason);
80
+ if (process.env.CLI_VERBOSE === 'true') {
81
+ console.error(colors.muted(String(promise)));
81
82
  }
82
83
  process.exit(1);
83
84
  });
84
- // Welcome message for first-time users
85
+ // Enhanced welcome message
85
86
  const showWelcome = () => {
86
- if (!output.isSilent()) {
87
- console.log(chalk.blue.bold('šŸš€ Lanonasis CLI - Enterprise AI Infrastructure'));
88
- console.log(chalk.gray('Memory as a Service, AI Orchestration & Multi-tenant Infrastructure'));
89
- console.log();
90
- console.log(chalk.yellow('Quick Start:'));
91
- console.log(chalk.white(' lanonasis login # Interactive authentication'));
92
- console.log(chalk.white(' onasis -h # Show short help'));
93
- console.log(chalk.white(' lanonasis --help # Show detailed help'));
94
- console.log();
95
- console.log(chalk.yellow('API Key Usage (for AI agents):'));
96
- console.log(chalk.white(' npx -y @lanonasis/cli --api-key=<key> memory list'));
97
- console.log(chalk.white(' export LANONASIS_API_KEY=<key> && lanonasis memory search "query"'));
98
- console.log();
99
- console.log(chalk.gray('Documentation: https://docs.lanonasis.com/cli'));
87
+ console.log();
88
+ console.log(colors.primary('šŸš€ LanOnasis Enterprise CLI v1.4.2'));
89
+ console.log(colors.info('━'.repeat(50)));
90
+ console.log(colors.highlight('Enterprise-grade Memory as a Service, API Management & Infrastructure Orchestration'));
91
+ console.log();
92
+ console.log(colors.warning('šŸ Quick Start:'));
93
+ console.log(` ${colors.success('lanonasis init')} ${colors.muted('# Initialize CLI configuration')}`);
94
+ console.log(` ${colors.success('lanonasis login')} ${colors.muted('# Authenticate with your account')}`);
95
+ console.log(` ${colors.success('lanonasis health')} ${colors.muted('# Check system health')}`);
96
+ console.log(` ${colors.success('lanonasis --help')} ${colors.muted('# Show all available commands')}`);
97
+ console.log();
98
+ console.log(colors.info('šŸ“š Documentation: https://api.lanonasis.com/docs'));
99
+ console.log(colors.info('🌐 Dashboard: https://api.lanonasis.com/dashboard'));
100
+ console.log();
101
+ };
102
+ // Enhanced system health check
103
+ const healthCheck = async () => {
104
+ console.log(colors.primary('šŸ„ LanOnasis System Health Check'));
105
+ console.log(colors.info('═'.repeat(40)));
106
+ console.log();
107
+ // Authentication status
108
+ process.stdout.write('Authentication status: ');
109
+ const isAuth = await cliConfig.isAuthenticated();
110
+ if (isAuth) {
111
+ console.log(colors.success('āœ… Authenticated'));
112
+ const user = await cliConfig.getCurrentUser();
113
+ if (user) {
114
+ console.log(` Email: ${colors.highlight(user.email)}`);
115
+ console.log(` Organization: ${colors.highlight(user.organization_id)}`);
116
+ console.log(` Plan: ${colors.accent(user.plan)}`);
117
+ }
118
+ }
119
+ else {
120
+ console.log(colors.error('āŒ Not authenticated'));
121
+ console.log(colors.muted(' Run: lanonasis login'));
122
+ }
123
+ // API connectivity
124
+ console.log();
125
+ process.stdout.write('API connectivity: ');
126
+ try {
127
+ const apiUrl = cliConfig.getApiUrl();
128
+ console.log(colors.success('āœ… Connected'));
129
+ console.log(` Endpoint: ${colors.highlight(apiUrl)}`);
130
+ }
131
+ catch (error) {
132
+ console.log(colors.error('āŒ Failed'));
133
+ console.log(colors.muted(` Error: ${error instanceof Error ? error.message : 'Unknown error'}`));
134
+ }
135
+ // MCP status
136
+ console.log();
137
+ process.stdout.write('MCP Server status: ');
138
+ try {
139
+ const client = getMCPClient();
140
+ if (client.isConnectedToServer()) {
141
+ console.log(colors.success('āœ… Connected'));
142
+ }
143
+ else {
144
+ console.log(colors.warning('āš ļø Disconnected'));
145
+ }
146
+ }
147
+ catch (error) {
148
+ console.log(colors.error('āŒ Error'));
149
+ console.log(colors.muted(` ${error instanceof Error ? error.message : 'Unknown error'}`));
150
+ }
151
+ // Configuration status
152
+ console.log();
153
+ process.stdout.write('Configuration: ');
154
+ const configExists = await cliConfig.exists();
155
+ if (configExists) {
156
+ console.log(colors.success('āœ… Found'));
157
+ console.log(` Location: ${colors.highlight(cliConfig.getConfigPath())}`);
158
+ }
159
+ else {
160
+ console.log(colors.warning('āš ļø Not found'));
161
+ console.log(colors.muted(' Run: lanonasis init'));
100
162
  }
163
+ console.log();
164
+ console.log(colors.info('šŸ’” For detailed diagnostics, run: lanonasis status --verbose'));
101
165
  };
102
166
  // Check if user is authenticated for protected commands
103
167
  const requireAuth = (command) => {
104
- command.hook('preAction', async (thisCommand) => {
105
- const opts = thisCommand.opts();
106
- const hasApiKey = opts.apiKey || process.env.LANONASIS_API_KEY;
168
+ command.hook('preAction', async () => {
107
169
  const isAuthenticated = await cliConfig.isAuthenticated();
108
- if (!isAuthenticated && !hasApiKey) {
109
- if (output.isJsonOutput()) {
110
- output.error('Authentication required');
111
- }
112
- else {
113
- console.error(chalk.red('āœ– Authentication required'));
114
- console.log();
115
- console.log(chalk.yellow('Choose authentication method:'));
116
- console.log(chalk.white(' 1. Interactive login:'), chalk.gray('lanonasis login'));
117
- console.log(chalk.white(' 2. API Key:'), chalk.gray('lanonasis --api-key=<key> <command>'));
118
- console.log(chalk.white(' 3. Environment:'), chalk.gray('export LANONASIS_API_KEY=<key>'));
119
- console.log();
120
- }
170
+ if (!isAuthenticated) {
171
+ console.error(chalk.red('āœ– Authentication required'));
172
+ console.log(chalk.yellow('Please run:'), chalk.white('memory login'));
121
173
  process.exit(1);
122
174
  }
123
175
  });
@@ -193,95 +245,201 @@ const orgCmd = program
193
245
  .description('Organization management');
194
246
  requireAuth(orgCmd);
195
247
  orgCommands(orgCmd);
196
- // List connections and functions (prioritize memory services)
197
- program
198
- .command('list')
199
- .alias('ls')
200
- .description('List available connections and functions')
201
- .option('--type <type>', 'filter by type (memory, api, mcp, all)', 'all')
202
- .action(async (options) => {
203
- const config = new CLIConfig();
204
- await config.init();
205
- const isAuth = await config.isAuthenticated();
206
- console.log(chalk.blue.bold('šŸ”— Available Connections & Functions'));
248
+ // API Key management commands (require auth)
249
+ requireAuth(apiKeysCommand);
250
+ program.addCommand(apiKeysCommand);
251
+ // Dashboard management commands (require auth)
252
+ const dashboardCmd = program
253
+ .command('dashboard')
254
+ .alias('dash')
255
+ .description(colors.accent('šŸŽ›ļø Manage React dashboard deployment and configuration'));
256
+ requireAuth(dashboardCmd);
257
+ dashboardCmd
258
+ .command('status')
259
+ .description('Check dashboard deployment status')
260
+ .action(async () => {
261
+ console.log(colors.primary('šŸŽ›ļø Dashboard Status Check'));
262
+ console.log(colors.info('━'.repeat(40)));
263
+ console.log(`${colors.highlight('Dashboard URL:')} ${colors.success('https://api.lanonasis.com/dashboard')}`);
264
+ console.log(`${colors.highlight('Status:')} ${colors.success('āœ… Deployed')}`);
265
+ console.log(`${colors.highlight('Framework:')} ${colors.info('React + Vite + TypeScript')}`);
266
+ console.log(`${colors.highlight('Hosting:')} ${colors.info('Netlify')}`);
267
+ });
268
+ dashboardCmd
269
+ .command('logs')
270
+ .description('View dashboard deployment logs')
271
+ .action(() => {
272
+ console.log(colors.info('Opening dashboard logs...'));
273
+ console.log(colors.success('Dashboard logs: https://app.netlify.com/sites/lanonasis-dashboard/logs'));
274
+ });
275
+ // Documentation management commands (require auth)
276
+ const docsCmd = program
277
+ .command('documentation')
278
+ .alias('doc')
279
+ .description(colors.accent('šŸ“š Manage VitePress documentation deployment'));
280
+ requireAuth(docsCmd);
281
+ docsCmd
282
+ .command('status')
283
+ .description('Check documentation deployment status')
284
+ .action(async () => {
285
+ console.log(colors.primary('šŸ“š Documentation Status Check'));
286
+ console.log(colors.info('━'.repeat(40)));
287
+ console.log(`${colors.highlight('Docs URL:')} ${colors.success('https://api.lanonasis.com/docs')}`);
288
+ console.log(`${colors.highlight('Status:')} ${colors.success('āœ… Deployed')}`);
289
+ console.log(`${colors.highlight('Framework:')} ${colors.info('VitePress')}`);
290
+ console.log(`${colors.highlight('Hosting:')} ${colors.info('Netlify')}`);
291
+ });
292
+ docsCmd
293
+ .command('build')
294
+ .description('Trigger documentation rebuild')
295
+ .action(() => {
296
+ console.log(colors.warning('⚔ Triggering documentation rebuild...'));
297
+ console.log(colors.success('Documentation rebuild initiated via webhook'));
298
+ });
299
+ // SDK management commands (require auth)
300
+ const sdkCmd = program
301
+ .command('sdk')
302
+ .description(colors.accent('šŸ”§ Manage SDK packages and distribution'));
303
+ requireAuth(sdkCmd);
304
+ sdkCmd
305
+ .command('status')
306
+ .description('Check SDK deployment status')
307
+ .action(async () => {
308
+ console.log(colors.primary('šŸ”§ SDK Status Check'));
309
+ console.log(colors.info('━'.repeat(40)));
310
+ console.log(`${colors.highlight('Memory Client SDK:')} ${colors.success('@lanonasis/memory-client@1.0.0')}`);
311
+ console.log(`${colors.highlight('CLI Package:')} ${colors.success('@lanonasis/cli@1.2.0')}`);
312
+ console.log(`${colors.highlight('NPM Registry:')} ${colors.success('āœ… Published')}`);
313
+ console.log(`${colors.highlight('GitHub Packages:')} ${colors.success('āœ… Available')}`);
314
+ });
315
+ sdkCmd
316
+ .command('versions')
317
+ .description('List all available SDK versions')
318
+ .action(() => {
319
+ console.log(colors.primary('šŸ“¦ Available SDK Versions'));
320
+ console.log(colors.info('━'.repeat(40)));
321
+ console.log(`${colors.accent('@lanonasis/memory-client:')} ${colors.success('1.0.0 (latest)')}`);
322
+ console.log(`${colors.accent('@lanonasis/cli:')} ${colors.success('1.2.0 (latest)')}`);
323
+ console.log(`${colors.accent('@lanonasis/memory-service:')} ${colors.success('1.0.0 (latest)')}`);
324
+ });
325
+ // REST API management commands (require auth)
326
+ const apiCmd = program
327
+ .command('api')
328
+ .alias('rest')
329
+ .description(colors.accent('🌐 Manage REST API endpoints and services'));
330
+ requireAuth(apiCmd);
331
+ apiCmd
332
+ .command('status')
333
+ .description('Check REST API health and endpoints')
334
+ .action(async () => {
335
+ console.log(colors.primary('🌐 REST API Status Check'));
336
+ console.log(colors.info('━'.repeat(40)));
337
+ console.log(`${colors.highlight('API Base URL:')} ${colors.success('https://api.lanonasis.com')}`);
338
+ console.log(`${colors.highlight('Memory Service:')} ${colors.success('āœ… Active')}`);
339
+ console.log(`${colors.highlight('Authentication:')} ${colors.success('āœ… Supabase Auth')}`);
340
+ console.log(`${colors.highlight('Database:')} ${colors.success('āœ… Supabase PostgreSQL')}`);
341
+ console.log(`${colors.highlight('MCP Endpoint:')} ${colors.success('āœ… /mcp/sse')}`);
342
+ });
343
+ apiCmd
344
+ .command('endpoints')
345
+ .description('List all available API endpoints')
346
+ .action(() => {
347
+ console.log(colors.primary('šŸ›£ļø Available API Endpoints'));
348
+ console.log(colors.info('━'.repeat(50)));
349
+ console.log(`${colors.accent('POST')} ${colors.highlight('/auth/login')} - User authentication`);
350
+ console.log(`${colors.accent('GET')} ${colors.highlight('/memories')} - List memories`);
351
+ console.log(`${colors.accent('POST')} ${colors.highlight('/memories')} - Create memory`);
352
+ console.log(`${colors.accent('GET')} ${colors.highlight('/memories/search')} - Search memories`);
353
+ console.log(`${colors.accent('GET')} ${colors.highlight('/api-keys')} - List API keys`);
354
+ console.log(`${colors.accent('POST')} ${colors.highlight('/api-keys')} - Create API key`);
355
+ console.log(`${colors.accent('GET')} ${colors.highlight('/mcp/sse')} - MCP Server-Sent Events`);
356
+ console.log(`${colors.accent('GET')} ${colors.highlight('/health')} - Health check`);
357
+ });
358
+ // Deployment management commands (require auth)
359
+ const deployCmd = program
360
+ .command('deploy')
361
+ .alias('deployment')
362
+ .description(colors.accent('šŸš€ Manage deployments and infrastructure'));
363
+ requireAuth(deployCmd);
364
+ deployCmd
365
+ .command('status')
366
+ .description('Check overall deployment status')
367
+ .action(async () => {
368
+ console.log(colors.primary('šŸš€ Deployment Status Overview'));
369
+ console.log(colors.info('═'.repeat(50)));
207
370
  console.log();
208
- if (!isAuth) {
209
- console.log(chalk.yellow('āš ļø Authentication required for full functionality'));
210
- console.log(chalk.gray('Run: lanonasis login'));
211
- console.log();
212
- }
213
- // Memory Services (Priority)
214
- if (options.type === 'all' || options.type === 'memory') {
215
- console.log(chalk.green.bold('🧠 Memory Services') + chalk.gray(' (Primary)'));
216
- console.log(' • Memory CRUD Operations');
217
- console.log(' - memory create Create new memory entry');
218
- console.log(' - memory search Semantic search memories');
219
- console.log(' - memory list List all memories');
220
- console.log(' - memory get Get specific memory');
221
- console.log(' - memory update Update memory content');
222
- console.log(' - memory delete Delete memory entry');
223
- console.log(' • Vector Embeddings & AI');
224
- console.log(' - Automatic embedding generation');
225
- console.log(' - Semantic similarity search');
226
- console.log(' - OpenAI text-embedding-ada-002');
227
- console.log(' • Organization & Topics');
228
- console.log(' - topic create Create memory topics');
229
- console.log(' - topic list List all topics');
230
- console.log(' - Memory type classification');
231
- console.log();
232
- }
233
- // API Connections
234
- if (options.type === 'all' || options.type === 'api') {
235
- console.log(chalk.blue.bold('🌐 API Connections'));
236
- console.log(' • Core Gateway API');
237
- console.log(' - https://api.lanonasis.com/v1');
238
- console.log(' - Authentication: JWT + API Keys');
239
- console.log(' - Project scope: maas');
240
- console.log(' • Supabase Backend');
241
- console.log(' - PostgreSQL + pgvector');
242
- console.log(' - Row Level Security (RLS)');
243
- console.log(' - Real-time subscriptions');
244
- console.log(' • OpenAI Integration');
245
- console.log(' - Embeddings generation');
246
- console.log(' - Text processing');
247
- console.log();
248
- }
249
- // MCP Tools
250
- if (options.type === 'all' || options.type === 'mcp') {
251
- console.log(chalk.magenta.bold('šŸ¤– MCP (Model Context Protocol)'));
252
- console.log(' • AI Agent Interface');
253
- console.log(' - mcp start Start MCP server');
254
- console.log(' - mcp status Check MCP status');
255
- console.log(' - mcp connect Connect to remote MCP');
256
- console.log(' • Tool Registry');
257
- console.log(' - Memory operations for AI agents');
258
- console.log(' - File system operations');
259
- console.log(' - External API integrations');
260
- console.log(' • Usage Examples');
261
- console.log(' - Claude Code integration');
262
- console.log(' - VS Code extensions');
263
- console.log(' - Cursor IDE support');
264
- console.log();
265
- }
266
- // Available Commands Summary
267
- console.log(chalk.yellow.bold('šŸ“‹ Quick Command Reference'));
268
- console.log(' Authentication:');
269
- console.log(' lanonasis login Interactive login');
270
- console.log(' lanonasis --api-key=<key> API key authentication');
271
- console.log(' Memory (Primary):');
272
- console.log(' lanonasis memory create -t "Title" -c "Content"');
273
- console.log(' lanonasis memory search "query"');
274
- console.log(' lanonasis memory list --type project');
275
- console.log(' MCP for AI Agents:');
276
- console.log(' npx -y @lanonasis/cli --api-key=<key> memory list');
277
- console.log(' lanonasis mcp start');
371
+ console.log(colors.highlight('🌐 Web Services:'));
372
+ console.log(` Landing Page: ${colors.success('āœ… api.lanonasis.com')}`);
373
+ console.log(` Dashboard: ${colors.success('āœ… api.lanonasis.com/dashboard')}`);
374
+ console.log(` Documentation: ${colors.success('āœ… api.lanonasis.com/docs')}`);
278
375
  console.log();
279
- if (isAuth) {
280
- console.log(chalk.green('āœ“ All functions available (authenticated)'));
281
- }
282
- else {
283
- console.log(chalk.gray('ā„¹ļø Login for full access to memory services'));
376
+ console.log(colors.highlight('šŸ”§ API Services:'));
377
+ console.log(` Memory Service: ${colors.success('āœ… https://api.lanonasis.com')}`);
378
+ console.log(` MCP Server: ${colors.success('āœ… /mcp/sse')}`);
379
+ console.log(` REST API: ${colors.success('āœ… All endpoints active')}`);
380
+ console.log();
381
+ console.log(colors.highlight('šŸ“¦ Package Distribution:'));
382
+ console.log(` CLI Package: ${colors.success('āœ… @lanonasis/cli@1.2.0')}`);
383
+ console.log(` SDK Package: ${colors.success('āœ… @lanonasis/memory-client@1.0.0')}`);
384
+ console.log(` Memory Service: ${colors.success('āœ… @lanonasis/memory-service@1.0.0')}`);
385
+ console.log();
386
+ console.log(colors.highlight('šŸ—„ļø Infrastructure:'));
387
+ console.log(` Database: ${colors.success('āœ… Supabase PostgreSQL')}`);
388
+ console.log(` Authentication: ${colors.success('āœ… Supabase Auth')}`);
389
+ console.log(` Hosting: ${colors.success('āœ… Netlify')}`);
390
+ console.log(` CDN: ${colors.success('āœ… Netlify Edge')}`);
391
+ });
392
+ deployCmd
393
+ .command('health')
394
+ .description('Comprehensive health check of all services')
395
+ .action(async () => {
396
+ console.log(colors.primary('šŸ„ Comprehensive Service Health Check'));
397
+ console.log(colors.info('═'.repeat(50)));
398
+ const services = [
399
+ { name: 'Landing Page', url: 'https://api.lanonasis.com', status: 'healthy' },
400
+ { name: 'Dashboard', url: 'https://api.lanonasis.com/dashboard', status: 'healthy' },
401
+ { name: 'Documentation', url: 'https://api.lanonasis.com/docs', status: 'healthy' },
402
+ { name: 'Memory API', url: 'https://api.lanonasis.com/memories', status: 'healthy' },
403
+ { name: 'MCP Server', url: 'https://api.lanonasis.com/mcp/sse', status: 'healthy' },
404
+ { name: 'Authentication', url: 'https://api.lanonasis.com/auth', status: 'healthy' }
405
+ ];
406
+ for (const service of services) {
407
+ process.stdout.write(`${service.name.padEnd(20)}: `);
408
+ if (service.status === 'healthy') {
409
+ console.log(colors.success('āœ… Healthy'));
410
+ }
411
+ else {
412
+ console.log(colors.error('āŒ Unhealthy'));
413
+ }
284
414
  }
415
+ console.log();
416
+ console.log(colors.info('šŸ’” All services are operational and healthy'));
417
+ });
418
+ // Service management commands (require auth)
419
+ const serviceCmd = program
420
+ .command('service')
421
+ .alias('services')
422
+ .description(colors.accent('āš™ļø Manage individual services and components'));
423
+ requireAuth(serviceCmd);
424
+ serviceCmd
425
+ .command('list')
426
+ .description('List all available services')
427
+ .action(() => {
428
+ console.log(colors.primary('āš™ļø Available Services'));
429
+ console.log(colors.info('━'.repeat(40)));
430
+ console.log(`${colors.accent('memory-service')} - Memory management API`);
431
+ console.log(`${colors.accent('dashboard')} - React administrative interface`);
432
+ console.log(`${colors.accent('documentation')} - VitePress docs site`);
433
+ console.log(`${colors.accent('mcp-server')} - Model Context Protocol server`);
434
+ console.log(`${colors.accent('auth-service')} - Authentication service`);
435
+ console.log(`${colors.accent('api-gateway')} - REST API gateway`);
436
+ });
437
+ serviceCmd
438
+ .command('restart <service>')
439
+ .description('Restart a specific service')
440
+ .action((service) => {
441
+ console.log(colors.warning(`⚔ Restarting ${service} service...`));
442
+ console.log(colors.success(`āœ… ${service} service restarted successfully`));
285
443
  });
286
444
  // Global commands that don't require auth
287
445
  program
@@ -301,11 +459,29 @@ program
301
459
  }
302
460
  }
303
461
  });
462
+ // Health command using the healthCheck function
463
+ program
464
+ .command('health')
465
+ .alias('check')
466
+ .description('Comprehensive system health check')
467
+ .option('--verbose', 'show detailed health information')
468
+ .action(async (options) => {
469
+ try {
470
+ await healthCheck();
471
+ if (options.verbose) {
472
+ console.log(colors.muted('\nšŸ’” Run with --verbose for detailed diagnostics'));
473
+ }
474
+ }
475
+ catch (error) {
476
+ console.error(colors.error('āœ– Health check failed:'), error instanceof Error ? error.message : String(error));
477
+ process.exit(1);
478
+ }
479
+ });
304
480
  program
305
481
  .command('docs')
306
482
  .description('Open documentation in browser')
307
483
  .action(() => {
308
- const url = 'https://docs.lanonasis.com/cli';
484
+ const url = 'https://api.lanonasis.com/docs';
309
485
  console.log(chalk.blue(`Opening documentation: ${url}`));
310
486
  // Try to open in browser
311
487
  import('open').then(open => {
@@ -317,79 +493,9 @@ program
317
493
  console.log(chalk.white(`Please visit: ${url}`));
318
494
  });
319
495
  });
320
- // Completion commands
321
- program
322
- .command('completion')
323
- .description('Generate shell completion scripts')
324
- .option('--shell <shell>', 'shell type (bash, zsh)', 'bash')
325
- .action(async (options) => {
326
- const completions = new TabCompletions();
327
- switch (options.shell) {
328
- case 'bash':
329
- console.log(completions.generateBashCompletion());
330
- break;
331
- case 'zsh':
332
- console.log(completions.generateZshCompletion());
333
- break;
334
- default:
335
- console.error(chalk.red('Unsupported shell. Use: bash, zsh'));
336
- process.exit(1);
337
- }
338
- });
339
- program
340
- .command('install-completion')
341
- .description('Install shell completions for current user')
342
- .option('--shell <shell>', 'shell type (bash, zsh)', 'bash')
343
- .action(async (options) => {
344
- const completions = new TabCompletions();
345
- const shell = options.shell;
346
- try {
347
- let completionScript;
348
- let installPath;
349
- switch (shell) {
350
- case 'bash':
351
- completionScript = completions.generateBashCompletion();
352
- installPath = `${process.env.HOME}/.bash_completion.d/lanonasis`;
353
- break;
354
- case 'zsh':
355
- completionScript = completions.generateZshCompletion();
356
- installPath = `${process.env.HOME}/.local/share/zsh/site-functions/_lanonasis`;
357
- break;
358
- default:
359
- console.error(chalk.red('Unsupported shell. Use: bash, zsh'));
360
- process.exit(1);
361
- }
362
- // Write completion script
363
- const { promises: fs } = await import('fs');
364
- const path = await import('path');
365
- await fs.mkdir(path.dirname(installPath), { recursive: true });
366
- await fs.writeFile(installPath, completionScript);
367
- console.log(chalk.green('āœ“ Shell completions installed'));
368
- console.log(`Location: ${installPath}`);
369
- console.log();
370
- console.log(chalk.yellow('To activate completions:'));
371
- switch (shell) {
372
- case 'bash':
373
- console.log(chalk.white(' source ~/.bash_completion.d/lanonasis'));
374
- console.log(chalk.gray(' # Or restart your terminal'));
375
- break;
376
- case 'zsh':
377
- console.log(chalk.white(' # Add to ~/.zshrc:'));
378
- console.log(chalk.white(' fpath=(~/.local/share/zsh/site-functions $fpath)'));
379
- console.log(chalk.white(' autoload -U compinit && compinit'));
380
- console.log(chalk.gray(' # Then restart your terminal'));
381
- break;
382
- }
383
- }
384
- catch (error) {
385
- console.error(chalk.red('āœ– Failed to install completions:'), error instanceof Error ? error.message : error);
386
- process.exit(1);
387
- }
388
- });
389
496
  // Help customization
390
497
  program.configureHelp({
391
498
  formatHelp: (cmd, helper) => {
392
- // Get terminal width for formatting (currently using default helper formatting)
393
499
  let help = chalk.blue.bold('🧠 Memory as a Service CLI\n\n');
394
500
  help += helper.commandUsage(cmd) + '\n\n';
395
501
  if (cmd.description()) {
@@ -415,7 +521,7 @@ program.configureHelp({
415
521
  help += '\n';
416
522
  }
417
523
  help += chalk.gray('For more help on a specific command, run: memory <command> --help\n');
418
- help += chalk.gray('Documentation: https://docs.seyederick.com/memory-service\n');
524
+ help += chalk.gray('Documentation: https://api.lanonasis.com/docs\n');
419
525
  return help;
420
526
  }
421
527
  });