@nexagent-cli/cli 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +117 -9
- package/dist/commands/completion.d.ts +2 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +287 -0
- package/dist/commands/completion.js.map +1 -0
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +203 -7
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/server.js +1 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/config/loader.js +2 -2
- package/dist/config/loader.js.map +1 -1
- package/dist/db/database.js +96 -79
- package/dist/db/database.js.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/catalog.js +5 -5
- package/dist/mcp/catalog.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/installer.d.ts.map +1 -1
- package/dist/mcp/installer.js +13 -1
- package/dist/mcp/installer.js.map +1 -1
- package/dist/mcp/registry.d.ts +1 -1
- package/dist/mcp/registry.d.ts.map +1 -1
- package/dist/mcp/registry.js +8 -3
- package/dist/mcp/registry.js.map +1 -1
- package/dist/mcp/templates.d.ts +6 -0
- package/dist/mcp/templates.d.ts.map +1 -0
- package/dist/mcp/templates.js +185 -0
- package/dist/mcp/templates.js.map +1 -0
- package/dist/tools/shell-exec.d.ts.map +1 -1
- package/dist/tools/shell-exec.js +27 -1
- package/dist/tools/shell-exec.js.map +1 -1
- package/package.json +77 -76
package/README.md
CHANGED
|
@@ -8,8 +8,11 @@ NexAgent — a locally-runnable AI agent CLI with file editing, tool execution,
|
|
|
8
8
|
# Requires Node.js 22+
|
|
9
9
|
npm install -g @nexagent-cli/cli
|
|
10
10
|
|
|
11
|
-
#
|
|
12
|
-
nexagent
|
|
11
|
+
# First-run wizard (interactive setup)
|
|
12
|
+
nexagent chat
|
|
13
|
+
|
|
14
|
+
# Or set your API key manually
|
|
15
|
+
nexagent config api-key openai
|
|
13
16
|
|
|
14
17
|
# Start an interactive chat session
|
|
15
18
|
nexagent chat
|
|
@@ -18,22 +21,127 @@ nexagent chat
|
|
|
18
21
|
nexagent run "Refactor src/utils.ts to use async/await"
|
|
19
22
|
```
|
|
20
23
|
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
### Via npm (recommended for developers)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install -g @nexagent-cli/cli
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Via Go Launcher (recommended for end users)
|
|
33
|
+
|
|
34
|
+
Download the latest binary for your platform from [GitHub Releases](https://github.com/nexagent/cli/releases):
|
|
35
|
+
|
|
36
|
+
| Platform | Download |
|
|
37
|
+
|----------|----------|
|
|
38
|
+
| Windows AMD64 | `nexagent-v0.5.0-windows-amd64.zip` |
|
|
39
|
+
| macOS AMD64 | `nexagent-v0.5.0-darwin-amd64` |
|
|
40
|
+
| macOS ARM64 | `nexagent-v0.5.0-darwin-arm64` |
|
|
41
|
+
| Linux AMD64 | `nexagent-v0.5.0-linux-amd64` |
|
|
42
|
+
| Linux ARM64 | `nexagent-v0.5.0-linux-arm64` |
|
|
43
|
+
|
|
44
|
+
Extract and run:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Windows
|
|
48
|
+
nexagent.exe --version
|
|
49
|
+
|
|
50
|
+
# macOS / Linux
|
|
51
|
+
chmod +x nexagent
|
|
52
|
+
./nexagent --version
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
> **Prerequisite:** Node.js v22+ must be installed. The Go launcher will verify this on startup.
|
|
56
|
+
|
|
57
|
+
### Shell Completion
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Bash
|
|
61
|
+
eval "$(nexagent completion bash)"
|
|
62
|
+
|
|
63
|
+
# Zsh
|
|
64
|
+
eval "$(nexagent completion zsh)"
|
|
65
|
+
|
|
66
|
+
# Fish
|
|
67
|
+
nexagent completion fish > ~/.config/fish/completions/nexagent.fish
|
|
68
|
+
|
|
69
|
+
# PowerShell
|
|
70
|
+
nexagent completion powershell | Out-String | Invoke-Expression
|
|
71
|
+
|
|
72
|
+
# Show setup instructions for all shells
|
|
73
|
+
nexagent completion install
|
|
74
|
+
```
|
|
75
|
+
|
|
21
76
|
## Commands
|
|
22
77
|
|
|
78
|
+
| Command | Alias | Description |
|
|
79
|
+
|---------|-------|-------------|
|
|
80
|
+
| `nexagent chat` | `c` | Interactive chat with the agent |
|
|
81
|
+
| `nexagent run <prompt>` | `r` | Single-shot prompt execution |
|
|
82
|
+
| `nexagent memory` | `mem` | Manage agent memory blocks |
|
|
83
|
+
| `nexagent session` | `sess` | Manage chat sessions |
|
|
84
|
+
| `nexagent agent` | | Manage agent profiles |
|
|
85
|
+
| `nexagent config` | | Manage configuration |
|
|
86
|
+
| `nexagent models` | | List available LLM models |
|
|
87
|
+
| `nexagent update` | | Update to latest version |
|
|
88
|
+
| `nexagent changelog` | | Show release notes |
|
|
89
|
+
| `nexagent doctor` | | Diagnose installation health |
|
|
90
|
+
| `nexagent server` | `srv` | Manage proxy gateway |
|
|
91
|
+
| `nexagent dashboard` | `dash` | Start web dashboard |
|
|
92
|
+
| `nexagent mcp` | | Manage MCP tools |
|
|
93
|
+
| `nexagent completion <shell>` | | Generate shell completion script |
|
|
94
|
+
|
|
95
|
+
## Global Flags
|
|
96
|
+
|
|
97
|
+
| Flag | Description |
|
|
98
|
+
|------|-------------|
|
|
99
|
+
| `--no-color` | Disable colour output |
|
|
100
|
+
| `--json` | Output machine-readable JSON |
|
|
101
|
+
| `--debug` | Enable verbose debug logging |
|
|
102
|
+
| `--data-dir <path>` | Override agent data directory |
|
|
103
|
+
| `-h, --help` | Show help |
|
|
104
|
+
| `-v, --version` | Show version |
|
|
105
|
+
|
|
106
|
+
## Quick Commands (in chat)
|
|
107
|
+
|
|
108
|
+
During an interactive chat session, type:
|
|
109
|
+
|
|
23
110
|
| Command | Description |
|
|
24
111
|
|---------|-------------|
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
27
|
-
| `
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
112
|
+
| `/help` | Show available quick commands |
|
|
113
|
+
| `/models` | List available models |
|
|
114
|
+
| `/config` | Show current configuration |
|
|
115
|
+
| `/memory` | Show memory blocks |
|
|
116
|
+
| `/session` | Show session stats |
|
|
117
|
+
| `/undo` | Remove last turn |
|
|
118
|
+
| `/cost` | Show session cost |
|
|
119
|
+
| `/status` | Check proxy gateway status |
|
|
120
|
+
| `/clear` | Clear chat history |
|
|
121
|
+
| `/compact` | Summarize and compact context |
|
|
122
|
+
| `/subagent <persona> <task>` | Spawn a subagent |
|
|
123
|
+
| `/exit` | End session and exit |
|
|
32
124
|
|
|
33
125
|
## Requirements
|
|
34
126
|
|
|
35
127
|
- **Node.js** ≥ 22
|
|
36
128
|
- An API key for at least one provider: OpenAI, Anthropic, Google, or Ollama
|
|
129
|
+
- (Optional) **Go** 1.23+ — only needed if building the launcher from source
|
|
130
|
+
|
|
131
|
+
## Safety
|
|
132
|
+
|
|
133
|
+
NexAgent includes an 8-check Safety Gate for all tool executions:
|
|
134
|
+
|
|
135
|
+
1. Tool exists and is enabled
|
|
136
|
+
2. Required parameters present
|
|
137
|
+
3. Workspace scope enforced (no path traversal)
|
|
138
|
+
4. Global shell blocklist (`rm -rf /`, fork bombs, etc.)
|
|
139
|
+
5. Risk level vs safety mode (`strict` / `standard` / `permissive`)
|
|
140
|
+
6. Loop guard (max 8 tool calls per turn)
|
|
141
|
+
7. Rate limit (max 60 calls per minute)
|
|
142
|
+
8. Audit logging for `shell_exec`
|
|
143
|
+
|
|
144
|
+
See [`docs/shell-exec-safety.md`](../../docs/shell-exec-safety.md) for full details.
|
|
37
145
|
|
|
38
146
|
## License
|
|
39
147
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AA2QA,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BhE"}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Command: nexagent completion — generate shell completion scripts
|
|
3
|
+
// Supports: bash, zsh, fish, powershell
|
|
4
|
+
// ============================================================
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
const BASH_COMPLETION = `# NexAgent CLI bash completion
|
|
7
|
+
# Source this file: eval "$(nexagent completion bash)"
|
|
8
|
+
# Or install to: /etc/bash_completion.d/ or ~/.bash_completion
|
|
9
|
+
|
|
10
|
+
_nexagent_completion() {
|
|
11
|
+
local cur prev opts
|
|
12
|
+
COMPREPLY=()
|
|
13
|
+
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
14
|
+
prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
15
|
+
|
|
16
|
+
local commands="chat run memory session agent config models update changelog doctor server dashboard mcp completion"
|
|
17
|
+
local chat_opts="--agent --model --provider --memory --subagents --safety --max-turns --cwd --resume --json --debug --data-dir --no-color"
|
|
18
|
+
local run_opts="--agent --model --max-turns --cwd --dry-run --json --debug --data-dir --no-color"
|
|
19
|
+
local global_opts="--help --version --no-color --json --debug --data-dir"
|
|
20
|
+
|
|
21
|
+
if [[ \${cur} == -* ]]; then
|
|
22
|
+
COMPREPLY=( $(compgen -W "\${global_opts}" -- \${cur}) )
|
|
23
|
+
return 0
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
if [[ \${COMP_CWORD} -eq 1 ]]; then
|
|
27
|
+
COMPREPLY=( $(compgen -W "\${commands}" -- \${cur}) )
|
|
28
|
+
return 0
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
case "\${prev}" in
|
|
32
|
+
chat)
|
|
33
|
+
COMPREPLY=( $(compgen -W "\${chat_opts}" -- \${cur}) )
|
|
34
|
+
return 0
|
|
35
|
+
;;
|
|
36
|
+
run)
|
|
37
|
+
COMPREPLY=( $(compgen -W "\${run_opts}" -- \${cur}) )
|
|
38
|
+
return 0
|
|
39
|
+
;;
|
|
40
|
+
--provider)
|
|
41
|
+
COMPREPLY=( $(compgen -W "openai anthropic google ollama proxy kimi" -- \${cur}) )
|
|
42
|
+
return 0
|
|
43
|
+
;;
|
|
44
|
+
--safety)
|
|
45
|
+
COMPREPLY=( $(compgen -W "strict standard permissive" -- \${cur}) )
|
|
46
|
+
return 0
|
|
47
|
+
;;
|
|
48
|
+
--model)
|
|
49
|
+
COMPREPLY=( $(compgen -W "gpt-4o gpt-4o-mini gpt-4.1 claude-3-5-sonnet claude-3-7-sonnet gemini-1.5-pro" -- \${cur}) )
|
|
50
|
+
return 0
|
|
51
|
+
;;
|
|
52
|
+
esac
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
complete -F _nexagent_completion nexagent
|
|
56
|
+
`;
|
|
57
|
+
const ZSH_COMPLETION = `#compdef nexagent
|
|
58
|
+
# NexAgent CLI zsh completion
|
|
59
|
+
# Install: copy to a directory in $fpath (e.g., /usr/local/share/zsh/site-functions/)
|
|
60
|
+
|
|
61
|
+
_nexagent() {
|
|
62
|
+
local curcontext="$curcontext" state line
|
|
63
|
+
typeset -A opt_args
|
|
64
|
+
|
|
65
|
+
local -a commands
|
|
66
|
+
commands=(
|
|
67
|
+
'chat:Start an interactive chat session'
|
|
68
|
+
'run:Run a single prompt non-interactively'
|
|
69
|
+
'memory:Manage agent memory blocks'
|
|
70
|
+
'session:Manage chat sessions'
|
|
71
|
+
'agent:Manage agents'
|
|
72
|
+
'config:Manage configuration'
|
|
73
|
+
'models:List available models'
|
|
74
|
+
'update:Update to latest version'
|
|
75
|
+
'changelog:Show release notes'
|
|
76
|
+
'doctor:Diagnose installation health'
|
|
77
|
+
'server:Manage proxy gateway'
|
|
78
|
+
'dashboard:Start web dashboard'
|
|
79
|
+
'mcp:Manage MCP tools'
|
|
80
|
+
'completion:Generate shell completion'
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
_arguments -C \\
|
|
84
|
+
'(-h --help)'{-h,--help}'[Show help]' \\
|
|
85
|
+
'(-v --version)'{-v,--version}'[Show version]' \\
|
|
86
|
+
'--no-color[Disable colour output]' \\
|
|
87
|
+
'--json[Output machine-readable JSON]' \\
|
|
88
|
+
'--debug[Enable verbose debug logging]' \\
|
|
89
|
+
'--data-dir[Override agent data directory]:directory:_directories' \\
|
|
90
|
+
'1: :->command' \\
|
|
91
|
+
'*: :->args'
|
|
92
|
+
|
|
93
|
+
case "$state" in
|
|
94
|
+
command)
|
|
95
|
+
_describe -t commands 'nexagent commands' commands
|
|
96
|
+
;;
|
|
97
|
+
args)
|
|
98
|
+
case "$line[1]" in
|
|
99
|
+
chat)
|
|
100
|
+
_arguments \\
|
|
101
|
+
'(-a --agent)'{-a,--agent}'[Agent name]:agent:' \\
|
|
102
|
+
'(-m --model)'{-m,--model}'[Model override]:model:' \\
|
|
103
|
+
'(-p --provider)'{-p,--provider}'[Provider]:provider:(openai anthropic google ollama proxy kimi)' \\
|
|
104
|
+
'--safety[Safety level]:level:(strict standard permissive)' \\
|
|
105
|
+
'--max-turns[Max turns]:number:' \\
|
|
106
|
+
'--cwd[Working directory]:directory:_directories' \\
|
|
107
|
+
'--resume[Resume session]:session:' \\
|
|
108
|
+
'--no-memory[Disable memory]' \\
|
|
109
|
+
'--no-subagents[Disable subagents]'
|
|
110
|
+
;;
|
|
111
|
+
run)
|
|
112
|
+
_arguments \\
|
|
113
|
+
'(-a --agent)'{-a,--agent}'[Agent name]:agent:' \\
|
|
114
|
+
'(-m --model)'{-m,--model}'[Model override]:model:' \\
|
|
115
|
+
'--max-turns[Max turns]:number:' \\
|
|
116
|
+
'--cwd[Working directory]:directory:_directories' \\
|
|
117
|
+
'--dry-run[Show what tools would do]' \\
|
|
118
|
+
'--json[Output as JSON]'
|
|
119
|
+
;;
|
|
120
|
+
esac
|
|
121
|
+
;;
|
|
122
|
+
esac
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
compdef _nexagent nexagent
|
|
126
|
+
`;
|
|
127
|
+
const FISH_COMPLETION = `# NexAgent CLI fish completion
|
|
128
|
+
# Install: copy to ~/.config/fish/completions/nexagent.fish
|
|
129
|
+
|
|
130
|
+
complete -c nexagent -f
|
|
131
|
+
|
|
132
|
+
# Global options
|
|
133
|
+
complete -c nexagent -s h -l help -d "Show help"
|
|
134
|
+
complete -c nexagent -s v -l version -d "Show version"
|
|
135
|
+
complete -c nexagent -l no-color -d "Disable colour output"
|
|
136
|
+
complete -c nexagent -l json -d "Output machine-readable JSON"
|
|
137
|
+
complete -c nexagent -l debug -d "Enable verbose debug logging"
|
|
138
|
+
complete -c nexagent -l data-dir -d "Override agent data directory"
|
|
139
|
+
|
|
140
|
+
# Commands
|
|
141
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "chat" -d "Start an interactive chat session"
|
|
142
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "run" -d "Run a single prompt non-interactively"
|
|
143
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "memory" -d "Manage agent memory blocks"
|
|
144
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "session" -d "Manage chat sessions"
|
|
145
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "agent" -d "Manage agents"
|
|
146
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "config" -d "Manage configuration"
|
|
147
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "models" -d "List available models"
|
|
148
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "update" -d "Update to latest version"
|
|
149
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "changelog" -d "Show release notes"
|
|
150
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "doctor" -d "Diagnose installation health"
|
|
151
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "server" -d "Manage proxy gateway"
|
|
152
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "dashboard" -d "Start web dashboard"
|
|
153
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "mcp" -d "Manage MCP tools"
|
|
154
|
+
complete -c nexagent -n "not __fish_seen_subcommand_from $commands" -a "completion" -d "Generate shell completion"
|
|
155
|
+
|
|
156
|
+
# Chat options
|
|
157
|
+
complete -c nexagent -n "__fish_seen_subcommand_from chat" -s a -l agent -d "Agent name"
|
|
158
|
+
complete -c nexagent -n "__fish_seen_subcommand_from chat" -s m -l model -d "Model override"
|
|
159
|
+
complete -c nexagent -n "__fish_seen_subcommand_from chat" -s p -l provider -d "Provider" -a "openai anthropic google ollama proxy kimi"
|
|
160
|
+
complete -c nexagent -n "__fish_seen_subcommand_from chat" -l safety -d "Safety level" -a "strict standard permissive"
|
|
161
|
+
complete -c nexagent -n "__fish_seen_subcommand_from chat" -l max-turns -d "Max turns"
|
|
162
|
+
complete -c nexagent -n "__fish_seen_subcommand_from chat" -l cwd -d "Working directory"
|
|
163
|
+
|
|
164
|
+
# Run options
|
|
165
|
+
complete -c nexagent -n "__fish_seen_subcommand_from run" -s a -l agent -d "Agent name"
|
|
166
|
+
complete -c nexagent -n "__fish_seen_subcommand_from run" -s m -l model -d "Model override"
|
|
167
|
+
complete -c nexagent -n "__fish_seen_subcommand_from run" -l max-turns -d "Max turns"
|
|
168
|
+
complete -c nexagent -n "__fish_seen_subcommand_from run" -l dry-run -d "Show what tools would do"
|
|
169
|
+
`;
|
|
170
|
+
const PWSH_COMPLETION = `# NexAgent CLI PowerShell completion
|
|
171
|
+
# Install: Add this to your $PROFILE
|
|
172
|
+
# nexagent completion powershell | Out-String | Invoke-Expression
|
|
173
|
+
# Or save to a file and dot-source it.
|
|
174
|
+
|
|
175
|
+
Register-ArgumentCompleter -Native -CommandName nexagent -ScriptBlock {
|
|
176
|
+
param($wordToComplete, $commandAst, $cursorPosition)
|
|
177
|
+
|
|
178
|
+
$commands = @('chat','run','memory','session','agent','config','models','update','changelog','doctor','server','dashboard','mcp','completion')
|
|
179
|
+
$globalOpts = @('--help','--version','--no-color','--json','--debug','--data-dir')
|
|
180
|
+
$providers = @('openai','anthropic','google','ollama','proxy','kimi')
|
|
181
|
+
$safetyLevels = @('strict','standard','permissive')
|
|
182
|
+
|
|
183
|
+
$tokens = $commandAst.CommandElements | ForEach-Object { $_.ToString() }
|
|
184
|
+
$cmd = $tokens[1]
|
|
185
|
+
|
|
186
|
+
# Complete first-level command
|
|
187
|
+
if ($tokens.Count -eq 1 -or ($tokens.Count -eq 2 -and $wordToComplete -notmatch '^-')) {
|
|
188
|
+
$commands | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
|
189
|
+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
|
190
|
+
}
|
|
191
|
+
return
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
# Complete global flags
|
|
195
|
+
if ($wordToComplete -match '^-') {
|
|
196
|
+
$globalOpts | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
|
197
|
+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
|
198
|
+
}
|
|
199
|
+
return
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
# Sub-command specific completions
|
|
203
|
+
switch ($cmd) {
|
|
204
|
+
'chat' {
|
|
205
|
+
@('--agent','--model','--provider','--safety','--max-turns','--cwd','--resume','--no-memory','--no-subagents') |
|
|
206
|
+
Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
|
207
|
+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
'run' {
|
|
211
|
+
@('--agent','--model','--max-turns','--cwd','--dry-run','--json') |
|
|
212
|
+
Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
|
213
|
+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
'config' {
|
|
217
|
+
@('show','set','api-key') |
|
|
218
|
+
Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
|
219
|
+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
'server' {
|
|
223
|
+
@('start','stop','status') |
|
|
224
|
+
Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
|
225
|
+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
'memory' {
|
|
229
|
+
@('list','show','edit','delete','export','import') |
|
|
230
|
+
Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
|
231
|
+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
'session' {
|
|
235
|
+
@('list','show','delete','export','import') |
|
|
236
|
+
Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
|
237
|
+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
'agent' {
|
|
241
|
+
@('list','create','delete') |
|
|
242
|
+
Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
|
243
|
+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
'mcp' {
|
|
247
|
+
@('list','search','install','uninstall','installed','run') |
|
|
248
|
+
Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
|
249
|
+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
`;
|
|
255
|
+
const SHELL_SCRIPTS = {
|
|
256
|
+
bash: BASH_COMPLETION,
|
|
257
|
+
zsh: ZSH_COMPLETION,
|
|
258
|
+
fish: FISH_COMPLETION,
|
|
259
|
+
powershell: PWSH_COMPLETION,
|
|
260
|
+
};
|
|
261
|
+
export async function runCompletion(shell) {
|
|
262
|
+
const normalized = shell.toLowerCase().trim();
|
|
263
|
+
if (normalized === 'install') {
|
|
264
|
+
console.log(chalk.bold('\n Shell Completion Installation\n'));
|
|
265
|
+
console.log(' Bash:');
|
|
266
|
+
console.log(' eval "$(nexagent completion bash)"');
|
|
267
|
+
console.log(' # Or permanently: nexagent completion bash > ~/.bash_completion\n');
|
|
268
|
+
console.log(' Zsh:');
|
|
269
|
+
console.log(' eval "$(nexagent completion zsh)"');
|
|
270
|
+
console.log(' # Or permanently: nexagent completion zsh > /usr/local/share/zsh/site-functions/_nexagent\n');
|
|
271
|
+
console.log(' Fish:');
|
|
272
|
+
console.log(' nexagent completion fish > ~/.config/fish/completions/nexagent.fish\n');
|
|
273
|
+
console.log(' PowerShell:');
|
|
274
|
+
console.log(' nexagent completion powershell | Out-String | Invoke-Expression');
|
|
275
|
+
console.log(' # Or add to $PROFILE\n');
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
const script = SHELL_SCRIPTS[normalized];
|
|
279
|
+
if (!script) {
|
|
280
|
+
console.error(chalk.red(`\n Unknown shell: "\${shell}"`));
|
|
281
|
+
console.error(chalk.dim(' Supported shells: bash, zsh, fish, powershell'));
|
|
282
|
+
console.error(chalk.dim(' Run "nexagent completion install" for setup instructions.\n'));
|
|
283
|
+
process.exit(1);
|
|
284
|
+
}
|
|
285
|
+
console.log(script);
|
|
286
|
+
}
|
|
287
|
+
//# sourceMappingURL=completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,mEAAmE;AACnE,wCAAwC;AACxC,+DAA+D;AAE/D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDvB,CAAC;AAEF,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqEtB,CAAC;AAEF,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CvB,CAAC;AAEF,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoFvB,CAAC;AAEF,MAAM,aAAa,GAA2B;IAC5C,IAAI,EAAE,eAAe;IACrB,GAAG,EAAE,cAAc;IACnB,IAAI,EAAE,eAAe;IACrB,UAAU,EAAE,eAAe;CAC5B,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAa;IAC/C,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IAE9C,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC,CAAC;QAC/D,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,uEAAuE,CAAC,CAAC;QACrF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,iGAAiG,CAAC,CAAC;QAC/G,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;QACzF,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,qEAAqE,CAAC,CAAC;QACnF,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QAC1C,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC,CAAC;QAC3D,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC,CAAC;QAC5E,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC,CAAC;QAC1F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/commands/dashboard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/commands/dashboard.ts"],"names":[],"mappings":"AAiBA,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,wBAAsB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgexE"}
|