Management commands
madbot is a Django application: besides Django’s own commands (migrate, createsuperuser, collectstatic…), it adds the commands below. Run them with the madbot entry point of the API package, for example madbot list_plugins. From a development checkout, prefix them with pixi run in api/.
Every command accepts Django’s common options, including --verbosity {0,1,2,3} and --help.
Services
Section titled “Services”celery
Section titled “celery”Start a Celery worker. When DEBUG is on, the worker restarts whenever the code changes.
Start Celery Beat, the scheduler of the periodic tasks, with the database scheduler of django-celery-beat. It warns when no periodic task exists: run create_periodic_tasks first.
Setup and maintenance
Section titled “Setup and maintenance”initialise_madbot_metadata_fields
Section titled “initialise_madbot_metadata_fields”Create or update the metadata schemas and the fields of the madbot referential in the database. Run it after each update of madbot.
create_periodic_tasks
Section titled “create_periodic_tasks”Delete all periodic tasks, then create the tasks of madbot:
| Task | Interval |
|---|---|
| Clear health checks task results | every hour |
| Close expired impersonation sessions | every hour |
| Cleanup node exports | every day |
reload_plugins
Section titled “reload_plugins”Read every installed plugin and store in the database its connection and settings schemas, its metadata object types and the mappings between its fields and the madbot metadata fields. Run it after installing, removing or updating a plugin.
list_plugins
Section titled “list_plugins”List the installed plugins by type, then say which plugins_api is imported: the released package or a local checkout.
| Option | Effect |
|---|---|
--type {connection,data,submission,metadata,all} | Only list one type of plugin (default: all). |
--verbosity 1 | Plugin names only. |
--verbosity 2 | Plugins grouped by type (default). |
--verbosity 3 | Plugins grouped by type, with details. |
cleanup_unverified_users
Section titled “cleanup_unverified_users”Delete the inactive accounts whose email address was never verified, once the confirmation period (ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS) is over, then delete the expired invitations.
rebuild_search_index
Section titled “rebuild_search_index”Configure and (re)populate the Meilisearch workspace_search index from the current database. Requires SEARCH_ENABLED=true and a reachable Meilisearch server; see Enable the global search and Start Meilisearch.
The command writes every searchable object, then removes documents for objects that no longer exist. It does not empty the index first, so the search keeps answering while it runs. Run it after enabling the search, and after upgrades that change filterable attributes. Day-to-day updates then go through Celery.
| Option | Effect |
|---|---|
--batch-size | Number of documents sent to Meilisearch per batch (default: 1000). |
Test data
Section titled “Test data”These commands create workspaces for development and tests. Do not run them on a production instance.
create_demo_workspace
Section titled “create_demo_workspace”Create a demo workspace for a user: an ISA structure (investigation, study, assay) with samples and data.
| Option | Effect |
|---|---|
-u, --username | Owner of the workspace. Required. |
create_load_workspace
Section titled “create_load_workspace”Generate a large and reproducible workspace, to test performance. Measure on a large workspace describes the profiles and what the command bypasses.
| Option | Effect |
|---|---|
--username | Owner of the workspace. Required. |
--profile {small,medium,large} | Predefined volume, refined by the options below (default: small). |
--root-nodes, --depth, --node-per-node | Shape of the trees. |
--data-per-node, --samples-per-node | Data and samples of each node. |
--metadata-per-object, --metadata-per-data | Metadata of nodes, samples and data. |
--members | Members invited besides the owner. |
--wide-nodes, --wide-node-size | Nodes with many samples and data, added under the root nodes. |
--plugin-fields [PLUGIN ...] | Plugins whose metadata fields are used besides madbot’s (default: ena). Without a value, only madbot fields. |
--plugin | Data plugin of the connection holding the data (default: the first installed data plugin). |
--seed | Seed of the generation. Drawn and printed when omitted. |
--name | Name of the workspace (default: derived from the profile and the seed). |
--force | Delete an existing workspace of the same name first. |
--dry-run | Print the planned volume without writing anything. |

