Console commands


Introduction

This page lists all the console commands available with TRAX LRS. To run a command, you must open a console and go to the root of the TRAX LRS application.

Then, enter php artisan followed by the name of the command. For example:

php artisan testsuite

If you are using Docker with Sail, enter sail followed by the name of the command. For example:

sail testsuite

Some commands take optional or required parameters which are detailed in this page. To add a parameter, enter -- followed by the name of the parameter, then = and finally its value. Strings should be entered with quotes. For example:

php artisan testsuite --section="Communication 1.3"

Some commands take options which are detailed in this page. An option has no value. To add an option, enter -- followed by the name of the option.

php artisan statements:validate --clear

Tasks

All the following console commands are used by the task manager of TRAX LRS. So if you need to run one of these commands, we recommend to use the task manager first.

statements:validate

This command validates the statements recorded into the database which have not been validated yet.

Param Constraint / Default Description
job Optional The ID of the job created by the task manager.
store Optional The slug of a store. When omitted, the store is asked.
Option Description
clear Delete invalid statements.

statements:pseudo

This command pseudonymize the statements recorded into the database which have not been pseudonymized yet.

Param Constraint / Default Description
job Optional The ID of the job created by the task manager.
store Optional The slug of a store. When omitted, the store is asked.
until Optional ISO 8601 Only statements recorded before this date are pseudonymized.

connect:pull

This command pulls data from a given source.

Param Constraint / Default Description
job Optional The ID of the job created by the task manager.
store Optional The slug of a store. When omitted, the store is asked.
connection Optional string: lrs, db, file A type of connection. When omitted, the type is asked.
service Optional string: statements, activities, activity-profiles, agents, agent-profiles, states The name of an xAPI service. When omitted, the service is asked, except when the type of connection is lrs, for which only statements are synchronized.
until Optional ISO 8601 Only data recorded before this date is synchronized.
authority_name String The name of authority to be assigned to the incoming statements.
authority_homepage URL The homePage of authority to be assigned to the incoming statements.
Option Description
validate_statements Check the xAPI pipeline options.
check_conflicts Check the xAPI pipeline options.
void_statements Check the xAPI pipeline options.
update_activities Check the xAPI pipeline options.
update_agents Check the xAPI pipeline options.
update_vocab Check the xAPI pipeline options.
update_activity_ids Check the xAPI pipeline options.
update_agent_ids Check the xAPI pipeline options.

connect:push

This command pushes data to a given source.

Param Constraint / Default Description
job Optional The ID of the job created by the task manager.
store Optional The slug of a store. When omitted, the store is asked.
connection Optional string: lrs, db, file A type of connection. When omitted, the type is asked.
service Optional string: statements, activities, activity-profiles, agents, agent-profiles, states The name of an xAPI service. When omitted, the service is asked, except when the type of connection is lrs, for which only statements are synchronized.
until Optional ISO 8601 Only data recorded before this date is synchronized.
Option Description
raw Export only the statements raw definition.
sync_updates Use the updated timestamp (not the stored timestamp) to synchronize data.
pseudonymize_statements Check the xAPI pipeline options.

database:clear

This command deletes data from a given service database and until a given date.

Param Constraint / Default Description
job Optional The ID of the job created by the task manager.
store Optional The slug of a store. When omitted, the store is asked.
service Optional string: statements, activities, activity-profiles, agents, agent-profiles, states The name of an xAPI service. When omitted, the service is asked.
until Optional ISO 8601 Only data recorded before this date is deleted.

agents:delete

This command deletes all the data referring to a given agent.

Param Constraint / Default Description
job Optional The ID of the job created by the task manager.
store Optional The slug of a store. When omitted, the store is asked.
service Optional string: statements, agents, agent-profiles, states The name of an xAPI service. When omitted, the service is asked.
agents Required List of agents to be deleted (string ID format separated by commas: mbox::john@doe.com,mbox::mike@pen.com).

seed

This command records fake xAPI data into the database.

Param Constraint / Default Description
job Optional The ID of the job created by the task manager.
store Optional The slug of a store. When omitted, the store is asked.
config String, default is default Name of a configuration file.

testsuite

This command launches the ADL LRS conformance test suite.

Param Constraint / Default Description
job Optional The ID of the job created by the task manager.
client Optional The slug of a client. When omitted, the client is asked.
section Optional string An xAPI section to focus on.

logs:delete

This command deletes the logs from the database.

Param Constraint / Default Description
job Optional The ID of the job created by the task manager.
store Optional The slug of a store. When omitted, logs from all the stores are deleted.
max-level Int: 0 (debug), 1 (info), 2 (notice), 3 (warning), 4 (error), 5 (critical), 6 (alert), 7 (emergency) Logs up to this level are deleted. When omitted, the max level is asked.
until Optional ISO 8601 Only logs recorded before this date are deleted.

stores:delete

This command deletes a store and all its related data.

Param Constraint / Default Description
job Optional The ID of the job created by the task manager.
store Optional The slug of a store. When omitted, the store is asked. The last store can't be deleted.

cmi5:delete-tokens

This command deletes the existing CMI5 tokens.

Param Constraint / Default Description
job Optional The ID of the job created by the task manager.
store Optional The slug of a store. When omitted, tokens from all the stores are deleted.
until Optional ISO 8601 Only tokens recorded before this date are deleted.

Utilities

Below are some useful commands which are usually used during the installation process. So of them come from the Laravel framework, others are specific to TRAX LRS.

key:generate

This command is provided by Laravel. It generates a value for the APP_KEY configuration variable, which is used for encryption and security purposes in Laravel. This command must be run during the installation procedure.

config:cache

This command is provided by Laravel. It puts the application configuration in cache. This command should be run on a production server during the installation procedure.

config:clear

This command is provided by Laravel. It clears the configuration cache. This command should be run before running unit tests.

schedule:run

This command is provided by Laravel. It should be run by a CRON job every minute. To know more, check the installation procedure.

schedule:work

This command is provided by Laravel. It is similar to the schedule:run command but can be run directly in the console for testing purpose.

database:drop

This command drops the existing database(s) (if any).

Option Description
force Run the command without asking for confirmation.

database:install

This command clears the existing database(s) (if any), run the initial migrations and populates some data such as a default admin user and a default client.

Option Description
force Run the command without asking for confirmation.

database:status

This command checks the database of a given service.

Param Constraint / Default Description
service Optional: activities, activity-profiles, agents, agent-profiles, auth, commands, logging, statements, vocab, states The name of a service. When omitted, the service is asked.

services:check

This command checks the status of all the services, including their database when they have one.

docker:compose

This command creates configuration files for Laravel and Docker. Please, check the Docker documentation page to go further.

Listeners

The following commands are listeners which must be launched if you are deploying TRAX LRS as a set of micro-services.

activities:update

This command belongs to the activities service. It listens to the statements-recorded event emitted by the statements service on the statements-store stream. Then, it records or updates the extracted activity definitions.

Param Constraint / Default Description
workers Optional int, default is 1 Number of workers to be launched.
Option Description
daemon Run the worker in the background.
keep-alive Continue to listen events when something fails.
status Show the status of the worker(s).
stop Stop the worker(s).

agents:update

This command belongs to the agents service. It listens to the statements-recorded event emitted by the statements service on the statements-store stream. Then, it records or updates the extracted agent definitions.

Param Constraint / Default Description
workers Optional int, default is 1 Number of workers to be launched.
Option Description
daemon Run the worker in the background.
keep-alive Continue to listen events when something fails.
status Show the status of the worker(s).
stop Stop the worker(s).

vocab:update

This command belongs to the vocab service. It command listens to:

  • The statements-recorded event emitted by the statements service on the statements-store stream
  • The activities-updated event emitted by the activities service on the activities-store stream
  • The agents-updated event emitted by the agents service on the agents-store stream
  • The activity-profiles-updated event emitted by the activity profiles service on the activity-profiles-store stream
  • The agent-profiles-updated event emitted by the agent profiles on the agent-profiles-store stream
  • The states-updated event emitted by the states service on the states-store stream

Then, it records or updates the extracted xAPI vocabulary, including verbs, activity types, statement categories and document IDs.

Param Constraint / Default Description
workers Optional int, default is 1 Number of workers to be launched.
Option Description
daemon Run the worker in the background.
keep-alive Continue to listen events when something fails.
status Show the status of the worker(s).
stop Stop the worker(s).

logs:catch

This command belongs to the logging service. It listens to the log-sent event emitted by any service on the logs stream. Then, it records the logs into the database.

Param Constraint / Default Description
workers Optional int, default is 1 Number of workers to be launched.
Option Description
daemon Run the worker in the background.
keep-alive Continue to listen events when something fails.
status Show the status of the worker(s).
stop Stop the worker(s).

Testing

test

This command is provided by Laravel. It runs the PHP Unit Tests.

Param Constraint / Default Description
testsuite Optional string The name of a testsuite to be run: activities, activity-profiles, agents, agent-profiles, auth, commands, dev, vocab, framework, logging, statements, states.

dev:dispatch

This command emits a series of events named event on the test stream.

dev:listen

This command belongs to the dev service. It listens to the event event emitted by the dev service on the test stream.

Param Constraint / Default Description
workers Optional int, default is 1 Number of workers to be launched.
Option Description
daemon Run the worker in the background.
keep-alive Continue to listen events when something fails.
status Show the status of the worker(s).
stop Stop the worker(s).