quilltap 4.5.0-dev → 4.6.0-dev
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 +178 -0
- package/bin/quilltap.js +226 -20
- package/lib/completion/bash.template +121 -0
- package/lib/completion/fish.template +93 -0
- package/lib/completion/zsh.template +209 -0
- package/lib/completion-commands.js +77 -0
- package/lib/db-commands.js +1142 -0
- package/lib/db-helpers.js +173 -4
- package/lib/docs-commands.js +2157 -172
- package/lib/graph-integrity.js +105 -0
- package/lib/instances-commands.js +342 -0
- package/lib/instances.js +335 -0
- package/lib/lock-helpers.js +117 -0
- package/lib/logs-commands.js +383 -0
- package/lib/memories-commands.js +1374 -0
- package/lib/memory-diff-command.js +19 -3
- package/lib/migrations-commands.js +324 -0
- package/lib/theme-commands.js +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/usr/bin/env fish
|
|
2
|
+
|
|
3
|
+
# Fish completion for quilltap
|
|
4
|
+
|
|
5
|
+
# Top-level verbs
|
|
6
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -a 'db' -d 'Query encrypted databases'
|
|
7
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -a 'docs' -d 'Inspect and read document mounts'
|
|
8
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -a 'themes' -d 'Manage theme bundles'
|
|
9
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -a 'instances' -d 'Register or inspect instances'
|
|
10
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -a 'memories' -d 'Search and browse memories'
|
|
11
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -a 'memory-diff' -d 'Memory extraction dry-run'
|
|
12
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -a 'completion' -d 'Generate shell completion'
|
|
13
|
+
|
|
14
|
+
# Global options
|
|
15
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -l 'port' -s 'p' -d 'Port to listen on' -x
|
|
16
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -l 'data-dir' -s 'd' -d 'Data directory' -x
|
|
17
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -l 'instance' -s 'i' -d 'Use registered instance' -x
|
|
18
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -l 'open' -s 'o' -d 'Open browser after start'
|
|
19
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -l 'version' -s 'v' -d 'Show version'
|
|
20
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -l 'update' -d 'Force re-download'
|
|
21
|
+
complete -c quilltap -n '__fish_use_subcommand' -f -l 'help' -s 'h' -d 'Show help'
|
|
22
|
+
|
|
23
|
+
# db subcommands
|
|
24
|
+
complete -c quilltap -n '__fish_seen_subcommand_from db' -f -a 'schema' -d 'Show database schema'
|
|
25
|
+
complete -c quilltap -n '__fish_seen_subcommand_from db' -f -a 'find' -d 'Find entities by name'
|
|
26
|
+
complete -c quilltap -n '__fish_seen_subcommand_from db' -f -a 'chats' -d 'Find chats'
|
|
27
|
+
complete -c quilltap -n '__fish_seen_subcommand_from db' -f -a 'messages' -d 'Find messages'
|
|
28
|
+
complete -c quilltap -n '__fish_seen_subcommand_from db' -f -a 'logs' -d 'Get LLM logs'
|
|
29
|
+
complete -c quilltap -n '__fish_seen_subcommand_from db' -f -a 'message' -d 'Get single message'
|
|
30
|
+
complete -c quilltap -n '__fish_seen_subcommand_from db' -f -a 'log' -d 'Get single log entry'
|
|
31
|
+
complete -c quilltap -n '__fish_seen_subcommand_from db' -f -a 'memories' -d 'List memories'
|
|
32
|
+
complete -c quilltap -n '__fish_seen_subcommand_from db' -f -a 'optimize' -d 'Optimize database'
|
|
33
|
+
complete -c quilltap -n '__fish_seen_subcommand_from db' -f -a 'backup' -d 'Backup database'
|
|
34
|
+
complete -c quilltap -n '__fish_seen_subcommand_from db' -f -a 'integrity' -d 'Check integrity'
|
|
35
|
+
|
|
36
|
+
# docs subcommands
|
|
37
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'list' -d 'List mount points'
|
|
38
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'show' -d 'Show mount details'
|
|
39
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'files' -d 'List files in mount'
|
|
40
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'ls' -d 'ls-style listing'
|
|
41
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'dir' -d 'Directory listing'
|
|
42
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'read' -d 'Print file contents'
|
|
43
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'export' -d 'Export mount'
|
|
44
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'scan' -d 'Trigger rescan'
|
|
45
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'find' -d 'Substring search'
|
|
46
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'grep' -d 'Pattern search in text'
|
|
47
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'status' -d 'Per-mount status'
|
|
48
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'reindex' -d 'Re-extract and chunk'
|
|
49
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'embed' -d 'Enqueue embeddings'
|
|
50
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'write' -d 'Write a file'
|
|
51
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'delete' -d 'Delete a file'
|
|
52
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'mkdir' -d 'Create folder'
|
|
53
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'move' -d 'Move file'
|
|
54
|
+
complete -c quilltap -n '__fish_seen_subcommand_from docs' -f -a 'copy' -d 'Copy file'
|
|
55
|
+
|
|
56
|
+
# themes subcommands
|
|
57
|
+
complete -c quilltap -n '__fish_seen_subcommand_from themes' -f -a 'list' -d 'List themes'
|
|
58
|
+
complete -c quilltap -n '__fish_seen_subcommand_from themes' -f -a 'install' -d 'Install theme'
|
|
59
|
+
complete -c quilltap -n '__fish_seen_subcommand_from themes' -f -a 'uninstall' -d 'Uninstall theme'
|
|
60
|
+
complete -c quilltap -n '__fish_seen_subcommand_from themes' -f -a 'validate' -d 'Validate bundle'
|
|
61
|
+
complete -c quilltap -n '__fish_seen_subcommand_from themes' -f -a 'export' -d 'Export theme'
|
|
62
|
+
complete -c quilltap -n '__fish_seen_subcommand_from themes' -f -a 'create' -d 'Create theme'
|
|
63
|
+
complete -c quilltap -n '__fish_seen_subcommand_from themes' -f -a 'search' -d 'Search registries'
|
|
64
|
+
complete -c quilltap -n '__fish_seen_subcommand_from themes' -f -a 'update' -d 'Update themes'
|
|
65
|
+
complete -c quilltap -n '__fish_seen_subcommand_from themes' -f -a 'registry' -d 'Manage registries'
|
|
66
|
+
|
|
67
|
+
# instances subcommands
|
|
68
|
+
complete -c quilltap -n '__fish_seen_subcommand_from instances' -f -a 'list' -d 'List instances'
|
|
69
|
+
complete -c quilltap -n '__fish_seen_subcommand_from instances' -f -a 'ls' -d 'List instances'
|
|
70
|
+
complete -c quilltap -n '__fish_seen_subcommand_from instances' -f -a 'show' -d 'Show instance'
|
|
71
|
+
complete -c quilltap -n '__fish_seen_subcommand_from instances' -f -a 'path' -d 'Show path'
|
|
72
|
+
complete -c quilltap -n '__fish_seen_subcommand_from instances' -f -a 'where' -d 'Show path'
|
|
73
|
+
complete -c quilltap -n '__fish_seen_subcommand_from instances' -f -a 'add' -d 'Register instance'
|
|
74
|
+
complete -c quilltap -n '__fish_seen_subcommand_from instances' -f -a 'create' -d 'Register instance'
|
|
75
|
+
complete -c quilltap -n '__fish_seen_subcommand_from instances' -f -a 'remove' -d 'Unregister'
|
|
76
|
+
complete -c quilltap -n '__fish_seen_subcommand_from instances' -f -a 'rm' -d 'Unregister'
|
|
77
|
+
complete -c quilltap -n '__fish_seen_subcommand_from instances' -f -a 'delete' -d 'Unregister'
|
|
78
|
+
complete -c quilltap -n '__fish_seen_subcommand_from instances' -f -a 'set-passphrase' -d 'Set passphrase'
|
|
79
|
+
complete -c quilltap -n '__fish_seen_subcommand_from instances' -f -a 'passphrase' -d 'Set passphrase'
|
|
80
|
+
|
|
81
|
+
# memories subcommands
|
|
82
|
+
complete -c quilltap -n '__fish_seen_subcommand_from memories' -f -a 'ls' -d 'List memories'
|
|
83
|
+
complete -c quilltap -n '__fish_seen_subcommand_from memories' -f -a 'find' -d 'Substring search'
|
|
84
|
+
complete -c quilltap -n '__fish_seen_subcommand_from memories' -f -a 'grep' -d 'Pattern search'
|
|
85
|
+
complete -c quilltap -n '__fish_seen_subcommand_from memories' -f -a 'show' -d 'Show memory'
|
|
86
|
+
complete -c quilltap -n '__fish_seen_subcommand_from memories' -f -a 'tree' -d 'Graph walk'
|
|
87
|
+
complete -c quilltap -n '__fish_seen_subcommand_from memories' -f -a 'status' -d 'Memory status'
|
|
88
|
+
complete -c quilltap -n '__fish_seen_subcommand_from memories' -f -a 'validate' -d 'Health check'
|
|
89
|
+
|
|
90
|
+
# completion subcommands
|
|
91
|
+
complete -c quilltap -n '__fish_seen_subcommand_from completion' -f -a 'bash' -d 'Bash completion'
|
|
92
|
+
complete -c quilltap -n '__fish_seen_subcommand_from completion' -f -a 'zsh' -d 'Zsh completion'
|
|
93
|
+
complete -c quilltap -n '__fish_seen_subcommand_from completion' -f -a 'fish' -d 'Fish completion'
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
#compdef quilltap
|
|
2
|
+
|
|
3
|
+
# Zsh completion for quilltap
|
|
4
|
+
|
|
5
|
+
local ret=1
|
|
6
|
+
|
|
7
|
+
_quilltap() {
|
|
8
|
+
local -a subcommands
|
|
9
|
+
local -a global_options
|
|
10
|
+
|
|
11
|
+
global_options=(
|
|
12
|
+
'(-d --data-dir)'{-d,--data-dir}'[Data directory]:directory:_directories'
|
|
13
|
+
'(-i --instance)'{-i,--instance}'[Use a registered instance]:instance:_quilltap_instance_names'
|
|
14
|
+
'(-p --port)'{-p,--port}'[Port to listen on]:port:'
|
|
15
|
+
'(-o --open)'{-o,--open}'[Open browser after server starts]'
|
|
16
|
+
'(-v --version)'{-v,--version}'[Show version number]'
|
|
17
|
+
'(-h --help)'{-h,--help}'[Show help message]'
|
|
18
|
+
'--update[Force re-download of application files]'
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
subcommands=(
|
|
22
|
+
'db:Query encrypted databases'
|
|
23
|
+
'docs:Inspect, read, and export document mounts'
|
|
24
|
+
'themes:Manage theme bundles'
|
|
25
|
+
'instances:Register or inspect named Quilltap instances'
|
|
26
|
+
'memories:Search, browse, and graph memories'
|
|
27
|
+
'memory-diff:Dump existing memories and dry-run re-extraction'
|
|
28
|
+
'completion:Generate shell completion scripts'
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
_arguments -C \
|
|
32
|
+
'1: :->subcommand' \
|
|
33
|
+
"${global_options[@]}" \
|
|
34
|
+
'*::arg:->args'
|
|
35
|
+
|
|
36
|
+
case "$state" in
|
|
37
|
+
subcommand)
|
|
38
|
+
_describe 'command' subcommands
|
|
39
|
+
;;
|
|
40
|
+
args)
|
|
41
|
+
_quilltap_subcommand
|
|
42
|
+
;;
|
|
43
|
+
esac
|
|
44
|
+
|
|
45
|
+
return ret
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
_quilltap_subcommand() {
|
|
49
|
+
local subcommand="$words[1]"
|
|
50
|
+
|
|
51
|
+
case "$subcommand" in
|
|
52
|
+
db)
|
|
53
|
+
_quilltap_db
|
|
54
|
+
;;
|
|
55
|
+
docs)
|
|
56
|
+
_quilltap_docs
|
|
57
|
+
;;
|
|
58
|
+
themes)
|
|
59
|
+
_quilltap_themes
|
|
60
|
+
;;
|
|
61
|
+
instances)
|
|
62
|
+
_quilltap_instances
|
|
63
|
+
;;
|
|
64
|
+
memories)
|
|
65
|
+
_quilltap_memories
|
|
66
|
+
;;
|
|
67
|
+
memory-diff)
|
|
68
|
+
_quilltap_memory_diff
|
|
69
|
+
;;
|
|
70
|
+
completion)
|
|
71
|
+
_quilltap_completion
|
|
72
|
+
;;
|
|
73
|
+
esac
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
_quilltap_db() {
|
|
77
|
+
local -a subverbs
|
|
78
|
+
subverbs=(
|
|
79
|
+
'schema:Show database schema'
|
|
80
|
+
'find:Find entities by name'
|
|
81
|
+
'chats:Find chats'
|
|
82
|
+
'messages:Find messages in a chat'
|
|
83
|
+
'logs:Get LLM request logs'
|
|
84
|
+
'message:Get a single message'
|
|
85
|
+
'log:Get a single LLM log entry'
|
|
86
|
+
'memories:List memories for a character'
|
|
87
|
+
'optimize:Optimize database'
|
|
88
|
+
'backup:Backup database'
|
|
89
|
+
'integrity:Check database integrity'
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
_values 'db subcommand' $subverbs
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
_quilltap_docs() {
|
|
96
|
+
local -a subverbs
|
|
97
|
+
subverbs=(
|
|
98
|
+
'list:List all mount points'
|
|
99
|
+
'show:Details for one mount point'
|
|
100
|
+
'files:List files in a mount'
|
|
101
|
+
'ls:ls-style listing'
|
|
102
|
+
'dir:Directory listing'
|
|
103
|
+
'read:Print file contents'
|
|
104
|
+
'export:Export mount to directory'
|
|
105
|
+
'scan:Trigger rescan'
|
|
106
|
+
'find:Substring search'
|
|
107
|
+
'grep:Pattern search inside text'
|
|
108
|
+
'status:Per-mount status'
|
|
109
|
+
'reindex:Re-extract and re-chunk'
|
|
110
|
+
'embed:Enqueue embedding jobs'
|
|
111
|
+
'write:Write a file'
|
|
112
|
+
'delete:Delete a file'
|
|
113
|
+
'mkdir:Create folder'
|
|
114
|
+
'move:Move file'
|
|
115
|
+
'copy:Copy file'
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
_values 'docs subcommand' $subverbs
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
_quilltap_themes() {
|
|
122
|
+
local -a subverbs
|
|
123
|
+
subverbs=(
|
|
124
|
+
'list:List available themes'
|
|
125
|
+
'install:Install a theme'
|
|
126
|
+
'uninstall:Uninstall a theme'
|
|
127
|
+
'validate:Validate a theme bundle'
|
|
128
|
+
'export:Export a theme'
|
|
129
|
+
'create:Create a new theme'
|
|
130
|
+
'search:Search theme registries'
|
|
131
|
+
'update:Update installed themes'
|
|
132
|
+
'registry:Manage registries'
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
_values 'themes subcommand' $subverbs
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
_quilltap_instances() {
|
|
139
|
+
local -a subverbs
|
|
140
|
+
subverbs=(
|
|
141
|
+
'list:List registered instances'
|
|
142
|
+
'ls:List instances'
|
|
143
|
+
'show:Show instance details'
|
|
144
|
+
'path:Show instance path'
|
|
145
|
+
'where:Show instance path'
|
|
146
|
+
'add:Register a new instance'
|
|
147
|
+
'create:Register a new instance'
|
|
148
|
+
'remove:Unregister an instance'
|
|
149
|
+
'rm:Unregister an instance'
|
|
150
|
+
'delete:Unregister an instance'
|
|
151
|
+
'set-passphrase:Set instance passphrase'
|
|
152
|
+
'passphrase:Set instance passphrase'
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
_values 'instances subcommand' $subverbs
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
_quilltap_memories() {
|
|
159
|
+
local -a subverbs mem_opts
|
|
160
|
+
subverbs=(
|
|
161
|
+
'ls:List memories'
|
|
162
|
+
'find:Substring search'
|
|
163
|
+
'grep:Pattern search with snippets'
|
|
164
|
+
'show:Show full record'
|
|
165
|
+
'tree:ASCII walk of graph'
|
|
166
|
+
'status:Per-character rollup'
|
|
167
|
+
'validate:Health check'
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
mem_opts=(
|
|
171
|
+
'--character[Character name or id]'
|
|
172
|
+
'--about[Subject of memory]'
|
|
173
|
+
'--source[AUTO or MANUAL]'
|
|
174
|
+
'--chat[Chat id or title]'
|
|
175
|
+
'--project[Project name or id]'
|
|
176
|
+
'--since[Since timestamp]'
|
|
177
|
+
'--until[Until timestamp]'
|
|
178
|
+
'--min-importance[Minimum importance]'
|
|
179
|
+
'--min-reinforced[Minimum reinforcement]'
|
|
180
|
+
'--has-embedding[Has embedding]'
|
|
181
|
+
'--no-embedding[No embedding]'
|
|
182
|
+
'--sort[Sort field]'
|
|
183
|
+
'--limit[Result limit]'
|
|
184
|
+
'--json[JSON output]'
|
|
185
|
+
'--help[Show help]'
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
_values 'memories subcommand' $subverbs
|
|
189
|
+
_arguments $mem_opts
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
_quilltap_memory_diff() {
|
|
193
|
+
_arguments \
|
|
194
|
+
'(-h --help)'{-h,--help}'[Show help]' \
|
|
195
|
+
'(-i --instance)'{-i,--instance}'[Use instance]:instance:_quilltap_instance_names' \
|
|
196
|
+
'(-d --data-dir)'{-d,--data-dir}'[Data directory]:directory:_directories'
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
_quilltap_completion() {
|
|
200
|
+
_values 'shell' bash zsh fish
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
_quilltap_instance_names() {
|
|
204
|
+
local instances
|
|
205
|
+
instances=(${(f)"$(command quilltap instances list --names-only 2>/dev/null)"})
|
|
206
|
+
_values 'instance' $instances
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
_quilltap "$@"
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
function printCompletionHelp() {
|
|
7
|
+
console.log(`
|
|
8
|
+
Quilltap Shell Completion
|
|
9
|
+
|
|
10
|
+
Usage: quilltap completion <shell> [--help]
|
|
11
|
+
|
|
12
|
+
Supported shells:
|
|
13
|
+
bash Bash completion script
|
|
14
|
+
zsh Zsh completion script
|
|
15
|
+
fish Fish completion script
|
|
16
|
+
|
|
17
|
+
This command generates a shell completion script for the given shell.
|
|
18
|
+
To install:
|
|
19
|
+
|
|
20
|
+
Bash:
|
|
21
|
+
quilltap completion bash >> ~/.bashrc
|
|
22
|
+
|
|
23
|
+
Zsh:
|
|
24
|
+
mkdir -p ~/.zsh/completions
|
|
25
|
+
quilltap completion zsh > ~/.zsh/completions/_quilltap
|
|
26
|
+
# Then add to ~/.zshrc: fpath=(~/.zsh/completions $fpath)
|
|
27
|
+
|
|
28
|
+
Fish:
|
|
29
|
+
quilltap completion fish > ~/.config/fish/completions/quilltap.fish
|
|
30
|
+
|
|
31
|
+
Examples:
|
|
32
|
+
quilltap completion bash | bash -c 'source /dev/stdin' # Test in current shell
|
|
33
|
+
quilltap completion zsh # Print to stdout
|
|
34
|
+
quilltap completion fish > ~/completions.fish # Save to file
|
|
35
|
+
`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function completionCommand(args) {
|
|
39
|
+
if (args.length === 0 || args[0] === '-h' || args[0] === '--help') {
|
|
40
|
+
printCompletionHelp();
|
|
41
|
+
process.exit(args.length === 0 ? 1 : 0);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const shell = args[0];
|
|
45
|
+
|
|
46
|
+
switch (shell) {
|
|
47
|
+
case 'bash':
|
|
48
|
+
case 'zsh':
|
|
49
|
+
case 'fish':
|
|
50
|
+
break;
|
|
51
|
+
case '--help':
|
|
52
|
+
case '-h':
|
|
53
|
+
printCompletionHelp();
|
|
54
|
+
process.exit(0);
|
|
55
|
+
break;
|
|
56
|
+
default:
|
|
57
|
+
console.error(`Error: Unknown shell '${shell}'. Supported shells: bash, zsh, fish`);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Load the appropriate template file
|
|
62
|
+
const templatePath = path.join(__dirname, 'completion', `${shell}.template`);
|
|
63
|
+
let template;
|
|
64
|
+
try {
|
|
65
|
+
template = fs.readFileSync(templatePath, 'utf-8');
|
|
66
|
+
} catch (err) {
|
|
67
|
+
console.error(`Error: Could not load completion template for ${shell}: ${err.message}`);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Print the template to stdout
|
|
72
|
+
process.stdout.write(template);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
module.exports = {
|
|
76
|
+
completionCommand,
|
|
77
|
+
};
|