Skip to main content

gns3ctl

gns3ctl drives a GNS3 server from the command line via its REST API. It covers the day-to-day things you'd otherwise have to click through in the GUI: list / open / close projects, see and operate on nodes (start / stop / reload / suspend), inspect links, templates and computes.

Command Purpose
gns3ctl Main CLI with subcommands (projects, nodes, links, …)
gns3ctl-setup Interactive first-run: writes GNS3_* exports to your shell rc

Install

pip install gns3ctl

Configure

Quickest: gns3ctl-setup

gns3ctl-setup

Prompts for URL, user, password, default project; writes an idempotent export block into ~/.zshrc / ~/.bashrc / ~/.bash_profile.

Env vars

Variable Meaning
GNS3_URL Base URL, e.g. http://localhost:3080
GNS3_USER Basic-auth username (omit for open servers)
GNS3_PASSWORD Basic-auth password
GNS3_API_VERSION v3 (default; JWT bearer) or v2 (HTTP Basic Auth)
GNS3_VERIFY_SSL false to skip TLS verification
GNS3_DEFAULT_PROJECT Id or name used when --project is omitted

YAML (fallback)

A stub is written to ~/.local/etc/gns3ctl/config.yaml on first run if GNS3_URL isn't exported. Env vars always win.

Usage

# Test credentials (defaults to admin/admin if unset)
gns3ctl login test

# Server info
gns3ctl version

# Projects
gns3ctl projects list
gns3ctl projects open  my-lab
gns3ctl projects close my-lab

# Nodes (requires a project — --project or GNS3_DEFAULT_PROJECT)
gns3ctl --project my-lab nodes list
gns3ctl --project my-lab nodes inspect R1    # full server-side record
gns3ctl --project my-lab nodes start R1
gns3ctl --project my-lab nodes stop  --all
gns3ctl --project my-lab nodes reload R1
gns3ctl --project my-lab nodes suspend R1

# Links / templates / computes
gns3ctl --project my-lab links list
gns3ctl templates list
gns3ctl computes list

# JSON output, overriding the server URL
gns3ctl --url http://gns3.lab:3080 --json projects list

# Self-signed GNS3 server
gns3ctl --insecure projects list

# Dry-run: print the curl command(s) instead of hitting the server.
# For v3 it emits the token-exchange recipe plus the actual call(s):
gns3ctl --curl --project my-lab nodes start R1
#   # GNS3 v3 uses JWT bearer tokens — fetch one first:
#   TOKEN=$(curl -s -X POST -H 'Content-Type: application/json' \
#     -d '{"username":"admin","password":"admin"}' \
#     http://localhost:3080/v3/access/users/authenticate | jq -r .access_token)
#   # then:
#   curl -X POST -H "Authorization: Bearer $TOKEN" \
#     http://localhost:3080/v3/projects/my-lab/nodes/R1/start

## Auth

GNS3 2.x uses HTTP Basic Auth (what `curl -u user:pass` sends).
GNS3 3.x uses a JWT bearer token — `gns3ctl` POSTs username/password to
`/v3/access/users/authenticate` and uses the returned `access_token`
as `Authorization: Bearer …` on subsequent calls. Defaults are
`admin / admin` and `v3`; override with env vars.

Project and node refs accept either the id or the name — gns3ctl resolves the name against GET /projects or GET /nodes and uses the id for the subsequent call.

Exit codes

Code Meaning
0 Success
1 GNS3 server returned an error (auth, 4xx, 5xx, etc.)
2 Usage / configuration problem

License

MIT

Metadata

Release files for gns3ctl 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gns3ctl 0.1.6
File Size Uploaded Provenance Actions
gns3ctl-0.1.6.tar.gz 16.3 kB Without provenance Details for gns3ctl-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gns3ctl 0.1.6
File Interpreter ABI Platform Actions
gns3ctl-0.1.6-py3-none-any.whl Python 3 none any Details for gns3ctl-0.1.6-py3-none-any.whl

Total release size: 32.9 kB

Release files / gns3ctl-0.1.6.tar.gz

Download URL gns3ctl-0.1.6.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4f2e6b87aeeec384a52b0a4cfacc5c12a1e3f8b8911371491e09b595b4fb1122
BLAKE2b-256 checksum
How to use checksums
2e48d9b0b47e2c3ff0ee0fad3d2098318a6e34b647757c605b8f36d0cfd64776
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release files / gns3ctl-0.1.6-py3-none-any.whl

Download URL gns3ctl-0.1.6-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
874cf2c534a111a3f7688507e26235ab5c99088cf20a52770d605c44db827246
BLAKE2b-256 checksum
How to use checksums
22717d579b2e113ae1be487bab488ab2c9a3225f1c1819faea25ff034fef805c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Security for gns3ctl 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page