TurboStack CLI

Manage services, caches, the firewall, email and logs directly on your server with the tscli command-line tool.

tscli is the TurboStack command-line tool that ships on every TurboStack server. It gives you safe, audited control over day-to-day operations: checking and restarting services, clearing caches, managing the firewall, validating email Domain Name System (DNS), searching logs, and more, without needing to know the underlying system commands.

Where the API manages your configuration from the outside (the desired state that TurboStack deploys), tscli acts on the running server itself: it operates on live services and caches right now.

How it works

Run commands in the form:

tscli <group> <command> [arguments] [options]

For example:

tscli nginx reload
tscli service status
tscli firewall block 203.0.113.10 --comment "abuse"

Useful global flags:

Flag What it does
tscli --help / -h Show help for the tool, a group, or a command (for example tscli firewall --help).
tscli --version / -v Show the installed tscli version.

Tab-completion is enabled, so you can press Tab to complete groups, commands, log sources and options.

Permissions and auditing

Most tscli commands act on system services and therefore need root privileges. This is configured for you: when you run tscli, it elevates automatically. You do not need to type sudo and you are not prompted for a password.

Every invocation is logged, including the connecting SSH IP address, to:

/var/log/tscli.log

This gives you (and Hosted Power) a clear audit trail of who ran what, and when.

Checking status

Almost every service group has a status command that shows whether the service is active and enabled, its uptime, and a liveness check. To see everything on the host at once, use tscli service status.

Web servers

Manage Nginx and Apache. Both validate the configuration first and abort safely if it is invalid, so a bad config can never take a site offline.

Command What it does
tscli nginx reload Validate the config and gracefully reload Nginx.
tscli nginx restart Validate the config and restart Nginx.
tscli nginx status Show Nginx service status and a config check.
tscli apache reload Validate the config and reload Apache.
tscli apache restart Validate the config and restart Apache.
tscli apache status Show Apache service status and a config check.
# Apply a config change without interrupting live traffic
tscli nginx reload

Caching

Manage the Varnish full-page cache, the Redis object cache, and the PHP OPcache.

Command What it does
tscli varnish clear Clear the entire Varnish full-page cache.
tscli varnish reload Validate and reload the Varnish configuration.
tscli varnish status Show Varnish service status.
tscli redis clear Flush the Redis cache instance (6379). The persistent instance (6378) is left untouched.
tscli redis status Show Redis service status and a liveness check.
tscli opcache clear Clear the PHP OPcache.
# Purge the full-page cache after a deploy or content change
tscli varnish clear

PHP

Command What it does
tscli php status Show PHP-FPM status for each installed PHP version.
tscli php kill Stop every PHP-FPM process on the host, master processes included.

Blackfire profiler

Manage the Blackfire PHP profiler.

Command What it does
tscli blackfire enable Install and enable the Blackfire profiler.
tscli blackfire disable Remove and disable the Blackfire profiler.
tscli blackfire configure Set the Blackfire server ID and token interactively.
tscli blackfire reload Restart the Blackfire agent.
tscli blackfire status Show Blackfire agent status.
# Enable profiling temporarily to investigate a performance problem
tscli blackfire enable
# ... profile your application ...
tscli blackfire disable

Databases

Restart and check MySQL/MariaDB, PostgreSQL and MongoDB. postgresql restart covers every detected cluster.

Command What it does
tscli mysql restart Restart the MySQL/MariaDB service.
tscli mysql status Show MySQL/MariaDB status and a liveness check.
tscli postgresql restart Restart all PostgreSQL clusters.
tscli postgresql status Show PostgreSQL status and a per-cluster liveness check.
tscli mongo restart Restart the MongoDB service.
tscli mongo status Show MongoDB status and a liveness check.

Search and queues

Command What it does
tscli solr restart Restart the Solr search service.
tscli solr status Show Solr status.
tscli rabbitmq status Show RabbitMQ status and a liveness check.
tscli rabbitmq queue list <vhost> List the queues in a RabbitMQ virtual host (JSON output).
# List the queues in your virtual host (named after the system user, or <user>_<app>)
tscli rabbitmq queue list prod

Containers

Command What it does
tscli docker restart Restart the Docker service.
tscli docker status Show Docker status and the number of running containers.

Firewall

Manage the host Firewall, which works together with TurboShield threat detection. Blocks apply at both the network and web layers, take effect immediately, and repeating a block for the same address does not create a duplicate rule. Address arguments accept an IPv4 or IPv6 address, or a Classless Inter-Domain Routing (CIDR) range.

Command What it does
tscli firewall check <ip-or-reference> Check an address or range for active blocks, or investigate a TurboShield request reference. Supports --output json.
tscli firewall block <ip> Block an IP. See the options below.
tscli firewall unblock <ip> Remove a block for an IP.
tscli firewall whitelist <ip> Add an IP to the allow and ignore lists.
tscli firewall unlist <ip> Remove an IP from the allow and ignore lists.
tscli firewall flush Remove all automatic blocks (permanent manual blocks remain).
tscli firewall display-blocks List the active manual blocks. Add --full to include automatic blocks. Supports --output json.
tscli firewall display-whitelists List the active allow and ignore entries.
tscli firewall status Show firewall status, protection mode and block counts.
tscli firewall stats Show TurboShield traffic statistics, detections and current firewall blocks. Defaults to the last hour.

Options for tscli firewall block:

Option Default What it does
--time <seconds> 2592000 (30 days) How long the block lasts. Use -1 for a permanent block.
--comment <text> empty A short reason for the block (for the audit trail).
# Is this address blocked?
tscli firewall check 203.0.113.10

# Block an abusive IP for a week, with a reason
tscli firewall block 203.0.113.10 --time 604800 --comment "spam"

# Block a whole range permanently
tscli firewall block 203.0.113.0/24 --time -1

# Permanently trust a known-good IP (office, monitoring)
tscli firewall whitelist 198.51.100.7

Investigate a TurboShield request

The TurboShield throttle page shows a request reference. Responses also carry it in the X-TurboShield-Ref header. Copy the reference and check it on the affected host:

tscli firewall check 8980dd8beca3ef5a-21da
tscli logs shield find 8980dd8beca3ef5a-21da
tscli logs shield show blocked from last hour

The check shows the request, its protection action and rule, followed by the address's current blocks. A throttled request can have no active ban. Throttling limits traffic temporarily; it does not create a ban. If the reference is not found, check that you are on the correct host and investigate promptly. The protection log retains only recent hours, with 12 rotated hourly files.

The shield log source shows protection actions at every TurboShield level, plus a sample of traffic that passed or was delayed. When you connect as a system user, this log is restricted to that user's applications. An application's own 403 or 429 response can have the protection action pass. The status alone does not identify a TurboShield block.

Protection statistics

tscli firewall stats
tscli firewall stats --hours 6
tscli firewall stats --since "2026-11-16 09:00" --until "2026-11-16 10:00" --output json
Option Default What it does
--hours <n> 1 Select the last 1 to 168 hours, ending at --until or now.
--since <time> From --hours Set an exact start in server time, overriding --hours.
--until <time> Now Set an exact end in server time.
--output text\|json text Print a readable report or a JavaScript Object Notation (JSON) document.

Times accept YYYY-MM-DD, YYYY-MM-DD HH:MM or YYYY-MM-DD HH:MM:SS. You can use T instead of the space between date and time.

The report separates served, slowed, throttled, challenged and blocked requests. It also identifies common rules, affected addresses and verified crawlers. JSON output includes breakdowns by application, path, bot and client type. Client types distinguish browsers, suspected browser impersonators, scripts and bots. These are classifications, not proof of abuse.

Request totals are estimates because passed and delayed traffic is sampled outside attack mode. Active bans describe the current state; dropped-packet counters are cumulative, rather than limited to the selected window. Older windows cannot recover protection records that have already rotated away. If the report warns that counts are partial, use a shorter range. Investigate the affected application and rule before changing a protection level or trusting an address.

Email (DKIM)

Check the DomainKeys Identified Mail (DKIM) DNS records for the domains on the host. See Email for the wider mail setup.

Command What it does
tscli dkim records Show the DNS TXT records that DKIM requires for each domain.
tscli dkim validate Look up the records in DNS and report whether they match.
# Show the records to add at your DNS provider
tscli dkim records

# Confirm they are live and correct
tscli dkim validate

Service overviews

Command What it does
tscli service status Show the status of every installed service on the host at a glance.
tscli app status Overview of your application background services (per user).
tscli app list A flat, scriptable list of app services (user, backend, service, active/total). Add --output json for a machine-readable document.
tscli app backends Show which process manager each app user uses.
# Quick health snapshot of every service on the host
tscli service status

Logs

Search the server logs in plain language, without remembering file paths.

tscli logs <source> [query...] [--explain]
  • source is a log source. The web sources are web (Nginx and Apache together), nginx and apache; add error or access after them to narrow the scope. The others are php, mysql, mariadb, postgresql, database (every database), redis, rabbitmq, mail, ssh, firewall, cron, system, app (your application services) and shield (TurboShield protection decisions).

  • The query understands phrases like find <text>, show last <n> lines, and time ranges such as from last hour or from 2 hours ago.

  • When you give more than one search term, they are combined with AND by default: a line must contain every term to match. To match any term instead, put or between them.

  • --explain shows how your query was interpreted, including whether the terms were combined with "and" or "or".

  • A three-digit number on its own is not a search term. find 404 filters nothing. Write 404 errors (or show 500 errors from last hour): next to the word errors, numbers from 100 to 599 filter on the HTTP status code, and several codes match any of them.

  • Keep a time phrase in one piece and start it with from, since or last: errors from last hour sets the window, errors in the last hour does not.

tscli logs nginx error                          # recent Nginx error log
tscli logs nginx find timeout from last hour    # search both Nginx logs for "timeout"
tscli logs web find 203.0.113.10 timeout        # lines that contain BOTH terms (AND)
tscli logs web find 203.0.113.10 or 203.0.113.11  # lines that contain EITHER term (OR)
tscli logs mysql find error from 2 hours ago    # MySQL log, scoped by time
tscli logs redis errors from last hour         # Redis log, scoped by time

Time filters recognize timestamps in Redis, Valkey and KeyDB log entries.

Application service logs

The app source reads the journal and configured log files of your application services, such as queue workers. It also includes configured output files from your Supervisor programs. Run these commands as your system user, using its password from the Credentials tab when connecting. You see only that system user's services. Name the service after app to select it. Omit the name, or use all, to search all your services.

tscli logs app list lists the services, their journal units and their current log-file paths. Add --output json for a JavaScript Object Notation (JSON) document with an apps list.

If the host has no application services, an unfiltered tscli logs app query returns an empty result. Requesting a service that cannot be found reports an error.

For a worker log without timestamps, a time filter selects files by their last modification time. The matching lines have no timestamp and can include older events. Add timestamps to the worker's output for exact event filtering.

tscli logs app                                  # the last lines of all your app services
tscli logs app list                             # which app logs there are
tscli logs app list --output json               # service names, units and file paths
tscli logs app all errors from last hour         # errors across your services
tscli logs app sidekiq errors from last hour    # one service, errors only

Exact time windows and scripting

For an exact window, or to feed the lines into another tool, use the options instead of the query text. They override whatever the query text says.

Option What it does
--since "2026-10-14 16:00" Start of the window, server time, inclusive. Date only, or YYYY-MM-DD HH:MM[:SS].
--until "2026-10-14 20:30" End of the window, same formats.
--limit 200 At most this many of the newest matching lines. Accepts 1 to 100000.
--reverse Print the newest lines first. It does not change which lines are selected.
--output json One JSON document with the interpreted query and the matching lines.
tscli logs web access --since "2026-10-14 16:00" --until "2026-10-14 20:30" --limit 200 --output json

The host's Logs tab reads the same logs in the TurboStack Platform, with a time range and search box. See Troubleshooting for how to use logs while diagnosing an issue.

Health snapshot

tscli healthcheck [brief]

Shows a one-screen snapshot of the server: uptime and load, memory and swap, disk usage per mount, the top memory-using processes, and active connections. Add brief for a shorter report. For the full picture over time, use the host's Health tab.

Tools

Bot traffic analysis

Analyze how much of your traffic comes from bots and crawlers, which feeds into TurboShield tuning.

Command What it does
tscli tools botload list [--time <start> <end>] List log files and analyze one (optionally within a time window, HH:MM:SS).
tscli tools botload shared [-n <count>] Analyze all web logs and rank them by bot percentage (default top 10).
tscli tools botload ip <ip> [--cidr <bits>] Analyze all entries for an IP or range (default --cidr 32).
tscli tools botload live Watch incoming traffic and update bot statistics in real time.
# Which logs have the highest bot share?
tscli tools botload shared -n 20

Image optimizer

Reduce the size of JPG and PNG assets under a path.

tscli tools image-optimizer <path> [options]
Option Default What it does
-a, --apply off (dry-run) Replace originals when the optimized file is smaller.
-q, --quality <1-100> 90 JPEG quality target.
-s, --size <pixels> 2000 Maximum width/height before resizing.
-n, --new off Only scan files added since the last run.
--exclude <path> none Skip a directory tree (repeatable).
# Preview savings (no changes made)
tscli tools image-optimizer /var/www/site/media

# Apply, at quality 85 and max 1500px
tscli tools image-optimizer /var/www/site/media -q 85 -s 1500 -a

Destructive commands

These change state immediately and cannot be undone. Use them with care:

  • tscli redis clear, tscli varnish clear, tscli opcache clear - clear caches (temporary performance dip).
  • tscli php kill - stops all PHP processing, masters included; in-flight requests are dropped and PHP is down for roughly 15 to 20 seconds while it restarts.
  • tscli firewall flush - removes all automatic blocks.
  • tscli blackfire disable / configure - removes the profiler / overwrites its credentials.
  • tscli tools image-optimizer ... -a - overwrites original image files.
  • tscli ... restart / reload - can cause a brief interruption if a service fails to come back.

Exit codes

tscli returns 0 on success and a non-zero code on failure, so you can use it safely in scripts:

Code Meaning
0 Success
1 Command failed, or could not elevate to root
6000 Generic error
6001 Invalid user input
6002 Service is not installed
6101 Invalid Nginx configuration
6201 Invalid IP address
6301 Could not install Blackfire
6302 Could not remove Blackfire
130 Interrupted (Ctrl-C)

When to use the CLI

You want to... Use
Change configuration (versions, services, domains) In the TurboStack Platform or API, then publish
See whether a service is healthy tscli service status or tscli <service> status
Apply a config change to the running web server tscli nginx reload
Clear caches after a deploy or content change tscli varnish clear, tscli redis clear, tscli opcache clear
Block or trust an IP address tscli firewall block / whitelist
Check or validate email DNS tscli dkim records / validate
Search logs while troubleshooting tscli logs <source> find <text>