How sub-limal/ncas works
1. Repository shape
This is a very small, script-centric Python project. The runtime logic appears to live primarily in a single module, ncas.py, with packaging metadata in setup.py, pyproject.toml, and requirements.txt. There are no separate app/server/data directories, which suggests a monolithic CLI utility rather than a layered service.
2. Primary purpose
NCAS is a Windows-only Wi-Fi profile automation tool built as a wrapper over the native netsh command. Its job is to query, export, import, delete, and present saved WLAN profiles and passwords that already exist on the local machine.
3. Core execution model
The application supports two entry paths:
- Direct CLI invocation for one-off commands and automation
- Interactive menu mode when run without arguments
There is also a “continue” mode that executes supplied arguments and then drops into the interactive interface, so the CLI and menu are both front doors into the same underlying operations.
4. Main functional subsystems
The README implies these internal feature clusters:
- Profile enumeration and password retrieval: list saved SSIDs and reveal clear-text passwords
- Profile export/import: back up and restore Wi-Fi profiles, especially via Windows XML profile format
- Profile deletion: remove saved WLAN profiles from the system
- Reporting and diagnostics: generate WLAN reports and inspect wireless interfaces
- Presentation utilities: table output, colored terminal output, banner, simple UI mode
- Sharing helpers: QR code generation and SVG saving
- Signal monitoring: display signal strength/intensity in real time
5. Data flow around netsh
The central data source is the local Windows WLAN subsystem accessed through netsh. Most commands likely follow a pattern of:
1. Invoke netsh for profile/interface/report information
2. Parse the command output
3. Transform it into displayable records or exportable files
4. Optionally call a second netsh command for export/import/delete operations
This makes netsh the main external dependency and the architectural boundary between the script and the operating system.
6. Persistence and file outputs
NCAS writes results to files in several formats:
- XML for native Windows profile export/import
- TXT, CSV, JSON for broader sharing/reporting
- SVG for saved QR codes
The repository also mentions an output directory that can be cleared, so the script likely maintains a local workspace for generated artifacts rather than a database or service-backed store.
7. Presentation layer
The tool’s user-facing layer is terminal-based. It includes:
- colored console output
- a tabular display mode
- an ASCII/banner startup mode
- a simplified interface option
- optional console clearing between prompts
This indicates that formatting and UX are handled inside the same script, not delegated to a separate frontend.
8. Command dispatch architecture
The command-line flags in the README map to discrete actions, so ncas.py likely contains an argument parser plus a dispatcher that routes each flag to a specific handler. The handlers appear to be organized by operation type rather than by object model, consistent with a utility tool optimized for command coverage.
9. Platform boundary
The project is explicitly Windows-specific. The functionality depends on Windows networking behavior and the netsh WLAN command set, so the architecture is tightly coupled to the host OS. The README’s compatibility note for Windows 10/11 is an architectural constraint, not just a test result.
10. Packaging and distribution
The presence of setup.py, pyproject.toml, and release instructions indicates the repo is packaged both for:
- installation as a Python package via pip
- distribution as a standalone executable
The compiled executable is a packaging artifact, not a separate codebase.
11. Dependencies and tooling
requirements.txt defines runtime dependencies, while pyproject.toml and setup.py support packaging/build metadata. The README mentions auto-py-to-exe for executable creation, which matters to the architecture only as a distribution/build-time tool, not as a runtime dependency.
12. Likely architectural diagram boundaries
If you were drawing this system, the key boxes would be:
- User / CLI terminal
- NCAS script (ncas.py)
- Windows netsh / WLAN subsystem
- Local output files for exports, QR codes, and reports
The main arrows are from user input into ncas.py, from ncas.py to netsh, and from ncas.py to generated files or formatted terminal output.
Main entry points: ncas.py Command router · pyproject.toml Package metadata · setup.py Setup script · requirements.txt Requirements
Components 15
Runtime
Interactive and command-driven Wi-Fi profile automation
- User · Runs commands or uses the interactive menu
- CLI entry · Direct command-line invocation and continue mode
ncas.py - Menu mode · Interactive prompt flow when started without arguments
ncas.py - Command router · Parses flags and routes to the matching action handler
ncas.py - Profile ops · Enumerates, reveals, exports, imports, and deletes saved WLAN profiles
ncas.py - Reports · Generates WLAN reports and inspects wireless interfaces
ncas.py - Signal monitor · Displays signal strength and wireless status in real time
ncas.py - Sharing tools · Creates QR codes and saves shareable artifacts
ncas.py - Presentation · Banner, colors, tables, and simplified console formatting
ncas.py - Output files · Writes XML, TXT, CSV, JSON, and SVG artifacts to local storage
- netsh · Windows WLAN command boundary used for query and profile operations
- Local workspace · Generated files and cleanup target for exported artifacts
Distribution
Packaging and build metadata for installation and executable release
- Package metadata · Project metadata for pip installation and release builds
pyproject.toml - Setup script · Packaging entry used for installation and distribution
setup.py - Requirements · Runtime dependency specification
requirements.txt
Connections 20
- User → CLI entry: invokes · Direct command-line use starts the script
- User → Menu mode: opens · Running without arguments enters the interactive interface
- CLI entry → Command router: parses · CLI arguments are routed to handlers
- Menu mode → Command router: reuses · Menu actions call the same underlying dispatcher
- Command router → Profile ops: routes · Profile listing, export, import, delete, and password retrieval
- Command router → Reports: routes · Report generation and interface inspection
- Command router → Signal monitor: routes · Real-time signal display
- Command router → Sharing tools: routes · QR code and sharing helpers
- Command router → Presentation: formats · Common output formatting and console UX
- Profile ops → netsh: queries · Reads WLAN profiles and passwords from Windows
- Profile ops → Output files: writes · Exports profiles and serialized results
- Reports → netsh: queries · Collects WLAN reports and interface data
- Reports → Output files: writes · Persists report artifacts
- Signal monitor → netsh: reads · Polls wireless status and signal strength
- Sharing tools → Output files: writes · Saves QR/SVG sharing artifacts
- Presentation → Local workspace: clears · Console cleanup and output directory cleanup behavior
- Output files → Local workspace: stored in · Generated files land in the local workspace
- Package metadata → Setup script: supports · Build metadata complements the setup script
- Package metadata → Requirements: declares · Project dependencies are declared separately
- Setup script → CLI entry: packages · The script is packaged as the installable entry point