gatenet.cli.commands package

Submodules

gatenet.cli.commands.dns module

dns.py — Implements the ‘dns’ CLI command for DNS lookups.

gatenet.cli.commands.dns.cmd_dns(args)[source]

DNS lookup and reverse lookup CLI command.

Displays DNS resolution results for a domain or IP in the selected output format.

Parameters:

args (argparse.Namespace) – query (str): Domain or IP to resolve. output_format (str, optional): Output style. One of ‘table’, ‘plain’, or ‘json’. color (bool, optional): Enable colorized output. Default is True. verbosity (str or int, optional): Verbosity level. One of ‘debug’, ‘info’, 0, or 1. Default is 1. server (str, optional): Custom DNS server to use.

Example

gatenet dns google.com --output json --color false --server 1.1.1.1
Returns:

None

gatenet.cli.commands.hotspot module

hotspot.py — Implements the ‘hotspot’ CLI command for Wi-Fi hotspot management.

gatenet.cli.commands.hotspot.cmd_hotspot(args)[source]

Wi-Fi hotspot management CLI command.

Provides functionality to create, start, stop, and manage Wi-Fi access points. Supports various security configurations and device monitoring.

Parameters:

args (argparse.Namespace) – action (str): Action to perform (‘start’, ‘stop’, ‘status’, ‘devices’, ‘generate-password’) ssid (str, optional): SSID name for the hotspot password (str, optional): Password for the hotspot (if secured) interface (str, optional): Network interface to use (default: wlan0) ip_range (str, optional): IP range for DHCP (default: 192.168.4.0/24) gateway (str, optional): Gateway IP (default: 192.168.4.1) channel (int, optional): Wi-Fi channel (default: 6) security (str, optional): Security type (open, wpa, wpa2, wpa3) hidden (bool, optional): Create hidden SSID output (str, optional): Output format (table, json, plain)

Example

gatenet hotspot start --ssid MyHotspot --password mypass123 --security wpa2
gatenet hotspot status --output json
gatenet hotspot devices --output table
gatenet hotspot stop
gatenet hotspot generate-password --length 16
Returns:

None

gatenet.cli.commands.iface module

iface.py — Implements the ‘iface’ CLI command for network interface scanning.

gatenet.cli.commands.iface.cmd_iface(args)[source]

Network interface diagnostics CLI command.

Lists all network interfaces with IP and MAC addresses in the selected output format.

Parameters:

args (argparse.Namespace) – output_format (str, optional): Output style. One of ‘table’, ‘plain’, or ‘json’. color (bool, optional): Enable colorized output. Default is True. verbosity (str or int, optional): Verbosity level. One of ‘debug’, ‘info’, 0, or 1. Default is ‘info’. default (str, optional): Show this interface first if present.

Example

gatenet iface --output json --color false --verbosity debug --default eth0
Returns:

None

gatenet.cli.commands.ping module

ping.py — Implements the ‘ping’ CLI command for connectivity tests.

gatenet.cli.commands.ping.cmd_ping(args)[source]

Ping connectivity test CLI command.

Pings the specified host and displays latency statistics in the selected output format.

Parameters:

args (argparse.Namespace) – host (str): Host to ping. output_format (str, optional): Output style. One of ‘table’, ‘plain’, or ‘json’. color (bool, optional): Enable colorized output. Default is True. verbosity (str or int, optional): Verbosity level. One of ‘debug’, ‘info’, 0, or 1. Default is ‘info’. count (int, optional): Number of pings to send.

Example

gatenet ping 8.8.8.8 --count 4 --output json --color false
Returns:

None

gatenet.cli.commands.ports module

ports.py — Implements the ‘ports’ CLI command for port scanning.

gatenet.cli.commands.ports.cmd_ports(args)[source]

Port scanning CLI command.

Scans the specified ports on the target host and displays results in the selected output format.

Parameters:

args (argparse.Namespace) – host (str): Host to scan. ports (list[int], optional): List of ports to scan. Default: [22, 80, 443]. output_format (str, optional): Output style. One of ‘table’, ‘plain’, or ‘json’. color (bool, optional): Enable colorized output. Default is True. verbosity (str or int, optional): Verbosity level. One of ‘debug’, ‘info’, 0, or 1. Default is ‘info’.

Example

gatenet ports 127.0.0.1 --ports 22 80 443 --output plain --color false
Returns:

None

gatenet.cli.commands.trace module

trace.py — Implements the ‘trace’ CLI command for traceroute.

gatenet.cli.commands.trace.cmd_trace(args)[source]

Traceroute connectivity test CLI command.

Runs a traceroute to the specified host and displays hop information in the selected output format.

Parameters:

args (argparse.Namespace) – host (str): Host to traceroute. output_format (str, optional): Output style. One of ‘table’, ‘plain’, or ‘json’. color (bool, optional): Enable colorized output. Default is True. verbosity (str or int, optional): Verbosity level. One of ‘debug’, ‘info’, 0, or 1. Default is ‘info’. max_hops (int, optional): Maximum hops to trace.

Example

gatenet trace google.com --output plain --color false --max-hops 20
Returns:

None

gatenet.cli.commands.trace.print_trace_json(hops, color, console)[source]
gatenet.cli.commands.trace.print_trace_plain(hops)[source]
gatenet.cli.commands.trace.print_trace_table(hops, color, console, host)[source]

gatenet.cli.commands.wifi module

wifi.py — Implements the ‘wifi’ CLI command for Wi-Fi SSID scanning.

gatenet.cli.commands.wifi.cmd_wifi(args)[source]

Wi-Fi SSID scanning CLI command.

Scans for available Wi-Fi networks and displays SSID, signal, and security in the selected output format.

Parameters:

args (argparse.Namespace) – output_format (str, optional): Output style. One of ‘table’, ‘plain’, or ‘json’. color (bool, optional): Enable colorized output. Default is True. verbosity (str or int, optional): Verbosity level. One of ‘debug’, ‘info’, 0, or 1. Default is ‘info’. interface (str, optional): WiFi interface to scan.

Example

gatenet wifi --output plain --color false --interface en0
Returns:

None

Module contents

CLI command modules for Gatenet.

This module contains all CLI command implementations for the Gatenet toolkit.

gatenet.cli.commands.cmd_dns(args)[source]

DNS lookup and reverse lookup CLI command.

Displays DNS resolution results for a domain or IP in the selected output format.

Parameters:

args (argparse.Namespace) – query (str): Domain or IP to resolve. output_format (str, optional): Output style. One of ‘table’, ‘plain’, or ‘json’. color (bool, optional): Enable colorized output. Default is True. verbosity (str or int, optional): Verbosity level. One of ‘debug’, ‘info’, 0, or 1. Default is 1. server (str, optional): Custom DNS server to use.

Example

gatenet dns google.com --output json --color false --server 1.1.1.1
Returns:

None

gatenet.cli.commands.cmd_hotspot(args)[source]

Wi-Fi hotspot management CLI command.

Provides functionality to create, start, stop, and manage Wi-Fi access points. Supports various security configurations and device monitoring.

Parameters:

args (argparse.Namespace) – action (str): Action to perform (‘start’, ‘stop’, ‘status’, ‘devices’, ‘generate-password’) ssid (str, optional): SSID name for the hotspot password (str, optional): Password for the hotspot (if secured) interface (str, optional): Network interface to use (default: wlan0) ip_range (str, optional): IP range for DHCP (default: 192.168.4.0/24) gateway (str, optional): Gateway IP (default: 192.168.4.1) channel (int, optional): Wi-Fi channel (default: 6) security (str, optional): Security type (open, wpa, wpa2, wpa3) hidden (bool, optional): Create hidden SSID output (str, optional): Output format (table, json, plain)

Example

gatenet hotspot start --ssid MyHotspot --password mypass123 --security wpa2
gatenet hotspot status --output json
gatenet hotspot devices --output table
gatenet hotspot stop
gatenet hotspot generate-password --length 16
Returns:

None

gatenet.cli.commands.cmd_iface(args)[source]

Network interface diagnostics CLI command.

Lists all network interfaces with IP and MAC addresses in the selected output format.

Parameters:

args (argparse.Namespace) – output_format (str, optional): Output style. One of ‘table’, ‘plain’, or ‘json’. color (bool, optional): Enable colorized output. Default is True. verbosity (str or int, optional): Verbosity level. One of ‘debug’, ‘info’, 0, or 1. Default is ‘info’. default (str, optional): Show this interface first if present.

Example

gatenet iface --output json --color false --verbosity debug --default eth0
Returns:

None

gatenet.cli.commands.cmd_ping(args)[source]

Ping connectivity test CLI command.

Pings the specified host and displays latency statistics in the selected output format.

Parameters:

args (argparse.Namespace) – host (str): Host to ping. output_format (str, optional): Output style. One of ‘table’, ‘plain’, or ‘json’. color (bool, optional): Enable colorized output. Default is True. verbosity (str or int, optional): Verbosity level. One of ‘debug’, ‘info’, 0, or 1. Default is ‘info’. count (int, optional): Number of pings to send.

Example

gatenet ping 8.8.8.8 --count 4 --output json --color false
Returns:

None

gatenet.cli.commands.cmd_ports(args)[source]

Port scanning CLI command.

Scans the specified ports on the target host and displays results in the selected output format.

Parameters:

args (argparse.Namespace) – host (str): Host to scan. ports (list[int], optional): List of ports to scan. Default: [22, 80, 443]. output_format (str, optional): Output style. One of ‘table’, ‘plain’, or ‘json’. color (bool, optional): Enable colorized output. Default is True. verbosity (str or int, optional): Verbosity level. One of ‘debug’, ‘info’, 0, or 1. Default is ‘info’.

Example

gatenet ports 127.0.0.1 --ports 22 80 443 --output plain --color false
Returns:

None

gatenet.cli.commands.cmd_trace(args)[source]

Traceroute connectivity test CLI command.

Runs a traceroute to the specified host and displays hop information in the selected output format.

Parameters:

args (argparse.Namespace) – host (str): Host to traceroute. output_format (str, optional): Output style. One of ‘table’, ‘plain’, or ‘json’. color (bool, optional): Enable colorized output. Default is True. verbosity (str or int, optional): Verbosity level. One of ‘debug’, ‘info’, 0, or 1. Default is ‘info’. max_hops (int, optional): Maximum hops to trace.

Example

gatenet trace google.com --output plain --color false --max-hops 20
Returns:

None

gatenet.cli.commands.cmd_wifi(args)[source]

Wi-Fi SSID scanning CLI command.

Scans for available Wi-Fi networks and displays SSID, signal, and security in the selected output format.

Parameters:

args (argparse.Namespace) – output_format (str, optional): Output style. One of ‘table’, ‘plain’, or ‘json’. color (bool, optional): Enable colorized output. Default is True. verbosity (str or int, optional): Verbosity level. One of ‘debug’, ‘info’, 0, or 1. Default is ‘info’. interface (str, optional): WiFi interface to scan.

Example

gatenet wifi --output plain --color false --interface en0
Returns:

None