Skip to content

Commit b95ff85

Browse files
author
Super User
committed
feat: add one-flag ai mode and darwin nocgo build compatibility
1 parent 93a12ea commit b95ff85

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ An optional AI decision assistant is available. It generates a Markdown report a
7878

7979
Supported OpenAI-compatible providers: `kimi / openai / deepseek / qwen / glm / openrouter / custom`
8080

81+
- One-flag AI mode (recommended): `-ai` (same as `-ai-enable -ai-poc-select`)
8182
- Enable AI: `-ai-enable`
8283
- AI-only mode: `-ai-only`
8384
- Enable AI POC selection (xray+nuclei): `-ai-poc-select`
@@ -96,11 +97,11 @@ Environment variable mapping:
9697
- `glm`: `ZHIPUAI_API_KEY`
9798
- `openrouter`: `OPENROUTER_API_KEY`
9899

99-
Example (Kimi):
100+
Example (Kimi, one-flag AI decision):
100101

101102
```bash
102103
export KIMI_API_KEY="your_kimi_key"
103-
./VscanPlus -host https://example.com -p 80,443,8080 -o result.txt -ai-enable -ai-provider kimi -ai-output ai-decision.md
104+
./VscanPlus -host https://example.com -p 80,443,8080 -o result.txt -ai
104105
```
105106

106107
Example (OpenAI):

‎README_zh.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ sangfor
8282

8383
支持主流 OpenAI 兼容接口:`kimi / openai / deepseek / qwen / glm / openrouter / custom`
8484

85+
- 一键 AI 模式(推荐):`-ai`(等价于 `-ai-enable -ai-poc-select`)
8586
- 启用 AI:`-ai-enable`
8687
- 仅跑 AI(不扫描):`-ai-only`
8788
- 启用 AI 选 POC(xray+nuclei):`-ai-poc-select`
@@ -100,11 +101,11 @@ sangfor
100101
- `glm`: `ZHIPUAI_API_KEY`
101102
- `openrouter`: `OPENROUTER_API_KEY`
102103

103-
示例(Kimi):
104+
示例(Kimi,单参数 AI 决策):
104105

105106
```bash
106107
export KIMI_API_KEY="your_kimi_key"
107-
./VscanPlus -host https://example.com -p 80,443,8080 -o result.txt -ai-enable -ai-provider kimi -ai-output ai-decision.md
108+
./VscanPlus -host https://example.com -p 80,443,8080 -o result.txt -ai
108109
```
109110

110111
示例(DeepSeek):

‎pkg/naabu/v2/pkg/runner/options.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type Options struct {
2727
InterfacesList bool // InterfacesList show interfaces list
2828
AIEnable bool // Enable Kimi AI assistant for decision support
2929
AIOnly bool // Run AI assistant only (skip scan)
30+
AIAuto bool // One-flag AI mode (enable decision + poc selection)
3031
AIPOCSelect bool // Enable AI-driven poc selection (xray+nuclei)
3132
NucleiExternal bool // Use external nuclei binary for latest template compatibility
3233
NucleiBin string // External nuclei binary path
@@ -149,6 +150,7 @@ func ParseOptions() *Options {
149150
)
150151

151152
flagSet.CreateGroup("ai", "AI Assistant",
153+
flagSet.BoolVar(&options.AIAuto, "ai", false, "one-flag AI mode (equivalent to --ai-enable --ai-poc-select)"),
152154
flagSet.BoolVar(&options.AIEnable, "ai-enable", false, "enable AI decision and recon assistant"),
153155
flagSet.BoolVar(&options.AIOnly, "ai-only", false, "run AI assistant only and skip scanning"),
154156
flagSet.BoolVar(&options.AIPOCSelect, "ai-poc-select", false, "enable AI to select extra xray+nuclei poc targets"),
@@ -168,6 +170,10 @@ func ParseOptions() *Options {
168170

169171
// Check if stdin pipe was given
170172
options.Stdin = fileutil.HasStdin()
173+
if options.AIAuto {
174+
options.AIEnable = true
175+
options.AIPOCSelect = true
176+
}
171177
resolveAIProviderDefaults(options)
172178

173179
// Read the inputs and configure the logging

‎pkg/naabu/v2/pkg/scan/scan_unix.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build linux || darwin
1+
//go:build linux || (darwin && cgo)
22

33
package scan
44

0 commit comments

Comments
 (0)