{"id":14044667,"url":"https://github.com/AndrianBdn/wg-cmd","last_synced_at":"2025-07-27T17:31:47.741Z","repository":{"id":65917234,"uuid":"587747920","full_name":"AndrianBdn/wg-cmd","owner":"AndrianBdn","description":"TUI for managing WireGuard configuration files","archived":false,"fork":false,"pushed_at":"2024-08-17T06:03:36.000Z","size":155,"stargazers_count":146,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-08-18T06:29:37.143Z","etag":null,"topics":["linux-server","tui","vpn-server","wireguard"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrianBdn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-11T13:49:17.000Z","updated_at":"2024-08-17T06:00:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"cfa85d4e-18c4-484a-a204-b648a9837113","html_url":"https://github.com/AndrianBdn/wg-cmd","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrianBdn%2Fwg-cmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrianBdn%2Fwg-cmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrianBdn%2Fwg-cmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrianBdn%2Fwg-cmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrianBdn","download_url":"https://codeload.github.com/AndrianBdn/wg-cmd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227822316,"owners_count":17825022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux-server","tui","vpn-server","wireguard"],"created_at":"2024-08-12T09:02:46.371Z","updated_at":"2024-12-02T23:31:30.465Z","avatar_url":"https://github.com/AndrianBdn.png","language":"Go","funding_links":[],"categories":["Applications","\u003ca name=\"text-processing\"\u003e\u003c/a\u003eText processing","Projects"],"sub_categories":["Cyber Security (_built with Bubble Tea_)","User Interface"],"readme":"# WG Commander \n\naka \"wg-cmd\" — TUI for managing WireGuard configuration files\n\n\u003ca href=\"https://github.com/andrianbdn/wg-cmd/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/andrianbdn/wg-cmd\" /\u003e\u003c/a\u003e\n\u003ca href=\"./LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/andrianbdn/wg-cmd\" /\u003e\u003c/a\u003e\n\u003ca href=\"./go.mod\"\u003e\u003cimg src=\"https://img.shields.io/github/go-mod/go-version/andrianbdn/wg-cmd\" /\u003e\u003c/a\u003e\n[![Go Report Card](https://goreportcard.com/badge/github.com/andrianbdn/wg-cmd)](https://goreportcard.com/report/github.com/andrianbdn/wg-cmd)\n\n![screenshot](https://user-images.githubusercontent.com/994900/218720566-e5b3ab22-d7fc-4df7-a777-ad9b6280ada8.png)\n\n# Features\n- no need for a browser or HTTP port - works in the terminal, over SSH too\n- has a nice Setup Wizard\n- text-based user interface for managing peers\n- view QR code in the terminal\n- automatically configures sysctl, systemd, NAT\n\n## Current Limitations\n- supports simple client-server WireGuard setup\n- mostly for Linux (assumes iptables, systemd, sysctl are available) — see [Other OS](#other-os-besides-linux) section\n- can't manage existing WireGuard configuration (but you can create new WireGuard interfaces on the same host)\n\n# Installation \n\nMake sure you have WireGuard and iptables installed \n(`apt install wireguard-tools` in Ubuntu / Debian, `dnf install wireguard-tools iptables` in Rocky/Alma 9). \n\nTo download using curl run:\n```shell\n# for x86_64 \ncurl -SL https://github.com/andrianbdn/wg-cmd/releases/download/v0.1.6/wg-cmd-0.1.6-linux-amd64 -o /usr/local/bin/wg-cmd\n\n# for arm64 \ncurl -SL https://github.com/andrianbdn/wg-cmd/releases/download/v0.1.6/wg-cmd-0.1.6-linux-arm64 -o /usr/local/bin/wg-cmd\n```\n\nSet proper permissions and run the tool: \n```\nchmod 755 /usr/local/bin/wg-cmd\nwg-cmd\n```\n\nIf you don't have `/usr/local/bin` in $PATH you will have to\nrun `/usr/local/bin/wg-cmd` command using the full path.\n\nWG Commander requires root permissions to automatically tune sysctl, to create systemd units and to write to /etc/wireguard.\n\n# Usage \n\nOn first run WG Commander will show the setup wizard, that allows to configure new WireGuard interface interactively.\n\nOn subsequent runs (if wizard was successful) it will just display management TUI.\n\nNote regarding the QR code: some devices (Android?) may require a higher quality QR code. WG Commander will automatically increase quality when you make Terminal window resolution larger (smaller font, larger window).\n\n## Advanced usage\n\nYou can run WG Commander as a non-root user if you change permissions on \n/etc/wireguard and configure sysctl/systemd manually.\n\nWG Commander keeps its own UI config in `~/.config/wg-cmd/wg-cmd.toml`\n\nThe most important options are:\n```toml\nWireguardDir = \"/etc/wireguard\"\n# directory for WireGuard configuration files \n\nDatabaseDir = \"/etc/wireguard\"\n# directory for WG Commander database files (wgc-\u003cinterface-name\u003e)\n```\n\nYou can change these options to point to directories that you have write access to.\n\n### Special options \n\nRun `wg-cmd new` to start the wizard for new interface configuration.\n\nRun `wg-cmd \u003cwg-interface\u003e` to switch to specific interface (must be created before with wg-cmd).\n\nRun `wg-cmd \u003cwg-interface\u003e make` to generate Wireguard configuration without showing UI.\n\n### Configuration \n\nWG Commander uses directories as its \"database\". \nIt stores the interface configuration in /etc/wireguard/wgc-\u003cinterface-name\u003e directory. \n\nThe configuration is stored using [TOML](https://toml.io) file format.\n\nMost configuration keys are similar to WireGuard ones. \n\n#### server configuration (0001-server.toml)\nSome keys in this configuration file will actually be used for generating \nclient configuration files. \n\n`ClientRoute` - AllowedIPs for client config\n\n`ClientDNS` - DNS configuration value for all clients\n\n`ClientServerEndpoint` - Endpoint for client config\n\n`ClientPersistentKeepalive` - PersistentKeepalive for client config \n\n`MTU` - MTU for the server and client (0 — make WireGuard choose)\n\n#### client configuration (nnnn-%client%.toml)\n\n`ClientRoute` - completely overrides the `ClientRoute` from the server config\n\n`AddServerRoute` - adds additional network to AllowedIPs for the client on the server side (useful \nwhen you want to route traffic to one client to another client's network through the server)\n\n`MTU` - Override server MTU with a different value for this client. Set to -1 to omit MTU from this WireGuard client config.\n\n`DNS` - Override server `ClientDNS` setting for all clients. Specify a comma separated IP list. \nSet to `no` or `none` to omit DNS from this WireGuard client config.\n\nClient configuration files contain `PrivateKey` field. \nIf you find it unacceptable, you can remove it from the file after you exported \nconfiguration (or QR code) to the client.\n\n### Other OS besides Linux\n\nWG Commander is designed to work on Linux, because it uses procfs, systemd, iptables, sysctl. \nHowever, it is written in plain Go, so it should work on any OS that Go supports.\n\n- You will need to compile binary yourself.\n- Set the environment variable `WG_CMD_NO_DEPS` to 1 to disable any Linux-specific checks on start. \n- Edit 0001-server.toml and set your OS commands in PostUp4/PostUp6/PostDown4/PostDown6 fields.\n- You will need to reload WireGuard configuration: manually when you change something\nor monitor /etc/wireguard/wg*.conf files for changes and reload WireGuard automatically.\n\nPRs are welcome to add support for other OSes.\n\n### Running in Docker \n\nAlthough it is possible, it is not recommended to run WG Commander in Docker. \n\nThe Setup Wizard will not work properly, because it needs to create systemd units and modify sysctl.\n\n\n### Uninstall \n\nTo uninstall WG Commander, just remove the binary from /usr/local/bin/wg-cmd. \nYou can also remove directories /etc/wireguard/wgc-* and ~/.config/wg-cmd\n\nIf you have created systemd units, you will need to remove them manually.\n\nBelow is an example of how to remove WG Commander managed interface wg7 \n(change it to whatever interface you need to delete):\n\n```sh\nsystemctl stop wgc-wg7.{path,service}\nsystemctl disable wgc-wg7.{path,service}\nrm /etc/systemd/system/wgc-wg7.{path,service}\nsystemctl stop wg-quick@wg7.service\nsystemctl disable wg-quick@wg7.service\nrm /etc/wireguard/wg7.conf\nrm -Rf /etc/wireguard/wgc-wg7\n```\n\n\n# Tested\nWG Commander should work well on any systemd-based Linux\ndistribution with WireGuard, iptables, sysctl, procfs available.\n\nIt was tested on:\n- Ubuntu 24.04 (v0.1.6 tested on Aug 17 2024)\n- Ubuntu 20.04\n- Ubuntu 22.04\n- Rocky Linux 9\n- Debian 11\n- Debian 12\n\n# Notes \nThere is no commercial purpose behind WG Commander. \nThe project is licensed under \nthe [MIT License](https://github.com/andrianbdn/wg-cmd/blob/master/LICENSE).\n\nThis project is NOT related to the creator of WireGuard®.\nWG Commander project is NOT approved, sponsored, or affiliated \nwith WireGuard® or with the WireGuard® community.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAndrianBdn%2Fwg-cmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAndrianBdn%2Fwg-cmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAndrianBdn%2Fwg-cmd/lists"}