Network Tool is a CLI utility for generating vendor-specific network configuration commands from structured input. It is designed to reduce manual command creation errors by validating input and automatically replacing variables in predefined command templates.
The tool is currently at version 0.5 and is under active development.
The primary goal of this project is to learn Go and software development in general. In addition, it aims to provide a flexible, vendor-agnostic way to generate validated network configuration commands from structured input.
- Command-line interface for generating network commands
- Customizable command schema per vendor
- Validation of custom command definitions
- Automatic replacement of input keys in command templates
- Grouped command output per vendor
- Palo Alto Networks firewalls
- Cisco switches
- NetBox (planned, not yet implemented)
- Vendor-specific commands are defined using a customizable schema.
- The user is prompted for required input values.
- Inputs are validated against command requirements.
- Keys are replaced in command templates.
- Commands are output and grouped by vendor.
commands for: paloalto
set network interface ethernet1/1 layer3 ip 10.0.0.1/24
set zone trust network layer3 ethernet1/1
commands for: cisco
interface GigabitEthernet0/1
ip address 10.0.0.1 255.255.255.0
- CLI tool that returns commands (v0.1)
- Customizable command schema/system (v0.2)
- Validation of custom commands (v0.3)
- Automatic replacement of keys in commands (v0.4)
- Program functioning (v0.5)
-
Tests for all functions (v0.6)
-
All v0 goals complete, and tested (v1.0)
-
additional input methods (v1.1)
- JSON
- CLI parameters
-
Auto-generate input based on customizable standards (v1.2)
-
Query NetBox for existing network and device information (v1.3)
-
Authentication (v2.0-beta)
- API token access
-
Write to NetBox (v2.1-beta)
-
RBAC (v2.2-beta)
- Read existing
- Update commands
-
Expose API and containerize for web deployment (v2.0)
-
GUI frontend (v2.1)
-
Storage of device data (v3.0-beta)
-
Run commands against provided systems automatically (v3.0)
- NetBox integration is planned but not implemented as of v0.5.
- Go 1.25.4 or newer
go build .go run .Command schemas are defined using YAML configuration files. These schemas describe vendors, device types, and ordered command definitions grouped by feature and CRUD action.
Multiple configuration files may be used. If the same vendor name is defined more than once, the last loaded definition wins.
Each vendor must follow this structure:
<vendor_name>:
devicetype: <type>
commands:
- feature: <feature_name>
actions:
<action>: [ <command>, <command>, ... ]-
vendor_name (required)
- Logical vendor identifier (e.g.
paloalto,cisco,juniper) - Vendor order does not matter
- Logical vendor identifier (e.g.
-
devicetype (required) Must be one of:
firewallswitchapidhcp
-
commands (required)
- An ordered list of command features
- Feature order is preserved exactly as written and determines output order
-
feature (required)
- Logical grouping of commands (e.g.
interface,vlan,dhcprelay)
- Logical grouping of commands (e.g.
-
actions (required)
- CRUD-style actions supported by this feature
- Only one action is selected per program run
Allowed actions:
createreadupdatedelete
Each action must contain a list of one or more command strings. Lists must be used even if only a single command exists.
Commands may contain placeholder keys that are replaced at runtime using user-provided input.
Allowed placeholder keys:
interfaceipaddressvlanidvlannamezonecidrmask
Placeholder format:
{{key}}
Example:
set interface {{interface}} ip {{ipaddress}}
- Invalid CRUD action names are ignored with a warning
- Invalid placeholder keys cause configuration validation to fail
- Features with no valid actions are ignored
- Interactive mode only
- The program prompts for every allowed placeholder key on each run
- After selecting a CRUD action, all commands for that action are output per vendor