@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.
- package/README.md +284 -586
- package/dist/commands/api-keys.d.ts +3 -0
- package/dist/commands/api-keys.js +812 -0
- package/dist/commands/auth.d.ts +2 -0
- package/dist/commands/auth.js +127 -138
- package/dist/commands/completion.d.ts +33 -0
- package/dist/commands/completion.js +378 -0
- package/dist/commands/guide.d.ts +19 -0
- package/dist/commands/guide.js +446 -0
- package/dist/commands/mcp.js +30 -37
- package/dist/commands/memory.js +53 -78
- package/dist/completions/bash-completion.sh +88 -0
- package/dist/completions/fish-completion.fish +132 -0
- package/dist/completions/zsh-completion.zsh +196 -0
- package/dist/index-simple.js +633 -183
- package/dist/index.js +327 -221
- package/dist/mcp-server.d.ts +38 -0
- package/dist/mcp-server.js +154 -0
- package/dist/utils/api.d.ts +12 -2
- package/dist/utils/api.js +38 -4
- package/dist/utils/config.d.ts +5 -2
- package/dist/utils/config.js +39 -15
- package/dist/utils/formatting.d.ts +2 -0
- package/dist/utils/formatting.js +13 -0
- package/dist/utils/mcp-client.d.ts +49 -6
- package/dist/utils/mcp-client.js +159 -82
- package/package.json +22 -12
- package/dist/utils/completions.d.ts +0 -28
- package/dist/utils/completions.js +0 -276
- package/dist/utils/mcp-client.test.d.ts +0 -1
- package/dist/utils/mcp-client.test.js +0 -125
- package/dist/utils/output.d.ts +0 -23
- package/dist/utils/output.js +0 -97
- package/dist/utils/websocket-mcp-client.d.ts +0 -60
- package/dist/utils/websocket-mcp-client.js +0 -182
- package/dist/utils/websocket-mcp-client.test.d.ts +0 -1
- package/dist/utils/websocket-mcp-client.test.js +0 -126
package/dist/commands/memory.js
CHANGED
|
@@ -6,8 +6,6 @@ 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
|
-
import { output } from '../utils/output.js';
|
|
10
|
-
// Using GetMemoriesParams from api.ts
|
|
11
9
|
export function memoryCommands(program) {
|
|
12
10
|
// Create memory
|
|
13
11
|
program
|
|
@@ -23,11 +21,7 @@ export function memoryCommands(program) {
|
|
|
23
21
|
.action(async (options) => {
|
|
24
22
|
try {
|
|
25
23
|
let { title, content, type, tags, topicId, interactive } = options;
|
|
26
|
-
|
|
27
|
-
if (output.isSilent() && (!title || !content)) {
|
|
28
|
-
throw new Error('Title and content are required when using --output json or --silent');
|
|
29
|
-
}
|
|
30
|
-
if ((interactive || (!title || !content)) && !output.isSilent()) {
|
|
24
|
+
if (interactive || (!title || !content)) {
|
|
31
25
|
const answers = await inquirer.prompt([
|
|
32
26
|
{
|
|
33
27
|
type: 'input',
|
|
@@ -62,7 +56,7 @@ export function memoryCommands(program) {
|
|
|
62
56
|
type = answers.type;
|
|
63
57
|
tags = answers.tags;
|
|
64
58
|
}
|
|
65
|
-
const spinner =
|
|
59
|
+
const spinner = ora('Creating memory...').start();
|
|
66
60
|
const memoryData = {
|
|
67
61
|
title,
|
|
68
62
|
content,
|
|
@@ -75,25 +69,19 @@ export function memoryCommands(program) {
|
|
|
75
69
|
memoryData.topic_id = topicId;
|
|
76
70
|
}
|
|
77
71
|
const memory = await apiClient.createMemory(memoryData);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
console.log(
|
|
86
|
-
console.log(` ID: ${chalk.cyan(memory.id)}`);
|
|
87
|
-
console.log(` Title: ${memory.title}`);
|
|
88
|
-
console.log(` Type: ${memory.memory_type}`);
|
|
89
|
-
if (memory.tags && memory.tags.length > 0) {
|
|
90
|
-
console.log(` Tags: ${memory.tags.join(', ')}`);
|
|
91
|
-
}
|
|
72
|
+
spinner.succeed('Memory created successfully');
|
|
73
|
+
console.log();
|
|
74
|
+
console.log(chalk.green('✓ Memory created:'));
|
|
75
|
+
console.log(` ID: ${chalk.cyan(memory.id)}`);
|
|
76
|
+
console.log(` Title: ${memory.title}`);
|
|
77
|
+
console.log(` Type: ${memory.memory_type}`);
|
|
78
|
+
if (memory.tags && memory.tags.length > 0) {
|
|
79
|
+
console.log(` Tags: ${memory.tags.join(', ')}`);
|
|
92
80
|
}
|
|
93
81
|
}
|
|
94
82
|
catch (error) {
|
|
95
83
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
96
|
-
|
|
84
|
+
console.error(chalk.red('✖ Failed to create memory:'), errorMessage);
|
|
97
85
|
process.exit(1);
|
|
98
86
|
}
|
|
99
87
|
});
|
|
@@ -111,41 +99,36 @@ export function memoryCommands(program) {
|
|
|
111
99
|
.option('--order <order>', 'sort order (asc, desc)', 'desc')
|
|
112
100
|
.action(async (options) => {
|
|
113
101
|
try {
|
|
114
|
-
const spinner =
|
|
102
|
+
const spinner = ora('Fetching memories...').start();
|
|
115
103
|
const params = {
|
|
116
|
-
|
|
104
|
+
page: parseInt(options.page || '1'),
|
|
117
105
|
limit: parseInt(options.limit || '20'),
|
|
118
|
-
|
|
119
|
-
|
|
106
|
+
sort: options.sort || 'created_at',
|
|
107
|
+
order: options.order || 'desc'
|
|
120
108
|
};
|
|
121
109
|
if (options.type)
|
|
122
110
|
params.memory_type = options.type;
|
|
123
111
|
if (options.tags)
|
|
124
|
-
params.tags = options.tags
|
|
125
|
-
|
|
112
|
+
params.tags = options.tags;
|
|
113
|
+
if (options.userId)
|
|
114
|
+
params.user_id = options.userId;
|
|
126
115
|
const result = await apiClient.getMemories(params);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
output.json({ data: [], pagination: result.pagination });
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
console.log(chalk.yellow('No memories found'));
|
|
135
|
-
}
|
|
116
|
+
spinner.stop();
|
|
117
|
+
const memories = result.memories || result.data || [];
|
|
118
|
+
if (memories.length === 0) {
|
|
119
|
+
console.log(chalk.yellow('No memories found'));
|
|
136
120
|
return;
|
|
137
121
|
}
|
|
138
|
-
|
|
139
|
-
|
|
122
|
+
console.log(chalk.blue.bold(`\n📚 Memories (${result.pagination.total} total)`));
|
|
123
|
+
console.log(chalk.gray(`Page ${result.pagination.page || 1} of ${result.pagination.pages || Math.ceil(result.pagination.total / result.pagination.limit)}`));
|
|
124
|
+
console.log();
|
|
125
|
+
const outputFormat = process.env.CLI_OUTPUT_FORMAT || 'table';
|
|
126
|
+
if (outputFormat === 'json') {
|
|
127
|
+
console.log(JSON.stringify(result, null, 2));
|
|
140
128
|
}
|
|
141
129
|
else {
|
|
142
|
-
console.log(chalk.blue.bold(`\n📚 Memories (${result.pagination.total} total)`));
|
|
143
|
-
const currentPage = Math.floor(result.pagination.offset / result.pagination.limit) + 1;
|
|
144
|
-
const totalPages = Math.ceil(result.pagination.total / result.pagination.limit);
|
|
145
|
-
console.log(chalk.gray(`Page ${currentPage} of ${totalPages}`));
|
|
146
|
-
console.log();
|
|
147
130
|
// Table format
|
|
148
|
-
const tableData =
|
|
131
|
+
const tableData = memories.map((memory) => [
|
|
149
132
|
truncateText(memory.title, 30),
|
|
150
133
|
memory.memory_type,
|
|
151
134
|
memory.tags.slice(0, 3).join(', '),
|
|
@@ -153,6 +136,7 @@ export function memoryCommands(program) {
|
|
|
153
136
|
memory.access_count
|
|
154
137
|
]);
|
|
155
138
|
const tableConfig = {
|
|
139
|
+
header: ['Title', 'Type', 'Tags', 'Created', 'Access'],
|
|
156
140
|
columnDefault: {
|
|
157
141
|
width: 20,
|
|
158
142
|
wrapWord: true
|
|
@@ -165,12 +149,13 @@ export function memoryCommands(program) {
|
|
|
165
149
|
{ width: 8 }
|
|
166
150
|
]
|
|
167
151
|
};
|
|
168
|
-
|
|
169
|
-
|
|
152
|
+
console.log(table([tableConfig.header, ...tableData], {
|
|
153
|
+
columnDefault: tableConfig.columnDefault,
|
|
154
|
+
columns: tableConfig.columns
|
|
155
|
+
}));
|
|
170
156
|
// Pagination info
|
|
171
|
-
if (result.pagination.
|
|
172
|
-
|
|
173
|
-
console.log(chalk.gray(`\nUse --page ${nextPage} for next page`));
|
|
157
|
+
if (result.pagination.pages > 1) {
|
|
158
|
+
console.log(chalk.gray(`\nUse --page ${result.pagination.page + 1} for next page`));
|
|
174
159
|
}
|
|
175
160
|
}
|
|
176
161
|
}
|
|
@@ -191,7 +176,7 @@ export function memoryCommands(program) {
|
|
|
191
176
|
.option('--tags <tags>', 'filter by tags (comma-separated)')
|
|
192
177
|
.action(async (query, options) => {
|
|
193
178
|
try {
|
|
194
|
-
const spinner =
|
|
179
|
+
const spinner = ora(`Searching for "${query}"...`).start();
|
|
195
180
|
const searchOptions = {
|
|
196
181
|
limit: parseInt(options.limit || '20'),
|
|
197
182
|
threshold: parseFloat(options.threshold || '0.7')
|
|
@@ -203,35 +188,25 @@ export function memoryCommands(program) {
|
|
|
203
188
|
searchOptions.tags = options.tags.split(',').map((t) => t.trim());
|
|
204
189
|
}
|
|
205
190
|
const result = await apiClient.searchMemories(query, searchOptions);
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
if (
|
|
209
|
-
|
|
210
|
-
output.json({ data: [], pagination: result.pagination, query });
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
console.log(chalk.yellow('No memories found matching your search'));
|
|
214
|
-
}
|
|
191
|
+
spinner.stop();
|
|
192
|
+
const results = result.results || result.data || [];
|
|
193
|
+
if (results.length === 0) {
|
|
194
|
+
console.log(chalk.yellow('No memories found matching your search'));
|
|
215
195
|
return;
|
|
216
196
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
console.log(chalk.gray(`
|
|
197
|
+
console.log(chalk.blue.bold(`\n🔍 Search Results (${result.total_results || results.length} found)`));
|
|
198
|
+
console.log(chalk.gray(`Query: "${query}" | Search time: ${result.search_time_ms || 0}ms`));
|
|
199
|
+
console.log();
|
|
200
|
+
results.forEach((memory, index) => {
|
|
201
|
+
const score = (memory.relevance_score * 100).toFixed(1);
|
|
202
|
+
console.log(chalk.green(`${index + 1}. ${memory.title}`) + chalk.gray(` (${score}% match)`));
|
|
203
|
+
console.log(chalk.white(` ${truncateText(memory.content, 100)}`));
|
|
204
|
+
console.log(chalk.cyan(` ID: ${memory.id}`) + chalk.gray(` | Type: ${memory.memory_type}`));
|
|
205
|
+
if (memory.tags.length > 0) {
|
|
206
|
+
console.log(chalk.yellow(` Tags: ${memory.tags.join(', ')}`));
|
|
207
|
+
}
|
|
223
208
|
console.log();
|
|
224
|
-
|
|
225
|
-
const score = (memory.relevance_score * 100).toFixed(1);
|
|
226
|
-
console.log(chalk.green(`${index + 1}. ${memory.title}`) + chalk.gray(` (${score}% match)`));
|
|
227
|
-
console.log(chalk.white(` ${truncateText(memory.content, 100)}`));
|
|
228
|
-
console.log(chalk.cyan(` ID: ${memory.id}`) + chalk.gray(` | Type: ${memory.memory_type}`));
|
|
229
|
-
if (memory.tags.length > 0) {
|
|
230
|
-
console.log(chalk.yellow(` Tags: ${memory.tags.join(', ')}`));
|
|
231
|
-
}
|
|
232
|
-
console.log();
|
|
233
|
-
});
|
|
234
|
-
}
|
|
209
|
+
});
|
|
235
210
|
}
|
|
236
211
|
catch (error) {
|
|
237
212
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Lanonasis/Onasis CLI Bash Completion
|
|
4
|
+
# Installation: source this file or copy to /etc/bash_completion.d/
|
|
5
|
+
|
|
6
|
+
_lanonasis_completions() {
|
|
7
|
+
local cur prev words cword
|
|
8
|
+
_init_completion || return
|
|
9
|
+
|
|
10
|
+
# Get completion data from CLI
|
|
11
|
+
local completion_data
|
|
12
|
+
completion_data=$(lanonasis --completion-data 2>/dev/null || echo '{}')
|
|
13
|
+
|
|
14
|
+
case "${COMP_CWORD}" in
|
|
15
|
+
1)
|
|
16
|
+
# Main commands
|
|
17
|
+
local commands=$(echo "$completion_data" | jq -r '.commands[]?.name // empty' 2>/dev/null)
|
|
18
|
+
if [[ -z "$commands" ]]; then
|
|
19
|
+
commands="init login auth logout status health docs memory mem topic topics config org organization api-keys mcp dashboard documentation sdk api rest deploy deployment service services"
|
|
20
|
+
fi
|
|
21
|
+
COMPREPLY=($(compgen -W "$commands" -- "$cur"))
|
|
22
|
+
;;
|
|
23
|
+
2)
|
|
24
|
+
# Subcommands based on main command
|
|
25
|
+
case "${words[1]}" in
|
|
26
|
+
auth|login)
|
|
27
|
+
COMPREPLY=($(compgen -W "login logout status vendor-key oauth" -- "$cur"))
|
|
28
|
+
;;
|
|
29
|
+
memory|mem)
|
|
30
|
+
COMPREPLY=($(compgen -W "list create get update delete search stats bulk-delete export import" -- "$cur"))
|
|
31
|
+
;;
|
|
32
|
+
topic|topics)
|
|
33
|
+
COMPREPLY=($(compgen -W "list create get update delete" -- "$cur"))
|
|
34
|
+
;;
|
|
35
|
+
config)
|
|
36
|
+
COMPREPLY=($(compgen -W "get set list reset" -- "$cur"))
|
|
37
|
+
;;
|
|
38
|
+
api-keys)
|
|
39
|
+
COMPREPLY=($(compgen -W "list create revoke rotate" -- "$cur"))
|
|
40
|
+
;;
|
|
41
|
+
mcp)
|
|
42
|
+
COMPREPLY=($(compgen -W "status connect disconnect servers tools resources" -- "$cur"))
|
|
43
|
+
;;
|
|
44
|
+
dashboard)
|
|
45
|
+
COMPREPLY=($(compgen -W "status logs open" -- "$cur"))
|
|
46
|
+
;;
|
|
47
|
+
deploy|deployment)
|
|
48
|
+
COMPREPLY=($(compgen -W "status health list" -- "$cur"))
|
|
49
|
+
;;
|
|
50
|
+
service|services)
|
|
51
|
+
COMPREPLY=($(compgen -W "list status restart logs" -- "$cur"))
|
|
52
|
+
;;
|
|
53
|
+
esac
|
|
54
|
+
;;
|
|
55
|
+
*)
|
|
56
|
+
# Options and flags
|
|
57
|
+
case "${prev}" in
|
|
58
|
+
--memory-type)
|
|
59
|
+
COMPREPLY=($(compgen -W "context project knowledge reference personal workflow" -- "$cur"))
|
|
60
|
+
;;
|
|
61
|
+
--output)
|
|
62
|
+
COMPREPLY=($(compgen -W "table json yaml csv" -- "$cur"))
|
|
63
|
+
;;
|
|
64
|
+
--sort-by)
|
|
65
|
+
COMPREPLY=($(compgen -W "created_at updated_at last_accessed access_count" -- "$cur"))
|
|
66
|
+
;;
|
|
67
|
+
--sort-order)
|
|
68
|
+
COMPREPLY=($(compgen -W "asc desc" -- "$cur"))
|
|
69
|
+
;;
|
|
70
|
+
--api-url)
|
|
71
|
+
COMPREPLY=($(compgen -W "https://api.lanonasis.com/api/v1" -- "$cur"))
|
|
72
|
+
;;
|
|
73
|
+
esac
|
|
74
|
+
|
|
75
|
+
# Global flags
|
|
76
|
+
if [[ "$cur" == -* ]]; then
|
|
77
|
+
local global_flags="--help --version --verbose --output --api-url --no-mcp"
|
|
78
|
+
COMPREPLY=($(compgen -W "$global_flags" -- "$cur"))
|
|
79
|
+
fi
|
|
80
|
+
;;
|
|
81
|
+
esac
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
# Register completions for all command aliases
|
|
85
|
+
complete -F _lanonasis_completions lanonasis
|
|
86
|
+
complete -F _lanonasis_completions onasis
|
|
87
|
+
complete -F _lanonasis_completions memory
|
|
88
|
+
complete -F _lanonasis_completions maas
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Lanonasis/Onasis CLI Fish Completion
|
|
2
|
+
# Installation: Place in ~/.config/fish/completions/
|
|
3
|
+
|
|
4
|
+
# Helper function to check if a command is being used
|
|
5
|
+
function __fish_lanonasis_using_command
|
|
6
|
+
set -l cmd (commandline -opc)
|
|
7
|
+
if [ (count $cmd) -eq 2 ]
|
|
8
|
+
if [ $argv[1] = $cmd[2] ]
|
|
9
|
+
return 0
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
return 1
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
function __fish_lanonasis_using_subcommand
|
|
16
|
+
set -l cmd (commandline -opc)
|
|
17
|
+
if [ (count $cmd) -eq 3 ]
|
|
18
|
+
if [ $argv[1] = $cmd[2] ]; and [ $argv[2] = $cmd[3] ]
|
|
19
|
+
return 0
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
return 1
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Global options
|
|
26
|
+
complete -c lanonasis -s h -l help -d 'Show help information'
|
|
27
|
+
complete -c lanonasis -s v -l version -d 'Show version information'
|
|
28
|
+
complete -c lanonasis -s V -l verbose -d 'Enable verbose logging'
|
|
29
|
+
complete -c lanonasis -l output -d 'Output format' -xa 'table json yaml csv'
|
|
30
|
+
complete -c lanonasis -l api-url -d 'Override API URL'
|
|
31
|
+
complete -c lanonasis -l no-mcp -d 'Disable MCP and use direct API'
|
|
32
|
+
|
|
33
|
+
# Main commands
|
|
34
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'init' -d 'Initialize CLI configuration'
|
|
35
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'login' -d 'Authenticate with your account'
|
|
36
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'auth' -d 'Authentication commands'
|
|
37
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'logout' -d 'Logout from your account'
|
|
38
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'status' -d 'Show system status'
|
|
39
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'health' -d 'Comprehensive health check'
|
|
40
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'docs' -d 'Open documentation'
|
|
41
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'memory' -d 'Memory management commands'
|
|
42
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'mem' -d 'Memory management (alias)'
|
|
43
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'topic' -d 'Topic management commands'
|
|
44
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'topics' -d 'Topic management (alias)'
|
|
45
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'config' -d 'Configuration management'
|
|
46
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'org' -d 'Organization management'
|
|
47
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'organization' -d 'Organization management (alias)'
|
|
48
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'api-keys' -d 'API key management'
|
|
49
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'mcp' -d 'Model Context Protocol commands'
|
|
50
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'dashboard' -d 'Dashboard management'
|
|
51
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'documentation' -d 'Documentation management'
|
|
52
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'sdk' -d 'SDK management'
|
|
53
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'api' -d 'REST API management'
|
|
54
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'rest' -d 'REST API management (alias)'
|
|
55
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'deploy' -d 'Deployment management'
|
|
56
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'deployment' -d 'Deployment management (alias)'
|
|
57
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'service' -d 'Service management'
|
|
58
|
+
complete -c lanonasis -f -n '__fish_use_subcommand' -a 'services' -d 'Service management (alias)'
|
|
59
|
+
|
|
60
|
+
# Auth subcommands
|
|
61
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command auth' -a 'login' -d 'Login to your account'
|
|
62
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command auth' -a 'logout' -d 'Logout from your account'
|
|
63
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command auth' -a 'status' -d 'Show authentication status'
|
|
64
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command auth' -a 'vendor-key' -d 'Authenticate with vendor key'
|
|
65
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command auth' -a 'oauth' -d 'Browser-based OAuth authentication'
|
|
66
|
+
|
|
67
|
+
# Memory subcommands
|
|
68
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command memory' -a 'list' -d 'List memories'
|
|
69
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command memory' -a 'create' -d 'Create a new memory'
|
|
70
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command memory' -a 'get' -d 'Get a specific memory'
|
|
71
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command memory' -a 'update' -d 'Update an existing memory'
|
|
72
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command memory' -a 'delete' -d 'Delete a memory'
|
|
73
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command memory' -a 'search' -d 'Search memories'
|
|
74
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command memory' -a 'stats' -d 'Show memory statistics'
|
|
75
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command memory' -a 'bulk-delete' -d 'Delete multiple memories'
|
|
76
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command memory' -a 'export' -d 'Export memories'
|
|
77
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command memory' -a 'import' -d 'Import memories'
|
|
78
|
+
|
|
79
|
+
# Memory command options
|
|
80
|
+
complete -c lanonasis -n '__fish_lanonasis_using_subcommand memory create' -l memory-type -xa 'context project knowledge reference personal workflow'
|
|
81
|
+
complete -c lanonasis -n '__fish_lanonasis_using_subcommand memory update' -l memory-type -xa 'context project knowledge reference personal workflow'
|
|
82
|
+
complete -c lanonasis -n '__fish_lanonasis_using_subcommand memory list' -l memory-type -xa 'context project knowledge reference personal workflow'
|
|
83
|
+
complete -c lanonasis -n '__fish_lanonasis_using_subcommand memory list' -l sort-by -xa 'created_at updated_at last_accessed access_count'
|
|
84
|
+
complete -c lanonasis -n '__fish_lanonasis_using_subcommand memory list' -l sort-order -xa 'asc desc'
|
|
85
|
+
|
|
86
|
+
# Topic subcommands
|
|
87
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command topic' -a 'list' -d 'List topics'
|
|
88
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command topic' -a 'create' -d 'Create a new topic'
|
|
89
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command topic' -a 'get' -d 'Get a specific topic'
|
|
90
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command topic' -a 'update' -d 'Update an existing topic'
|
|
91
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command topic' -a 'delete' -d 'Delete a topic'
|
|
92
|
+
|
|
93
|
+
# Config subcommands
|
|
94
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command config' -a 'get' -d 'Get configuration value'
|
|
95
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command config' -a 'set' -d 'Set configuration value'
|
|
96
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command config' -a 'list' -d 'List all configuration'
|
|
97
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command config' -a 'reset' -d 'Reset configuration'
|
|
98
|
+
|
|
99
|
+
# API Keys subcommands
|
|
100
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command api-keys' -a 'list' -d 'List API keys'
|
|
101
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command api-keys' -a 'create' -d 'Create a new API key'
|
|
102
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command api-keys' -a 'revoke' -d 'Revoke an API key'
|
|
103
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command api-keys' -a 'rotate' -d 'Rotate an API key'
|
|
104
|
+
|
|
105
|
+
# MCP subcommands
|
|
106
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command mcp' -a 'status' -d 'Show MCP server status'
|
|
107
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command mcp' -a 'connect' -d 'Connect to MCP server'
|
|
108
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command mcp' -a 'disconnect' -d 'Disconnect from MCP server'
|
|
109
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command mcp' -a 'servers' -d 'List MCP servers'
|
|
110
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command mcp' -a 'tools' -d 'List available tools'
|
|
111
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command mcp' -a 'resources' -d 'List available resources'
|
|
112
|
+
|
|
113
|
+
# Dashboard subcommands
|
|
114
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command dashboard' -a 'status' -d 'Check dashboard status'
|
|
115
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command dashboard' -a 'logs' -d 'View dashboard logs'
|
|
116
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command dashboard' -a 'open' -d 'Open dashboard in browser'
|
|
117
|
+
|
|
118
|
+
# Deploy subcommands
|
|
119
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command deploy' -a 'status' -d 'Show deployment status'
|
|
120
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command deploy' -a 'health' -d 'Check deployment health'
|
|
121
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command deploy' -a 'list' -d 'List deployments'
|
|
122
|
+
|
|
123
|
+
# Service subcommands
|
|
124
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command service' -a 'list' -d 'List services'
|
|
125
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command service' -a 'status' -d 'Show service status'
|
|
126
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command service' -a 'restart' -d 'Restart a service'
|
|
127
|
+
complete -c lanonasis -f -n '__fish_lanonasis_using_command service' -a 'logs' -d 'View service logs'
|
|
128
|
+
|
|
129
|
+
# Apply same completions for all aliases
|
|
130
|
+
complete -c onasis -w lanonasis
|
|
131
|
+
complete -c memory -w lanonasis
|
|
132
|
+
complete -c maas -w lanonasis
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
#compdef lanonasis onasis memory maas
|
|
2
|
+
|
|
3
|
+
# Lanonasis/Onasis CLI Zsh Completion
|
|
4
|
+
# Installation: Place in your $fpath (e.g., ~/.zsh/completions/) and run 'compinit'
|
|
5
|
+
|
|
6
|
+
_lanonasis() {
|
|
7
|
+
local context curcontext="$curcontext" state line
|
|
8
|
+
typeset -A opt_args
|
|
9
|
+
|
|
10
|
+
_arguments -C \
|
|
11
|
+
'1: :_lanonasis_commands' \
|
|
12
|
+
'*:: :->args' \
|
|
13
|
+
'--help[Show help information]' \
|
|
14
|
+
'--version[Show version information]' \
|
|
15
|
+
'--verbose[Enable verbose logging]' \
|
|
16
|
+
'--output[Output format]:format:(table json yaml csv)' \
|
|
17
|
+
'--api-url[Override API URL]:url:' \
|
|
18
|
+
'--no-mcp[Disable MCP and use direct API]'
|
|
19
|
+
|
|
20
|
+
case $state in
|
|
21
|
+
args)
|
|
22
|
+
case $words[1] in
|
|
23
|
+
auth|login)
|
|
24
|
+
_lanonasis_auth_commands
|
|
25
|
+
;;
|
|
26
|
+
memory|mem)
|
|
27
|
+
_lanonasis_memory_commands
|
|
28
|
+
;;
|
|
29
|
+
topic|topics)
|
|
30
|
+
_lanonasis_topic_commands
|
|
31
|
+
;;
|
|
32
|
+
config)
|
|
33
|
+
_lanonasis_config_commands
|
|
34
|
+
;;
|
|
35
|
+
api-keys)
|
|
36
|
+
_lanonasis_apikeys_commands
|
|
37
|
+
;;
|
|
38
|
+
mcp)
|
|
39
|
+
_lanonasis_mcp_commands
|
|
40
|
+
;;
|
|
41
|
+
dashboard)
|
|
42
|
+
_lanonasis_dashboard_commands
|
|
43
|
+
;;
|
|
44
|
+
deploy|deployment)
|
|
45
|
+
_lanonasis_deploy_commands
|
|
46
|
+
;;
|
|
47
|
+
service|services)
|
|
48
|
+
_lanonasis_service_commands
|
|
49
|
+
;;
|
|
50
|
+
esac
|
|
51
|
+
;;
|
|
52
|
+
esac
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
_lanonasis_commands() {
|
|
56
|
+
local commands; commands=(
|
|
57
|
+
'init:Initialize CLI configuration'
|
|
58
|
+
'login:Authenticate with your account'
|
|
59
|
+
'auth:Authentication commands'
|
|
60
|
+
'logout:Logout from your account'
|
|
61
|
+
'status:Show system status'
|
|
62
|
+
'health:Comprehensive health check'
|
|
63
|
+
'docs:Open documentation'
|
|
64
|
+
'memory:Memory management commands'
|
|
65
|
+
'mem:Memory management (alias)'
|
|
66
|
+
'topic:Topic management commands'
|
|
67
|
+
'topics:Topic management (alias)'
|
|
68
|
+
'config:Configuration management'
|
|
69
|
+
'org:Organization management'
|
|
70
|
+
'organization:Organization management (alias)'
|
|
71
|
+
'api-keys:API key management'
|
|
72
|
+
'mcp:Model Context Protocol commands'
|
|
73
|
+
'dashboard:Dashboard management'
|
|
74
|
+
'documentation:Documentation management'
|
|
75
|
+
'sdk:SDK management'
|
|
76
|
+
'api:REST API management'
|
|
77
|
+
'rest:REST API management (alias)'
|
|
78
|
+
'deploy:Deployment management'
|
|
79
|
+
'deployment:Deployment management (alias)'
|
|
80
|
+
'service:Service management'
|
|
81
|
+
'services:Service management (alias)'
|
|
82
|
+
)
|
|
83
|
+
_describe 'commands' commands
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
_lanonasis_auth_commands() {
|
|
87
|
+
local subcommands; subcommands=(
|
|
88
|
+
'login:Login to your account'
|
|
89
|
+
'logout:Logout from your account'
|
|
90
|
+
'status:Show authentication status'
|
|
91
|
+
'vendor-key:Authenticate with vendor key'
|
|
92
|
+
'oauth:Browser-based OAuth authentication'
|
|
93
|
+
)
|
|
94
|
+
_describe 'auth commands' subcommands
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
_lanonasis_memory_commands() {
|
|
98
|
+
local subcommands; subcommands=(
|
|
99
|
+
'list:List memories'
|
|
100
|
+
'create:Create a new memory'
|
|
101
|
+
'get:Get a specific memory'
|
|
102
|
+
'update:Update an existing memory'
|
|
103
|
+
'delete:Delete a memory'
|
|
104
|
+
'search:Search memories'
|
|
105
|
+
'stats:Show memory statistics'
|
|
106
|
+
'bulk-delete:Delete multiple memories'
|
|
107
|
+
'export:Export memories'
|
|
108
|
+
'import:Import memories'
|
|
109
|
+
)
|
|
110
|
+
_describe 'memory commands' subcommands
|
|
111
|
+
|
|
112
|
+
# Add memory type completion for relevant commands
|
|
113
|
+
if [[ "$words[2]" == "create" || "$words[2]" == "update" || "$words[2]" == "list" ]]; then
|
|
114
|
+
_arguments \
|
|
115
|
+
'--memory-type[Memory type]:type:(context project knowledge reference personal workflow)' \
|
|
116
|
+
'--tags[Tags]:tags:' \
|
|
117
|
+
'--topic-id[Topic ID]:topic:'
|
|
118
|
+
fi
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
_lanonasis_topic_commands() {
|
|
122
|
+
local subcommands; subcommands=(
|
|
123
|
+
'list:List topics'
|
|
124
|
+
'create:Create a new topic'
|
|
125
|
+
'get:Get a specific topic'
|
|
126
|
+
'update:Update an existing topic'
|
|
127
|
+
'delete:Delete a topic'
|
|
128
|
+
)
|
|
129
|
+
_describe 'topic commands' subcommands
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
_lanonasis_config_commands() {
|
|
133
|
+
local subcommands; subcommands=(
|
|
134
|
+
'get:Get configuration value'
|
|
135
|
+
'set:Set configuration value'
|
|
136
|
+
'list:List all configuration'
|
|
137
|
+
'reset:Reset configuration'
|
|
138
|
+
)
|
|
139
|
+
_describe 'config commands' subcommands
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
_lanonasis_apikeys_commands() {
|
|
143
|
+
local subcommands; subcommands=(
|
|
144
|
+
'list:List API keys'
|
|
145
|
+
'create:Create a new API key'
|
|
146
|
+
'revoke:Revoke an API key'
|
|
147
|
+
'rotate:Rotate an API key'
|
|
148
|
+
)
|
|
149
|
+
_describe 'api-keys commands' subcommands
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
_lanonasis_mcp_commands() {
|
|
153
|
+
local subcommands; subcommands=(
|
|
154
|
+
'status:Show MCP server status'
|
|
155
|
+
'connect:Connect to MCP server'
|
|
156
|
+
'disconnect:Disconnect from MCP server'
|
|
157
|
+
'servers:List MCP servers'
|
|
158
|
+
'tools:List available tools'
|
|
159
|
+
'resources:List available resources'
|
|
160
|
+
)
|
|
161
|
+
_describe 'mcp commands' subcommands
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
_lanonasis_dashboard_commands() {
|
|
165
|
+
local subcommands; subcommands=(
|
|
166
|
+
'status:Check dashboard status'
|
|
167
|
+
'logs:View dashboard logs'
|
|
168
|
+
'open:Open dashboard in browser'
|
|
169
|
+
)
|
|
170
|
+
_describe 'dashboard commands' subcommands
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
_lanonasis_deploy_commands() {
|
|
174
|
+
local subcommands; subcommands=(
|
|
175
|
+
'status:Show deployment status'
|
|
176
|
+
'health:Check deployment health'
|
|
177
|
+
'list:List deployments'
|
|
178
|
+
)
|
|
179
|
+
_describe 'deploy commands' subcommands
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
_lanonasis_service_commands() {
|
|
183
|
+
local subcommands; subcommands=(
|
|
184
|
+
'list:List services'
|
|
185
|
+
'status:Show service status'
|
|
186
|
+
'restart:Restart a service'
|
|
187
|
+
'logs:View service logs'
|
|
188
|
+
)
|
|
189
|
+
_describe 'service commands' subcommands
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
# Initialize completion for all aliases
|
|
193
|
+
compdef _lanonasis lanonasis
|
|
194
|
+
compdef _lanonasis onasis
|
|
195
|
+
compdef _lanonasis memory
|
|
196
|
+
compdef _lanonasis maas
|