Designed for command-line users
Website |
Reddit |
Twitter |
Telegram
- AdGuard CLI is not an open source project. We use GitHub as an open bug tracker for users to see what developers are working on. However, we at AdGuard create a lot of open source software.
- Privacy policy: https://adguard.com/privacy.html
AdGuard CLI is the command-line version of AdGuard Ad Blocker. Learn more about it in our Knowledge base.
To install the latest version of AdGuard CLI, run the following command:
Release channel:
curl -fsSL https://raw.githubusercontent.com/AdguardTeam/AdGuardCLI/release/install.sh | sh -s -- -vBeta channel:
curl -fsSL https://raw.githubusercontent.com/AdguardTeam/AdGuardCLI/beta/install.sh | sh -s -- -vNightly channel:
curl -fsSL https://raw.githubusercontent.com/AdguardTeam/AdGuardCLI/nightly/install.sh | sh -s -- -vInside an archive file, there is a small file with a .sig extension that contains the signature data. In a hypothetical situation where the binary file inside an archive is replaced by someone, you’ll know it isn’t an official release from AdGuard.
To verify the signature, you need to have the openssl tool version 1.1.1 or newer installed.
First, import the AdGuard public key:
curl -fsSL https://raw.githubusercontent.com/AdguardTeam/AdGuardCLI/master/adguard_ed25519_pubkey.pem -o adguard_ed25519_pubkey.pemIt will download public key, which should have the value MCowBQYDK2VwAyEAN0NPZFtolGN+Cjyorh4Wo91vnBlLLQiWkbujeHDYbok=.
Then, verify the signature:
openssl pkeyutl -verify -inkey adguard_ed25519_pubkey.pem -pubin -sigfile /opt/adguard-cli/adguard-cli.sig -in /opt/adguard-cli/adguard-cli -rawinIf you use a custom installation path, replace /opt/adguard-cli with the path to the adguard-cli and its signature file.
You’ll see the following message:
Signature Verified Successfully
Run adguard-cli [command] to use AdGuard CLI. Below are the available commands and their options:
-h, --helpPrint this help message and exit--help-allShow all available commands, subcommands, and options-v, --versionDisplay program version information and exit
activateActivate the appreset-licenseDeactivate the appconfigureRun the configuration wizardstartStart AdGuard CLIrestartRestart AdGuard CLI if it is already runningstopStop AdGuard CLIstatusShow the status of AdGuard CLIlicenseShow license informationconfigConfigure AdGuard CLIshowShow current configuration fromproxy.yaml--list-filePath to a YAML file to show instead of the configuration, e.g.browsers.yaml
setSet a single option inproxy.yaml, e.g.: -listen_ports.http_proxysets the HTTP listen port -proxy_modesets the proxy mode (manual or auto)getGet a single option fromproxy.yamllist-addAdd a value to a list with the specified key in proxy.yaml, e.g.: -filtersadds a file with filters -appsa filter action for an application; specify the application name and the action (default, bypass_https, bypass) separated by a space, and optionally allow skip outbound proxy by writing it as the third value--list-filePath to the YAML file where the application will be added (e.g.browsers.yaml)
list-removeRemove a value from a list with the specified key inproxy.yaml, e.g.: -filtersremoves a filter file -appsremoves an application rule by name--list-filePath to the YAML file from which the application will be removed (e.g.browsers.yaml)
resetReset to default a value of a setting with the specified key inproxy.yaml, e.g. -listen_ports.http_proxyresets the HTTP listening port to the default value (3129) -proxy_moderesets the proxy mode to the default value (manual)--allReset all settings to their default values
check-updateCheck for updatesupdateUpdate AdGuard CLI-v, --verboseShow update script output
filtersManage filterslistList installed filters--allShow all filters
installInstall a filterenableEnable a filterdisableDisable a filterupdateUpdate filtersaddAdd a filter by its ID or nameremoveRemove a filter by its ID or name
export-logsExport logs to a zip file-o, --output TEXTPath to the output artifact. Can be a directory-f, --forceOverwrite the output artifact without asking
AdGuard CLI behaviour can be configured per-app. See the apps section of proxy.yaml for details.
There's a number of pre-configured entries for popular web browsers,
contained in browsers.yaml and included by default.
Using AdGuard CLI in automatic proxy mode together with AdGuard VPN CLI in tunnel mode is impossible due to a routing loop: AdGuard VPN CLI's traffic currently can not be excluded from being transparently proxied by AdGuard CLI, and AdGuard CLI's traffic must go through the AdGuard VPN CLI's tunnel. These are the two possible solutions:
- Switch AdGuard CLI to manual proxy mode.
- In this case, AdGuard VPN CLI can be used in tunnel mode, but apps for which ad blocking is desired must be manually configured to use the AdGuard CLI's proxy.
- Switch AdGuard VPN CLI to SOCKS5 mode, and configure AdGuard CLI with an outbound proxy pointing to the SOCKS5
interface of AdGuard VPN CLI.
- Note that in this case for an app's traffic to go through the VPN tunnel it must either have its traffic transparently proxied by AdGuard CLI (which is the case for all apps by default), or manually configured to use AdGuard VPN CLI's SOCKS5 interface.
- Also note that in this case, in order to avoid a routing loop, the
skip_outbound_proxyoption must be enabled for AdGuard VPN CLI in AdGuard CLI's apps configuration section. By default,skip_outbound_proxyis enabled for all apps withvpnin their name, which includes AdGuard VPN CLI.
