TurboStack CLI
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.
Note
tscli runs on the server, over SSH. Connect first (see your host's
SSH tab for connection details), then run the commands below from
that shell.
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:
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
Warning
Some commands are destructive: they flush caches, kill processes, remove firewall rules, or
overwrite files. They take effect immediately and cannot be undone. Each one is flagged below and
listed under
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.
# Apply a config change without interrupting live traffic
tscli nginx reload
Tip
Prefer reload over restart: it applies changes without dropping active connections. Use
restart only when a full restart is genuinely needed.
Caching
Manage the Varnish full-page cache, the Redis object cache, and the PHP OPcache.
# Purge the full-page cache after a deploy or content change
tscli varnish clear
Note
tscli redis clear runs redis-cli flushall on the cache instance (6379), clearing all of its
databases. The persistent instance (6378) - sessions and queues - is not affected. Expect a
short performance dip while the cache warms up again. See
Clear the Redis cache to target a single database.
Note
Clearing OPcache makes PHP recompile scripts on the next request, so the first hit after clearing is slightly slower. This is normal.
PHP
Warning
tscli php kill immediately stops all PHP processing on the server (graceful stop first, then a
forced kill if needed). Requests in flight are aborted, which can interrupt transactions. It stops
the PHP-FPM master processes too, not only their workers, so PHP is unavailable until they return.
The platform restarts them automatically, which takes roughly 15 to 20 seconds.
Use it only when PHP is genuinely stuck. To apply a configuration change or a new preload script, reload PHP instead - it has no downtime:
sudo systemctl reload php8.4-fpm.service
See Administrator access.
Blackfire profiler
Manage the Blackfire PHP profiler.
# Enable profiling temporarily to investigate a performance problem
tscli blackfire enable
# ... profile your application ...
tscli blackfire disable
Note
enable and disable restart the PHP-FPM services so the change takes effect, which briefly
interrupts PHP processing.
Databases
Restart and check MySQL/MariaDB,
PostgreSQL and MongoDB.
postgresql restart covers every detected cluster.
Tip
Restart a database sparingly. A restart briefly interrupts every site that uses it. Check Database problems before restarting.
Search and queues
# List the queues in your virtual host (named after the system user, or <user>_<app>)
tscli rabbitmq queue list prod
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.
Options for tscli firewall block:
# 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
Warning
tscli firewall flush removes all automatic blocks at once, including blocks that were protecting
you from active abuse. Use it only when you are sure a block is a false positive and you need a
clean slate. Permanent manual blocks are kept.
Tip
If you (or a customer) are locked out by the firewall, tscli firewall check <ip> confirms
whether that IP is the cause, and tscli firewall whitelist <ip> restores access for a trusted
address.
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
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.
# Show the records to add at your DNS provider
tscli dkim records
# Confirm they are live and correct
tscli dkim validate
Service overviews
# 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]
-
sourceis a log source. The web sources areweb(Nginx and Apache together),nginxandapache; adderrororaccessafter them to narrow the scope. The others arephp,mysql,mariadb,postgresql,database(every database),redis,rabbitmq,mail,ssh,firewall,cron,system,app(your application services) andshield(TurboShield protection decisions). -
The query understands phrases like
find <text>,show last <n> lines, and time ranges such asfrom last hourorfrom 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
orbetween them. -
--explainshows 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 404filters nothing. Write404 errors(orshow 500 errors from last hour): next to the worderrors, 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,sinceorlast:errors from last hoursets the window,errors in the last hourdoes 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.
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.
# 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]
# 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
Warning
tscli tools image-optimizer with -a/--apply overwrites the original image files. Run it
first without -a to preview the savings.
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: