@lanonasis/cli 1.1.0 ā 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -23
- package/dist/commands/memory.js +20 -17
- package/dist/commands/topics.js +2 -2
- package/dist/index-simple.js +0 -0
- package/dist/index.js +2 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
# Lanonasis CLI - Enterprise Infrastructure Management
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@lanonasis/cli)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://modelcontextprotocol.com)
|
|
6
|
+
|
|
3
7
|
š **Professional CLI for Lanonasis Platform Services with MCP Integration**
|
|
4
8
|
|
|
5
9
|
The Lanonasis CLI provides a powerful command-line interface for interacting with the entire Lanonasis ecosystem, including Memory as a Service (MaaS), infrastructure management, and multi-service orchestration. Now with **Model Context Protocol (MCP)** integration for unified AI-agent communication. Manage your memories, search through knowledge bases, organize your thoughts, and control your infrastructure - all from the terminal.
|
|
6
10
|
|
|
7
11
|
## š New in v1.1.0
|
|
8
|
-
- **MCP
|
|
9
|
-
- **Hybrid
|
|
12
|
+
- **MCP Server Mode**: Run as MCP server for AI assistants (Claude, Cursor, Windsurf)
|
|
13
|
+
- **Hybrid Architecture**: Seamless switching between local MCP and remote API
|
|
10
14
|
- **Real-time Updates**: SSE streaming for live memory synchronization
|
|
15
|
+
- **Tool Discovery**: Dynamic MCP tool listing for AI agents
|
|
11
16
|
- **Unified Interface**: Same commands work with local or cloud backends
|
|
17
|
+
- **Auto-detection**: Intelligently chooses best connection mode
|
|
12
18
|
|
|
13
19
|
## ā” Quick Start
|
|
14
20
|
|
|
@@ -145,35 +151,90 @@ maas list --type knowledge # MaaS command
|
|
|
145
151
|
|
|
146
152
|
The CLI now includes full MCP support for AI agent integration:
|
|
147
153
|
|
|
154
|
+
### Start MCP Server Mode
|
|
155
|
+
|
|
148
156
|
```bash
|
|
149
|
-
#
|
|
150
|
-
lanonasis mcp
|
|
151
|
-
lanonasis mcp
|
|
152
|
-
lanonasis mcp
|
|
157
|
+
# Start as MCP server for AI assistants
|
|
158
|
+
lanonasis mcp start # Default port 3002
|
|
159
|
+
lanonasis mcp start --port 8080 # Custom port
|
|
160
|
+
lanonasis mcp start --mode server # Explicit server mode
|
|
153
161
|
|
|
154
|
-
#
|
|
155
|
-
lanonasis mcp
|
|
162
|
+
# Or use npx without installation
|
|
163
|
+
npx -y @lanonasis/cli mcp start
|
|
164
|
+
```
|
|
156
165
|
|
|
157
|
-
|
|
158
|
-
|
|
166
|
+
### Configure AI Assistants
|
|
167
|
+
|
|
168
|
+
**Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"mcpServers": {
|
|
172
|
+
"memory-service": {
|
|
173
|
+
"command": "npx",
|
|
174
|
+
"args": ["-y", "@lanonasis/cli", "mcp", "start"],
|
|
175
|
+
"env": {
|
|
176
|
+
"LANONASIS_API_KEY": "your-api-key-here"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
```
|
|
159
182
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
183
|
+
**Cursor/Windsurf** (Settings):
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"mcp.servers": {
|
|
187
|
+
"memory-service": {
|
|
188
|
+
"command": "lanonasis",
|
|
189
|
+
"args": ["mcp", "start"],
|
|
190
|
+
"env": {
|
|
191
|
+
"LANONASIS_API_KEY": "your-api-key-here"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
```
|
|
163
197
|
|
|
164
|
-
|
|
165
|
-
lanonasis memory-mcp stream
|
|
198
|
+
### MCP Commands
|
|
166
199
|
|
|
167
|
-
|
|
168
|
-
|
|
200
|
+
```bash
|
|
201
|
+
# Server operations
|
|
202
|
+
lanonasis mcp start # Start MCP server
|
|
203
|
+
lanonasis mcp stop # Stop MCP server
|
|
204
|
+
lanonasis mcp status # Check server status
|
|
205
|
+
lanonasis mcp logs # View server logs
|
|
206
|
+
|
|
207
|
+
# Tool discovery
|
|
208
|
+
lanonasis mcp tools # List all available MCP tools
|
|
209
|
+
lanonasis mcp tools --json # Output as JSON
|
|
210
|
+
|
|
211
|
+
# Test connectivity
|
|
212
|
+
lanonasis mcp test # Test MCP connection
|
|
213
|
+
lanonasis mcp test --tool <name> # Test specific tool
|
|
169
214
|
```
|
|
170
215
|
|
|
216
|
+
### Available MCP Tools
|
|
217
|
+
|
|
218
|
+
- `memory_create_memory` - Create new memories with embeddings
|
|
219
|
+
- `memory_search_memories` - Semantic search across memories
|
|
220
|
+
- `memory_list_memories` - List and filter memories
|
|
221
|
+
- `memory_get_memory` - Retrieve specific memory
|
|
222
|
+
- `memory_update_memory` - Update existing memories
|
|
223
|
+
- `memory_delete_memory` - Delete memories
|
|
224
|
+
- `memory_bulk_create` - Batch create multiple memories
|
|
225
|
+
- `memory_bulk_delete` - Batch delete memories
|
|
226
|
+
- `memory_get_stats` - Get memory statistics
|
|
227
|
+
- `memory_export_data` - Export memories (JSON/CSV/YAML)
|
|
228
|
+
- `memory_import_data` - Import memories from files
|
|
229
|
+
|
|
171
230
|
### MCP Features:
|
|
172
|
-
-
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
-
|
|
231
|
+
- **š WebSocket Server**: Real-time bidirectional communication
|
|
232
|
+
- **š Hybrid Mode**: Automatic fallback between local/remote
|
|
233
|
+
- **š Secure Auth**: API key and JWT token support
|
|
234
|
+
- **š Real-time SSE**: Live updates in remote mode
|
|
235
|
+
- **š ļø Tool Discovery**: Dynamic tool listing for AI agents
|
|
236
|
+
- **šÆ Auto-detection**: Intelligently chooses best mode
|
|
237
|
+
- **š Full Memory API**: All operations exposed as MCP tools
|
|
177
238
|
|
|
178
239
|
## š MaaS Service Integration
|
|
179
240
|
|
|
@@ -284,6 +345,33 @@ MIT License - see LICENSE file for details
|
|
|
284
345
|
- **Research Organization** - Academic and research note-taking
|
|
285
346
|
- **API Integration** - Programmatic memory management
|
|
286
347
|
|
|
348
|
+
## š Production Ready Features
|
|
349
|
+
|
|
350
|
+
### Enterprise Capabilities
|
|
351
|
+
- **š Secure Authentication** - API key and JWT token support
|
|
352
|
+
- **š Multi-tenant Support** - Isolated memory spaces per user/org
|
|
353
|
+
- **š Rate Limiting** - Built-in request throttling
|
|
354
|
+
- **š Retry Logic** - Automatic retry with exponential backoff
|
|
355
|
+
- **š Comprehensive Logging** - Debug and audit trails
|
|
356
|
+
- **š Performance Optimized** - Minimal overhead, fast responses
|
|
357
|
+
|
|
358
|
+
### Commercial Use Cases
|
|
359
|
+
- **š¼ Enterprise Knowledge Management** - Company-wide memory system
|
|
360
|
+
- **š¤ Team Collaboration** - Shared project memories
|
|
361
|
+
- **š Educational Platforms** - Student/teacher memory sharing
|
|
362
|
+
- **š„ Healthcare Systems** - Patient context management
|
|
363
|
+
- **š° Financial Services** - Transaction memory and audit trails
|
|
364
|
+
- **š E-commerce** - Customer interaction history
|
|
365
|
+
|
|
366
|
+
### Integration Ready
|
|
367
|
+
- **REST API** - Standard HTTP/JSON interface
|
|
368
|
+
- **MCP Protocol** - AI assistant integration
|
|
369
|
+
- **WebSocket** - Real-time updates
|
|
370
|
+
- **SSE Streaming** - Live data synchronization
|
|
371
|
+
- **SDK Available** - TypeScript/JavaScript client library
|
|
372
|
+
|
|
287
373
|
---
|
|
288
374
|
|
|
289
|
-
**Built with ā¤ļø for the Memory as a Service ecosystem**
|
|
375
|
+
**Built with ā¤ļø for the Memory as a Service ecosystem**
|
|
376
|
+
|
|
377
|
+
š **Ready for Production** | š [Documentation](https://docs.lanonasis.com) | š [Platform](https://api.lanonasis.com)
|
package/dist/commands/memory.js
CHANGED
|
@@ -6,6 +6,7 @@ import wrap from 'word-wrap';
|
|
|
6
6
|
import { format } from 'date-fns';
|
|
7
7
|
import { apiClient } from '../utils/api.js';
|
|
8
8
|
import { formatBytes, truncateText } from '../utils/formatting.js';
|
|
9
|
+
// Using GetMemoriesParams from api.ts
|
|
9
10
|
export function memoryCommands(program) {
|
|
10
11
|
// Create memory
|
|
11
12
|
program
|
|
@@ -101,25 +102,26 @@ export function memoryCommands(program) {
|
|
|
101
102
|
try {
|
|
102
103
|
const spinner = ora('Fetching memories...').start();
|
|
103
104
|
const params = {
|
|
104
|
-
|
|
105
|
+
offset: (parseInt(options.page || '1') - 1) * parseInt(options.limit || '20'),
|
|
105
106
|
limit: parseInt(options.limit || '20'),
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
sort_by: (options.sort || 'created_at'),
|
|
108
|
+
sort_order: (options.order || 'desc')
|
|
108
109
|
};
|
|
109
110
|
if (options.type)
|
|
110
111
|
params.memory_type = options.type;
|
|
111
112
|
if (options.tags)
|
|
112
|
-
params.tags = options.tags;
|
|
113
|
-
|
|
114
|
-
params.user_id = options.userId;
|
|
113
|
+
params.tags = options.tags.split(',').map(t => t.trim());
|
|
114
|
+
// Note: user_id filtering removed as it's handled by authentication
|
|
115
115
|
const result = await apiClient.getMemories(params);
|
|
116
116
|
spinner.stop();
|
|
117
|
-
if (result.
|
|
117
|
+
if (result.data.length === 0) {
|
|
118
118
|
console.log(chalk.yellow('No memories found'));
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
121
|
console.log(chalk.blue.bold(`\nš Memories (${result.pagination.total} total)`));
|
|
122
|
-
|
|
122
|
+
const currentPage = Math.floor(result.pagination.offset / result.pagination.limit) + 1;
|
|
123
|
+
const totalPages = Math.ceil(result.pagination.total / result.pagination.limit);
|
|
124
|
+
console.log(chalk.gray(`Page ${currentPage} of ${totalPages}`));
|
|
123
125
|
console.log();
|
|
124
126
|
const outputFormat = process.env.CLI_OUTPUT_FORMAT || 'table';
|
|
125
127
|
if (outputFormat === 'json') {
|
|
@@ -127,7 +129,7 @@ export function memoryCommands(program) {
|
|
|
127
129
|
}
|
|
128
130
|
else {
|
|
129
131
|
// Table format
|
|
130
|
-
const tableData = result.
|
|
132
|
+
const tableData = result.data.map((memory) => [
|
|
131
133
|
truncateText(memory.title, 30),
|
|
132
134
|
memory.memory_type,
|
|
133
135
|
memory.tags.slice(0, 3).join(', '),
|
|
@@ -135,7 +137,6 @@ export function memoryCommands(program) {
|
|
|
135
137
|
memory.access_count
|
|
136
138
|
]);
|
|
137
139
|
const tableConfig = {
|
|
138
|
-
header: ['Title', 'Type', 'Tags', 'Created', 'Access'],
|
|
139
140
|
columnDefault: {
|
|
140
141
|
width: 20,
|
|
141
142
|
wrapWord: true
|
|
@@ -148,10 +149,12 @@ export function memoryCommands(program) {
|
|
|
148
149
|
{ width: 8 }
|
|
149
150
|
]
|
|
150
151
|
};
|
|
151
|
-
|
|
152
|
+
const tableHeaders = ['Title', 'Type', 'Tags', 'Created', 'Access'];
|
|
153
|
+
console.log(table([tableHeaders, ...tableData], tableConfig));
|
|
152
154
|
// Pagination info
|
|
153
|
-
if (result.pagination.
|
|
154
|
-
|
|
155
|
+
if (result.pagination.has_more) {
|
|
156
|
+
const nextPage = currentPage + 1;
|
|
157
|
+
console.log(chalk.gray(`\nUse --page ${nextPage} for next page`));
|
|
155
158
|
}
|
|
156
159
|
}
|
|
157
160
|
}
|
|
@@ -185,14 +188,14 @@ export function memoryCommands(program) {
|
|
|
185
188
|
}
|
|
186
189
|
const result = await apiClient.searchMemories(query, searchOptions);
|
|
187
190
|
spinner.stop();
|
|
188
|
-
if (result.
|
|
191
|
+
if (result.data.length === 0) {
|
|
189
192
|
console.log(chalk.yellow('No memories found matching your search'));
|
|
190
193
|
return;
|
|
191
194
|
}
|
|
192
|
-
console.log(chalk.blue.bold(`\nš Search Results (${result.
|
|
193
|
-
console.log(chalk.gray(`Query: "${query}"
|
|
195
|
+
console.log(chalk.blue.bold(`\nš Search Results (${result.pagination.total} found)`));
|
|
196
|
+
console.log(chalk.gray(`Query: "${query}"`));
|
|
194
197
|
console.log();
|
|
195
|
-
result.
|
|
198
|
+
result.data.forEach((memory, index) => {
|
|
196
199
|
const score = (memory.relevance_score * 100).toFixed(1);
|
|
197
200
|
console.log(chalk.green(`${index + 1}. ${memory.title}`) + chalk.gray(` (${score}% match)`));
|
|
198
201
|
console.log(chalk.white(` ${truncateText(memory.content, 100)}`));
|
package/dist/commands/topics.js
CHANGED
|
@@ -117,7 +117,6 @@ export function topicCommands(program) {
|
|
|
117
117
|
topic.parent_topic_id ? 'ā' : ''
|
|
118
118
|
]);
|
|
119
119
|
const tableConfig = {
|
|
120
|
-
header: ['Name', 'Description', 'Color', 'Created', 'Child'],
|
|
121
120
|
columnDefault: {
|
|
122
121
|
width: 20,
|
|
123
122
|
wrapWord: true
|
|
@@ -130,7 +129,8 @@ export function topicCommands(program) {
|
|
|
130
129
|
{ width: 8 }
|
|
131
130
|
]
|
|
132
131
|
};
|
|
133
|
-
|
|
132
|
+
const tableHeaders = ['Name', 'Description', 'System', 'Created'];
|
|
133
|
+
console.log(table([tableHeaders, ...tableData], tableConfig));
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
catch (error) {
|
package/dist/index-simple.js
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@ program
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
catch
|
|
49
|
+
catch {
|
|
50
50
|
if (process.env.CLI_VERBOSE === 'true') {
|
|
51
51
|
console.log(chalk.yellow('MCP auto-connect failed, using direct API'));
|
|
52
52
|
}
|
|
@@ -198,8 +198,7 @@ program
|
|
|
198
198
|
// Help customization
|
|
199
199
|
program.configureHelp({
|
|
200
200
|
formatHelp: (cmd, helper) => {
|
|
201
|
-
|
|
202
|
-
const helpWidth = Math.min(term - 2, 80);
|
|
201
|
+
// Get terminal width for formatting (currently using default helper formatting)
|
|
203
202
|
let help = chalk.blue.bold('š§ Memory as a Service CLI\n\n');
|
|
204
203
|
help += helper.commandUsage(cmd) + '\n\n';
|
|
205
204
|
if (cmd.description()) {
|