Home → Admin Manual → System Administration → HelpSpot Command Line Tool
4.1. HelpSpot Command Line Tool
Commands Available
HelpSpot 5 has some new commands available, along with most commands from HelpSpot 4.
HelpSpot includes an hs
command that can be used to run or automate certain tasks.
Linux:
The hs command installed with HelpSpot is the command line utility. On Linux servers, you can run it using PHP:
# List the available commands and options: php hs
Windows:
On Windows, you need to run the hs command using the PHP that comes with HelpSpot using Cmd or PowerShell, and let it know which configuration file to use:
C:\'Program Files (x86)'\helpspot\php\php.exe -c C:\'Program Files (x86)'\helpspot\php\php.ini C:\'Program Files (x86)'\helpspot\helpspot\hs
It might be easier to first "change directory" into the HelpSpot directory so these file paths are shorter:
cd C:\'Program Files (x86)'\helpspot\helpspot ..\php\php.exe -c ..\php\php.ini .\hs
For both Linux and Windows, running hs without any parameters will simply list out the available commands.
Command Details
Each command has a list of options you can pass to it. To see the details of available flags, use the -h
flag:
php hs install -h Description: Install HelpSpot. Usage: install [options] Options: --agree Agree to HelpSpots License Terms --name[=NAME] Full Name (first name last name) --admin-email[=ADMIN-EMAIL] Admin User Email Address ...and so on
Available Commands
Here are the commands available for HelpSpot:
- install
- update
- attachments:tofile
- automation:rules
- cache:clear
- config:convert
- mail:check
- portal:migrate
- request:delete
- request:delete-spam
- request:delete-trash
- report:logs
install
This will guide you through installing HelpSpot. For installing without prompts, you can use the available flags to provide the needed details.
# Interactive php hs install # Or prefill some or all options php hs install --agree --name="Jane Doe" --admin-email="jane@example.com" --password="secret" ...and so on
update
To update between HelpSpot 5 versions (e.g. 5.1.0 to 5.2.0), use the update
command.
# Update with prompt php hs update # Update with no prompt php hs update --yes
The update command is safe to run multiple times (don't worry about accidentally running it).
attachments:tofile
This command will allow you to save your file attachments from the database (the default location prior to HelpSpot version 4) to your server file system.
This command will delete file data from your database as it saves it to the disk. We highly suggest backing up your database before running this command.
# Prompted for attachment file path to use php hs attachments:tofile # Or provide the file attachment path: php hs attachments:tofile --path=storage/documents
automation:rules
You can run all Automation Rules, or specific Automation Rules by their ID. Their ID is found within HelpSpot when viewing the list of Automation Rules.
# Run all automation rules # Except those marked to run on a Custom Schedule php hs automation:rules # Run automation rule 1 # regardless of Custom Schedule setting php hs automation:rules --id=1 # Run automation rule 1 and 2 # regardless of Custom Schedule setting php hs automation:rules --id=1,2
cache:clear
HelpSpot uses some caching to save certain settings, configuration, and data to reduce database load. To clear the cache, you can run the following command:
php hs cache:clear
config:convert
When updating from HelpSpot 4 to HelpSpot 5, the config.php
file can be converted to a .env
file using this command:
# Assumes config.php file is present # Create a .env file from config.php file values php hs config:convert # Print the contents of the converted configuration # but do not create the .env file php hs config:convert --dump
mail:check
HelpSpot runs this command periodically via it's CRON task (Linux) or Scheduled Tasks (Windows).
This command fires off a queue job, which in turns checks configured/enabled mailboxes for new email.
You can check all Mailboxes, or specific Mailboxes by their ID. Their ID is found within HelpSpot when viewing the list of Email Mailboxes.
# Check all configured/enabled mailboxes php hs mail:check # Check mailbox id 1 php hs mail:check --id=1 # Check mailbox id 1 and 2 php hs mail:check --id=1,2
portal:migrate
This command will help move existing portals from the old HelpSpot 4 location to one appropriate for HelpSpot 5.
# Move portals, if it can php hs portal:migrate # Report on what changes the command would make # but don't make the changes php hs portal:migrate --dry-run
request:delete (-spam,-trash)
You can delete one specific request (and it's related data) by its ID:
# Delete request 1234 php hs request:delete --id=1234
You can delete all Spam as well, without using those requests to train the spam filter:
# Delete all spam, with prompt php hs request:delete-spam # Delete without prompting php hs requets:delete-spam --force
And you can delete requests in the Trash:
# No prompt, deletes trash. # Does use the Trash Delete Delay setting php hs request:delete-trash
Report: Logs
The report:logs command will export a CSV file of your helpspot request event logs to your data/documents/ directory.
php hs report:logs