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. Use it
only as a last resort when PHP is stuck; for normal config changes, reload the web server instead.
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 queues in the default virtual host
tscli rabbitmq queue list /
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. Every command accepts 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.
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 such asnginx,apache,mysql,postgresql,php,redis, orweb(Nginx and Apache together). For web sources, adderrororaccessto narrow the scope. -
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".
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
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; in-flight requests are dropped.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: