Skip to content

Add completion spec: nmap#263

Merged
lucieleblanc merged 1 commit into
mainfrom
auto/command-spec-nmap
Apr 10, 2026
Merged

Add completion spec: nmap#263
lucieleblanc merged 1 commit into
mainfrom
auto/command-spec-nmap

Conversation

@lucieleblanc
Copy link
Copy Markdown
Contributor

Summary

Adds command completion support for nmap (network mapper/scanner).

Changes

JSON Spec (command-signatures/json/nmap.json)

Comprehensive completion spec covering ~80 options across all nmap categories:

  • Target specification: -iL, -iR, --exclude, --excludefile
  • Host discovery: -sL, -sn, -Pn, -PS/-PA/-PU/-PY, -PE/-PP/-PM, -PO, -PR, --traceroute, -n/-R, --dns-servers, etc.
  • Scan techniques: -sS/-sT/-sA/-sW/-sM (TCP), -sU (UDP), -sN/-sF/-sX, -sY/-sZ (SCTP), -sI, -sO, -b, --scanflags
  • Port specification: -p, --exclude-ports, -F, -r, --top-ports, --port-ratio
  • Service/version detection: -sV, --version-intensity, --version-light, --version-all, --allports
  • OS detection: -O, --osscan-limit, --osscan-guess/--fuzzy, --max-os-tries
  • NSE scripting: -sC, --script, --script-args, --script-help, --script-updatedb
  • Timing/performance: -T (with named templates), --min/max-hostgroup, --min/max-parallelism, RTT timeouts, --min/max-rate, --nsock-engine
  • Firewall evasion: -f, --mtu, -D, -S, -e, -g/--source-port, --proxies, --ip-options, --ttl, --spoof-mac, --badsum
  • Output: -oN/-oX/-oS/-oG/-oA, -v, -d, --reason, --open, --resume, --stylesheet
  • Misc: -6, -A, --datadir, --send-eth/--send-ip, --privileged/--unprivileged, -V/--version, -h/--help

Generators (command-signatures/src/generators/nmap.rs)

  • network_interfaces (for -e flag): Cross-platform — uses /sys/class/net on Linux, ifconfig -l on macOS, falls back to parsing ifconfig output
  • nse_scripts (for --script and --script-help flags): Lists .nse files from common nmap data directories (/usr/share/nmap/scripts, /usr/local/share/nmap/scripts, /opt/homebrew/share/nmap/scripts) plus built-in script categories (all, auth, broadcast, brute, default, discovery, dos, exploit, external, fuzzer, intrusive, malware, safe, version, vuln)

Static Suggestions

  • Timing templates (-T): 0-5 with named aliases (paranoid, sneaky, polite, normal, aggressive, insane)
  • Version intensity (--version-intensity): 0-9
  • Debug levels (-d): 0-9
  • IP options (--ip-options): S, R, L, T, U
  • nsock engines (--nsock-engine): epoll, kqueue, poll, select

Validation

  • npm run format
  • script/presubmit passes (54 tests, 0 failures, clippy clean) ✅

Conversation: https://staging.warp.dev/conversation/016e0996-5b38-4536-9d06-ca243a821844
This PR was generated with Oz.

Adds command completion support for nmap (network mapper/scanner) with:
- Full JSON spec covering ~80 options across all categories: target specification,
  host discovery, scan techniques, port specification, service/version detection,
  OS detection, NSE scripting, timing/performance, firewall evasion, output, and misc.
- network_interfaces generator for -e flag (cross-platform: Linux /sys/class/net,
  macOS ifconfig -l, fallback to ifconfig parsing)
- nse_scripts generator for --script and --script-help flags (lists .nse files from
  common nmap data directories plus built-in script categories)
- Static suggestions for timing templates (-T), version intensity, debug levels,
  IP options, and nsock engines

Co-Authored-By: Oz <oz-agent@warp.dev>
Copy link
Copy Markdown
Contributor Author

Generator Verification Screenshots

network_interfaces generator (nmap -e <Tab>)

Shows network interface names (eth0, lo) with "Network interface" descriptions:

network_interfaces generator

nse_scripts generator (nmap --script <Tab>)

Shows NSE script names (acarsd-info, address-info, afp-brute, etc.) with "NSE script" descriptions:

nse_scripts generator

Both generators produce meaningful completions in a local Warp build.

@lucieleblanc lucieleblanc marked this pull request as ready for review April 10, 2026 16:33
@linear
Copy link
Copy Markdown

linear Bot commented Apr 10, 2026

APP-3962 [Auto] Add nmap completions

Add command completions for nmap, the most widely used network scanner and security auditing tool.

Fish shell reference implementation: https://github.com/fish-shell/fish-shell/blob/master/share/completions/nmap.fish

@lucieleblanc lucieleblanc merged commit 0bc963d into main Apr 10, 2026
3 checks passed
@lucieleblanc lucieleblanc deleted the auto/command-spec-nmap branch April 10, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants