nw¶
Networka (nw)
A powerful multi-vendor CLI tool for automating network devices based on ssh protocol. Built with async/await support and type safety in mind.
QUICK START: nw run sw-acc1 '/system/clock/print' # Execute command nw run office_switches system_info # Run sequence on group
For detailed help on any command: nw <command> --help Default config directory: system app config (use --config to override)
Usage:
Options:
--version: Show version information-h, --help: Show this message and exit
Commands:
info: Show comprehensive information for...run: Execute a single command or a sequence on...upload: Upload a file to a device or to all...download: Download a file from a device or all...diff: Diff config, a command, or a sequence.cli: Open tmux with CLI panes for a device or...list: List network devices, groups, sequences,...config: Configuration management commandsbackup: Backup operations for network devicesfirmware: Firmware management operationsschema: JSON schema management commands
nw info¶
Show comprehensive information for devices, groups, or sequences.
Supports comma-separated device names, group names, and sequence names.
Examples: - nw info sw-acc1 # Show device info - nw info sw-acc1,sw-acc2 # Show multiple devices - nw info access_switches # Show group info - nw info system_info # Show sequence info (all vendors) - nw info system_info --vendor cisco_iosxe # Show vendor-specific commands - nw info sw-acc1,access_switches,health_check # Mixed types
Usage:
Arguments:
TARGETS: Comma-separated device/group/sequence names from configuration [required]
Options:
-c, --config PATH: Configuration directory or file path [default: /home/mischa/.config/networka]--vendor TEXT: Show vendor-specific commands for sequences (e.g., cisco_iosxe, mikrotik_routeros)-o, --output-mode [default|light|dark|no-color|raw|json]: Output decoration mode: default, light, dark, no-color, raw-v, --verbose: Enable verbose logging-i, --interactive-auth: Prompt for username and password interactively--help: Show this message and exit.
nw run¶
Execute a single command or a sequence on a device or a group.
Usage:
Arguments:
TARGET: Device/group name, comma-separated list, or IP addresses. For IPs use --platform to specify device type [required]COMMAND_OR_SEQUENCE: RouterOS command to execute or name of a configured sequence [required]
Options:
-c, --config PATH: Configuration directory or file path [default: /home/mischa/.config/networka]-v, --verbose: Enable verbose logging-s, --store-results: Store command results to files--results-dir TEXT: Override results directory-o, --output-mode [default|light|dark|no-color|raw|json]: Output decoration mode: default, light, dark, no-color, raw-i, --interactive-auth: Prompt for username and password interactively-p, --platform TEXT: Device type when using IP addresses (e.g., mikrotik_routeros). Note: This specifies the network driver type, not hardware platform.--port INTEGER: SSH port when using IP addresses (default: 22)-t, --transport TEXT: Transport type to use for connections (currently only scrapli is supported). Defaults to configuration or scrapli.--no-strict-host-key-checking: Disable strict SSH host key checking (insecure, use only in lab environments)--help: Show this message and exit.
nw upload¶
Upload a file to a device or to all devices in a group.
Usage:
Arguments:
<device|group>: Device or group name from configuration [required]LOCAL_FILE: Path to local file to upload [required]
Options:
-r, --remote-name TEXT: Remote filename (default: same as local)--verify / --no-verify: Verify upload by checking file exists [default: verify]--checksum-verify / --no-checksum-verify: Verify file integrity using checksums (uses config default if not specified) [default: no-checksum-verify]-j, --max-concurrent INTEGER: Maximum concurrent uploads when target is a group [default: 5]-c, --config PATH: Configuration file path [default: /home/mischa/.config/networka]-v, --verbose: Enable verbose output--help: Show this message and exit.
nw download¶
Download a file from a device or all devices in a group.
Usage:
Arguments:
<device|group>: Device or group name from configuration [required]REMOTE_FILE: Remote filename on the device (e.g. export.rsc) [required]LOCAL_PATH: Destination path. For groups, treated as a directory and files are saved under <local_path>/<device>/<remote_file> [required]
Options:
--delete-remote / --keep-remote: Delete remote file after successful download [default: keep-remote]--verify / --no-verify: Verify download by comparing file sizes [default: verify]-c, --config PATH: Configuration file path [default: /home/mischa/.config/networka]-v, --verbose: Enable verbose output--help: Show this message and exit.
nw diff¶
Diff config, a command, or a sequence.
Examples: - nw diff sw-acc1 config -b baseline/export_compact.txt - nw diff sw-acc1 "/system/resource/print" -b baseline/resource.txt - nw diff lab_devices system_info -b baseline_dir/ - nw diff sw-acc1,sw-acc2 "/system/resource/print" # device-to-device - nw diff sw-acc1,sw-acc2 config # device-to-device
Usage:
Arguments:
TARGET: Device/group name or comma-separated list (e.g. 'sw-1,lab_devices') [required]SUBJECT: Subject to diff: 'config' for /export compact, a RouterOS command starting with '/', or the name of a configured sequence. [required]
Options:
-b, --baseline PATH: Baseline file (for config/command) or directory (for sequence).--ignore TEXT: Regex to ignore lines; repeat for multiple patterns.--save-current PATH: Optional path to save the current fetched state (file or directory).-c, --config PATH: Configuration file path [default: /home/mischa/.config/networka]-o, --output-mode [default|light|dark|no-color|raw|json]: Output decoration mode: default, light, dark, no-color, raw-v, --verbose: Enable verbose logging-s, --store-results: Store diff outputs to files--results-dir TEXT: Override results directory--help: Show this message and exit.
nw cli¶
Open tmux with CLI panes for a device or group.
Synchronized typing is ENABLED by default - keystrokes go to all panes. Use --no-sync to disable at startup.
Quick controls: - Ctrl+b, z: Zoom/unzoom focused pane (exits/enters sync mode) - Ctrl+b + Arrow keys: Navigate panes - Click any pane to focus it - Ctrl+b, d: Detach session
When sync is on, all panes show red borders.
Usage:
Arguments:
TARGET: Comma-separated device/group names or IP addresses [required]
Options:
-c, --config PATH: Path to config dir or YAML [default: /home/mischa/.config/networka]--auth [key-first|key|password|interactive]: Authentication mode: key-first (default), key, password, interactive [default: key-first]--user TEXT: Override username for SSH--password TEXT: Override password for SSH--layout TEXT: tmux layout to use: tiled, even-horizontal, even-vertical, main-horizontal, main-vertical [default: tiled]--session-name TEXT: Custom session name--window-name TEXT: Custom window name--sync / --no-sync: Enable synchronized typing (default: on) [default: sync]--use-sshpass: Use sshpass (same as --auth password)--attach / --no-attach: Attach after creating [default: attach]-v, --verbose: Enable debug logging-p, --platform TEXT: Device type when using IP addresses (e.g., mikrotik_routeros). Note: This specifies the network driver type, not hardware platform.--port INTEGER: SSH port when using IP addresses (default: 22)-t, --transport TEXT: Transport type for connections (currently only scrapli is supported). Defaults to configuration or scrapli.--no-strict-host-key-checking: Disable strict SSH host key checking (insecure, use only in lab environments)--help: Show this message and exit.
nw list¶
List network devices, groups, sequences, and platform information
Usage:
Options:
--help: Show this message and exit.
Commands:
devices: List all configured network devices.groups: List all configured device groups and...sequences: List all available command sequences,...
nw list devices¶
List all configured network devices.
Usage:
Options:
-c, --config PATH: Configuration file path [default: /home/mischa/.config/networka]-o, --output-mode [default|light|dark|no-color|raw|json]: Output decoration mode: default, light, dark, no-color, raw-v, --verbose: Enable verbose logging--help: Show this message and exit.
nw list groups¶
List all configured device groups and their members.
Usage:
Options:
-c, --config PATH: Configuration file path [default: /home/mischa/.config/networka]-o, --output-mode [default|light|dark|no-color|raw|json]: Output decoration mode: default, light, dark, no-color, raw-v, --verbose: Show detailed information--help: Show this message and exit.
nw list sequences¶
List all available command sequences, optionally filtered by vendor or category.
Usage:
Options:
-c, --config PATH: Configuration file path [default: /home/mischa/.config/networka]-v, --vendor TEXT: Filter by vendor platform--category TEXT: Filter by sequence category-o, --output-mode [default|light|dark|no-color|raw|json]: Output decoration mode: default, light, dark, no-color, raw--verbose: Show detailed information--help: Show this message and exit.
nw config¶
Configuration management commands
Usage:
Options:
--help: Show this message and exit.
Commands:
init: Initialize a network toolkit configuration...validate: Validate the configuration file and show...supported-types: Show supported device types and platform...update: Update framework-provided configuration...
nw config init¶
Initialize a network toolkit configuration in OS-appropriate location.
Creates a complete starter configuration with: - .env file with credential templates - config.yml with core settings - devices/ with MikroTik and Cisco examples - groups/ with tag-based and explicit groups - sequences/ with global and vendor-specific sequences - JSON schemas for YAML editor validation (optional) - Shell completions (optional) - Additional predefined sequences from GitHub (optional)
Default locations by OS: - Linux: ~/.config/networka/ - macOS: ~/Library/Application Support/networka/ - Windows: %APPDATA%/networka/
The 'nw' command will automatically find configurations in these locations.
Usage:
Arguments:
[TARGET_DIR]: Directory to initialize (default: system config location for your OS)
Options:
-f, --force: Overwrite existing files-y, --yes: Non-interactive: accept defaults--dry-run: Show actions without writing changes--install-sequences / --no-install-sequences: Install additional predefined vendor sequences from GitHub--install-completions / --no-install-completions: Install shell completion scripts--shell TEXT: Shell for completions (bash or zsh)--activate-completions / --no-activate-completions: Activate completions by updating shell rc file--install-schemas / --no-install-schemas: Install JSON schemas for YAML editor validation and auto-completion-v, --verbose: Enable verbose logging--help: Show this message and exit.
nw config validate¶
Validate the configuration file and show any issues.
Usage:
Options:
-c, --config PATH: Configuration file path [default: /home/mischa/.config/networka]-o, --output-mode [default|light|dark|no-color|raw|json]: Output decoration mode: default, light, dark, no-color, raw-v, --verbose: Show detailed validation information--help: Show this message and exit.
nw config supported-types¶
Show supported device types and platform information.
Usage:
Options:
-v, --verbose: Show detailed information--help: Show this message and exit.
nw config update¶
Update framework-provided configuration files.
Updates framework-managed sequence files to the latest version while preserving user-created and modified files.
Protected files (never updated): - .env (credentials) - devices/* (user devices) - groups/* (user groups) - sequences/custom/* (user custom sequences)
Framework files (safe to update if unmodified): - sequences//common.yml (platform sequences) - sequences/sequences.yml (framework config) - schemas/ (JSON schemas)
Creates timestamped backup in ~/.config/networka/.backup/YYYYMMDD_HHMMSS/ before applying updates.
Manual rollback after an update: cp -r ~/.config/networka/.backup/20251016_153000/* ~/.config/networka/
List available backups: nw config update --list-backups
Usage:
Options:
-c, --config-dir PATH: Configuration directory to update--check: Check for updates without applying them--list-backups: List available backup timestamps--force: Update even user-modified framework files-y, --yes: Skip confirmation prompts-v, --verbose: Enable verbose logging--help: Show this message and exit.
nw backup¶
Backup operations for network devices
Usage:
Options:
--help: Show this message and exit.
Commands:
config: Backup device configuration.comprehensive: Perform comprehensive backup including...vendors: Show which vendors support backup operations.vendor-config: Create device configuration backup using...
nw backup config¶
Backup device configuration.
Performs a configuration backup for the specified device or group.
Usage:
Arguments:
TARGET_NAME: Device or group name [required]
Options:
--download / --no-download: Download created backup/export files after running the sequence [default: download]--delete-remote / --keep-remote: Delete remote backup/export files after successful download [default: keep-remote]-c, --config PATH: Configuration file path [default: /home/mischa/.config/networka]-v, --verbose: Enable verbose output--help: Show this message and exit.
nw backup comprehensive¶
Perform comprehensive backup including vendor-specific data.
Performs a comprehensive backup for the specified device or group, including vendor-specific configuration and operational data.
Usage:
Arguments:
TARGET_NAME: Device or group name [required]
Options:
--download / --no-download: Download created backup/export files after running the sequence [default: download]--delete-remote / --keep-remote: Delete remote backup/export files after successful download [default: keep-remote]-c, --config PATH: Configuration file path [default: /home/mischa/.config/networka]-v, --verbose: Enable verbose output--help: Show this message and exit.
nw backup vendors¶
Show which vendors support backup operations.
Lists all supported vendors and their backup operation capabilities.
Usage:
Options:
--help: Show this message and exit.
nw backup vendor-config¶
Create device configuration backup using vendor-specific platform methods.
Creates a text representation of the device configuration using platform-specific implementations rather than command sequences. This provides direct vendor API access for configuration export operations.
MikroTik RouterOS: Uses /export commands Cisco IOS/IOS-XE: Uses show running-config commands
Usage:
Arguments:
<device|group>: Device or group name from configuration [required]
Options:
--download / --no-download: Download created configuration backup files after running the sequence [default: download]--delete-remote / --keep-remote: Delete remote configuration backup files after successful download [default: keep-remote]-c, --config PATH: Configuration file path [default: /home/mischa/.config/networka]-v, --verbose: Enable verbose output--help: Show this message and exit.
nw firmware¶
Firmware management operations
Usage:
Options:
--help: Show this message and exit.
Commands:
upgrade: Upgrade firmware on network devices.downgrade: Downgrade firmware on network devices.bios: Upgrade BIOS on network devices.vendors: Show which vendors support firmware...
nw firmware upgrade¶
Upgrade firmware on network devices.
Uploads and installs firmware upgrade on the specified device or group.
Usage:
Arguments:
TARGET_NAME: Device or group name [required]FIRMWARE_FILE: Path to firmware file [required]
Options:
--precheck-sequence TEXT: Pre-check sequence name [default: pre_maintenance]--skip-precheck: Skip pre-check sequence-c, --config PATH: Configuration file path [default: /home/mischa/.config/networka]-v, --verbose: Enable verbose output--help: Show this message and exit.
nw firmware downgrade¶
Downgrade firmware on network devices.
Uploads and installs firmware downgrade on the specified device or group.
Usage:
Arguments:
TARGET_NAME: Device or group name [required]FIRMWARE_FILE: Path to firmware file [required]
Options:
--precheck-sequence TEXT: Pre-check sequence name [default: pre_maintenance]--skip-precheck: Skip pre-check sequence-c, --config PATH: Configuration file path [default: /home/mischa/.config/networka]-v, --verbose: Enable verbose output--help: Show this message and exit.
nw firmware bios¶
Upgrade BIOS on network devices.
Upgrades device BIOS/RouterBOOT using platform-specific implementations.
Usage:
Arguments:
TARGET_NAME: Device or group name [required]
Options:
--precheck-sequence TEXT: Pre-check sequence name [default: pre_maintenance]--skip-precheck: Skip pre-check sequence-c, --config PATH: Configuration file path [default: /home/mischa/.config/networka]-v, --verbose: Enable verbose output--help: Show this message and exit.
nw firmware vendors¶
Show which vendors support firmware operations.
Lists all supported vendors and their firmware operation capabilities.
Usage:
Options:
--help: Show this message and exit.
nw schema¶
JSON schema management commands
Usage:
Options:
--help: Show this message and exit.
Commands:
install: Update JSON schemas for YAML editor...info: Display JSON schema status.
nw schema install¶
Update JSON schemas for YAML editor validation.
Regenerates the JSON schema files used by VS Code and other YAML editors to provide validation and auto-completion for configuration files.
Creates/updates: - schemas/network-config.schema.json (full config) - schemas/device-config.schema.json (device collections) - schemas/groups-config.schema.json (group collections) - .vscode/settings.json (VS Code YAML validation)
Usage:
Options:
-v, --verbose--help: Show this message and exit.
nw schema info¶
Display JSON schema status.
Shows the status of JSON schema files used for YAML validation in editors like VS Code. These schemas provide auto-completion and error checking for network toolkit configuration files.
Usage:
Options:
-v, --verbose--help: Show this message and exit.