Command-line client (CLI)
Install and use the webshield CLI to manage domains, DNS records, edge settings and publish static sites from the terminal or CI.
webshield is the official command-line client for the WebShield API. It manages domains and DNS records, edge settings of proxied hosts, publishes static sites (including incremental publishing from CI), and shows statistics and billing usage.
Source code and releases: github.com/webshieldpro/webshield-cli.
Installation
Section titled “Installation”The installer detects your OS and architecture, downloads the latest release, verifies the SHA-256 checksum and installs the binary to ~/.local/bin:
curl -fsSL https://raw.githubusercontent.com/webshieldpro/webshield-cli/main/install.sh | shPrebuilt binaries are available for Linux (x86_64, aarch64 — static, no dependencies) and Windows on the releases page. You can also build from source with Rust:
git clone https://github.com/webshieldpro/webshield-clicd webshield-clicargo build --releasemv target/release/webshield ~/.local/bin/Shell completion
Section titled “Shell completion”Each release archive ships completion scripts; the binary can also generate them for bash, zsh, fish, PowerShell, elvish and nushell:
# bashwebshield completion bash > ~/.local/share/bash-completion/completions/webshield# zsh (the target dir must be on $fpath)webshield completion zsh > ~/.zfunc/_webshield# fishwebshield completion fish > ~/.config/fish/completions/webshield.fishAuthentication
Section titled “Authentication”The CLI uses a personal API token (wsk_…). Create one in the control panel under Settings → API tokens with the scopes you need — see API tokens. For CI, prefer a narrow token bound to a single domain or site.
webshield auth login # prompts for the token and saves it to a profilewebshield auth status # shows the active profile and verifies accessAlternative ways to pass the token: the --token flag or the WS_TOKEN environment variable (convenient in CI). Profiles are stored in ~/.config/webshield/config.toml; several profiles are supported via --profile (or WS_PROFILE), like in aws or gh.
Domains
Section titled “Domains”webshield domains list # your domains and delegation statuswebshield domains add example.com # add a domain (imports existing records by scanning)webshield domains add example.com --import nonewebshield domains check example.com # check delegation to WebShield nameserverswebshield domains remove example.comNames without changing nameservers
Section titled “Names without changing nameservers”The domain stays at your DNS provider, and names are connected with records (details in Connect without changing nameservers):
webshield domains add example.com --externalwebshield hosts add www.example.com --domain example.com --origin 203.0.113.10 # prints the recordswebshield hosts verify www.example.com # after the _acme-challenge record: confirmation and certificatewebshield hosts list # status, certificate, whether traffic flows through uswebshield hosts records www.example.com # the records againwebshield hosts add blog.example.com --domain example.com --mode staticwebshield proxy set www.example.com --domain example.com --origin 203.0.113.20 # change the serverwebshield hosts remove www.example.comDNS records
Section titled “DNS records”webshield dns list example.comwebshield dns list example.com --type A
webshield dns add example.com www A 203.0.113.10 # add a value to the setwebshield dns set example.com @ A 203.0.113.10 # make the set exactly this valuewebshield dns remove example.com www A 203.0.113.10 # remove a single valuewebshield dns remove example.com www TXT # remove the whole record set
webshield dns add example.com www CNAME foo.example.com # trailing dot added automaticallywebshield dns add example.com @ MX "10 mail.example.com" --ttl 3600Semantics for multi-value types (A, AAAA, TXT, MX): add appends values to the existing set, set makes the set exactly the given values, remove deletes only the listed values (without values — the whole set). CNAME/NS are single-valued and always replaced.
webshield dns dnssec status example.com # DS records for the registrarwebshield dns dnssec enable example.comwebshield dns dnssec disable example.com # blocked while a DS is live in the parent zoneSee DNSSEC for the delegation-side steps.
webshield apps listwebshield apps deploy --project shop --app web # pack the directory, upload, wait until livewebshield apps deploy --url https://example.com/app.tar.gz --project shop --app webwebshield apps deployments --project shop --app webwebshield apps redeploy 42 # roll back to deployment #42webshield apps logs --project shop --app web -f # follow the log
webshield apps db create db --size 2 # a Postgres database in the projectwebshield apps db restore db --as db2 --time 2026-10-21T15:00:00+03:00 # into a new database; no --time — latest statewebshield apps kv create cache --memory 128 # a Valkey storewebshield apps env set DATABASE_URL='${{db.url}}' REDIS_URL='${{cache.url}}' --redeployprintf %s "$STRIPE_KEY" | webshield apps env set STRIPE_KEY # value from stdinwebshield apps env list # names only; values with --valueswebshield apps env unset OLD_FLAGwebshield apps db list; webshield apps kv delete cache
webshield apps d1 migrate --app api app-db # a function: D1 migrations from the project directorywebshield apps d1 execute --app api app-db --command "SELECT 1"webshield apps kv import --app api CACHE keys.json # function KV keys, Wrangler bulk formatwebshield apps window --app api # from which moment function data can be returnedwebshield apps restore --app api --time 2026-10-21T15:00:00+03:00webshield apps operations --app api # recent data operations of the function
webshield apps balance # available balance and priceswebshield apps usage --project shop # project spending this month, by daywebshield apps cap 500 --project shop # monthly cap; off removes itNames are optional: the commands read the project and the app from webshield.toml in the directory (--dir, the current one by default). Put a ${{…}} reference in single quotes, or the shell will try to expand it itself. Without --redeploy variables apply from the next deployment. deploy waits until the app is live and exits non-zero on failure. More in Apps and Functions, deploying from CI — the guide.
Static sites
Section titled “Static sites”webshield sites listwebshield sites create www.example.com --domain example.comwebshield sites publish www.example.com --dir ./public # incremental publishwebshield sites publish --site-id 6 --dir ./public # by id (narrow sites:publish tokens)webshield sites publish www.example.com --dir ./public --dry-run # show the plan onlywebshield sites publish-from-bucket www.example.com --bucket web --path public/ # from your S3 bucketwebshield sites files www.example.compublish-from-bucket publishes the site straight from one of your own object-storage buckets (upload it there with any S3 tool first). The command starts the async publish and waits until it finishes.
publish computes a stateless diff against the server (by content hash), uploads only changed files, deletes vanished ones and atomically publishes a new version — safe to run from CI on every build.
A minimal GitHub Actions (Gitea Actions, Forgejo Actions) step:
- name: Publish site env: WS_TOKEN: ${{ secrets.WS_PUBLISH_TOKEN }} run: | curl -fsSL https://raw.githubusercontent.com/webshieldpro/webshield-cli/main/install.sh | sh ~/.local/bin/webshield sites publish www.example.com --dir ./publicThe same job for GitLab CI (WS_TOKEN is a CI/CD variable with Masked and Protected ticked):
publish: script: - curl -fsSL https://raw.githubusercontent.com/webshieldpro/webshield-cli/main/install.sh | sh - ~/.local/bin/webshield sites publish www.example.com --dir ./publicMore on hosting modes and CI tokens — Hosting static sites.
Proxied hosts and redirects
Section titled “Proxied hosts and redirects”webshield proxy listwebshield proxy get app.example.comwebshield proxy set app.example.com --domain example.com --ssl true --bot-protection truewebshield proxy set old.example.com --domain example.com \ --mode redirect --redirect-target example.comwebshield proxy set shop.example.com --domain example.com --html-cache truewebshield proxy purge-cache app.example.comwebshield proxy remove app.example.comproxy set creates the host config or partially updates an existing one; boolean flags are sent only when specified, other settings stay untouched.
purge-cache drops everything we cached for the host — handy at the end of a deploy if files changed under the same names. See CDN and protection for details.
Statistics and billing
Section titled “Statistics and billing”webshield stats summary example.com --range 7d # traffic/requests summarywebshield stats bans example.com # active bans and challenges
webshield billing balancewebshield billing usage example.com # traffic vs the plan limitwebshield billing tariffs example.comScripting
Section titled “Scripting”Every command supports machine-readable output:
webshield -o json domains list | jq -r '.[].name'Interface language is selected with --lang en|ru (or WS_LANG); by default it follows the system locale. --yes skips confirmation prompts for destructive operations.