Skip to content

Console commands reference

ClientFence has a command line, console.php, in the ClientFence directory. Use it for updates, the cache, the cron, an import, or to get back in when you are locked out. This page lists every command it ships.

Open a shell on the server, go to the ClientFence directory and run the command as the site user: the user that owns the ClientFence files and runs its PHP. ls -l config.php shows that user.

Terminal window
cd /path/to/clientfence
sudo -u siteuser php console.php list

Replace siteuser with that user. If you signed in over SSH as the site user, leave out sudo -u siteuser.

Exit code 0 means the command worked; any other code means it did not. Extensions you install can add their own commands: php console.php list shows every command on your site.

Command What it does
system:update Updates ClientFence to the latest release, as System → Update ClientFence does.
system:run-patcher Finishes an installed update: database and settings changes, then clears the cache.
system:releasenotes Prints the notes of the newer release the update check found.
system:version Prints the ClientFence version.
cache:clear Clears the cache.
cron:run Runs the scheduled tasks once.
clientfence:staff-password Lists the staff, or sets a staff member’s password.
clientfence:signin-security-off Turns sign-in security off when it locks staff out.
clientfence:whmcs-import Imports from WHMCS, Upmind, Blesta, ClientExec, FOSSBilling or Paymenter.
theme:list Lists the installed themes and which ones are active.

Checks the release list now and installs the latest release, with the same checks, backup, checksum and automatic rollback as System → Update ClientFence. It shows the release notes and the files changed on your site, then asks before it starts. See Update ClientFence.

Option What it does
--check Only shows the installed and the latest version.
--yes, -y Updates without asking (for scripts). Without it, a run with no terminal or with --no-interaction changes nothing.
--beta Uses the beta channel for this run only. The saved setting stays as it is.

Exit codes: 0 updated or already up to date, 1 not updated (refused, cancelled or failed). With --check: 0 up to date, 1 an update is available, 2 the check failed.

Terminal window
sudo -u siteuser php console.php system:update --check
sudo -u siteuser php console.php system:update

Run it in screen or tmux on a remote server: an update stopped half way leaves the site locked. When it ends, it runs system:run-patcher itself. If the site still shows the old version, restart the web server’s PHP.

Finishes an update: it applies the database and settings changes, removes the install folder if needed and clears the cache. Run it when the admin area asks you to finalize an update. If this version was already finished, it says so and changes nothing. No options.

Terminal window
sudo -u siteuser php console.php system:run-patcher

system:releasenotes prints the notes of the newer release found by the daily update check (with the check on, it checks first when the last check is more than a day old). When you are up to date, it says the installed version is the latest release. It exits 1 when the last check failed or no check has run yet: run system:update --check first. system:version prints the ClientFence version, such as 1.0.58. --version also names the FOSSBilling version ClientFence is based on:

Terminal window
sudo -u siteuser php console.php system:version
sudo -u siteuser php console.php --version

Empties data/cache and the cache stores (Redis or Memcached too, if set up), including the sign-in counters. Prints Successfully cleared the cache. No options. See Caching.

Terminal window
sudo -u siteuser php console.php cache:clear

Runs the scheduled tasks once, like the five-minute cron job. Each task prints a line. If another run is still going, it prints Skipped: another cron run is still running. and exits 0. It exits 1 when a task failed (the log says which) or while an update waits to be finished. It accepts an interval argument, which has no effect.

Terminal window
sudo -u siteuser php console.php cron:run

Without an email, lists the staff with their status. With an email, asks for the new password twice (hidden; Ctrl+D cancels). Without a terminal, or with --no-interaction, it makes a strong password and shows it once. The password must follow the usual strength rules. Reset links already sent stop working and the staff member is signed out everywhere. See Get back into a locked staff account.

Argument or option What it does
email The staff member’s email address. Optional.
--activate Also sets an inactive staff member active.

Exits 1 when no staff member has that email or the passwords do not match.

Terminal window
sudo -u siteuser php console.php clientfence:staff-password owner@example.com

With no option, turns off the email PIN, the staff country rule, the staff IP address rule, the required two-factor sign-in for clients, passkey sign-in and CAPTCHA Protection. An option turns off only that one; you can combine them. It prints what is on now and writes a warning to the log. See Sign-in security.

Option Turns off only
--pin The email PIN.
--countries The staff country rule.
--ips The staff IP address rule.
--twofactor The required two-factor sign-in for clients.
--passkeys Passkey sign-in.
--captcha CAPTCHA Protection.
Terminal window
sudo -u siteuser php console.php clientfence:signin-security-off --captcha

Runs an import from the server, for installs too big for the admin page. Save and test the connection in the admin area first. The step argument is required:

Step What it does
upmind, blesta, clientexec, fossbilling, paymenter Reads that system first. Not needed for WHMCS.
plan Shows what the import brings and the server checks.
apply Imports, and goes on from where a stopped run left off.
verify Compares the source with what was imported. Exits 1 if imported clients are missing.
Option What it does
--restart With a reading step: reads the system again from the start.
--json With plan, apply or verify: prints the result as JSON.
--attachments=FOLDER Saves WHMCS’s ticket attachments folder on this server for the import.

An unknown step exits 2. For a large install, give PHP more memory for the run:

Terminal window
sudo -u siteuser php -d memory_limit=512M console.php clientfence:whmcs-import plan

See Import from WHMCS and the other import guides.

Shows a table of the installed admin and client themes, and which one is active in each area. No options.

Terminal window
sudo -u siteuser php console.php theme:list
Command or option What it does
list Lists every command.
help <command> or <command> --help Shows a command’s arguments and options.
completion Prints a shell completion script (for developers).
--version, -V Prints the ClientFence release.
--no-interaction, -n Never asks a question.
--quiet, -q Prints nothing but errors.