# Management commands

atfinity supports a list of management commands to make administrating your installation easier.

They are executed via **`./atfinity.sh COMMAND`**.

<table data-header-hidden><thead><tr><th width="381">Command</th><th>Description</th></tr></thead><tbody><tr><td>Command</td><td>Description</td></tr><tr><td><code>display_version</code><br><code>[-c TENANT_ID]</code></td><td>Display the current version of the software.<br><br>If tenant_id is also provided, the current version of that tenants configuration is also displayed.</td></tr><tr><td><code>display_changes</code><br><code>[-t TENANT_ID]</code></td><td>Display a table with the number of changes for all tenants.<br><br>If tenant_id is provided, just the changes for this tenant will be displayed.</td></tr><tr><td><code>case_overview</code></td><td>Display an overview of past and present cases, grouped by the processes. For clients with a fee based on the number of cases completed, we will ask you to send us the output of this command.</td></tr><tr><td><p><code>create_tenant</code></p><p><code>-s TENANT_SUBDOMAIN</code><br><code>[-t TENANT_TITLE]</code></p></td><td>Create a new tenant.</td></tr><tr><td><p><code>users --list</code></p><p><code>[--group GROUP_1]</code></p><p><code>[--role ROLE_1]</code><br><code>[--level LEVEL_1]</code></p></td><td>List all users in the system. Results can be filtered based on <code>group</code>, <code>role</code>, <code>level</code>.</td></tr><tr><td><p><code>users --create</code></p><p><code>--email EMAIL</code></p><p><code>--password PASSWORD</code><br><code>--first_name FIRST_NAME</code><br><code>--last_name LAST_NAME</code><br><code>--initials INITIALS</code><br><code>--level LEVEL</code><br><code>[--add-groups GROUP]</code><br><code>[--add-roles GROUP]</code></p></td><td>Create a new user in the system.</td></tr><tr><td><code>create_user</code><br><code>-u USER_EMAIL</code><br><code>-p PASSWORD</code><br><code>-t TENANT_ID</code><br><code>[--meta_admin]</code></td><td>Create a new user within the given tenant or (if user exists) reset password and update meta_admin status. (Deprecated)</td></tr><tr><td><code>create_tenant_and_user</code><br><code>-s TENANT_SUBDOMAIN</code><br><code>[-u USER_EMAIL]</code><br><code>[-p PASSWORD]</code><br><code>[-t TENANT_TITLE]</code></td><td>Create a new tenant with an attached meta admin user.</td></tr><tr><td><code>show_tenants�</code></td><td>List all tenants of the system.</td></tr><tr><td><code>zip_import ZIP_FILE_TO_IMPORT</code></td><td>Clear the current database and import a .zip with data and files. The .zip will first be copied into a shared folder with the docker container and then imported.</td></tr><tr><td><code>zip_export -o /import/data_and_files_export.zip</code><br><code>[--no_files]</code></td><td>Export all current data and files to a .zip. The .zip will appear in the <code>/import</code> folder as <code>data_and_files_export.zip</code>.</td></tr><tr><td><code>remove_old_tasks</code></td><td>Remove celery tasks (and their attachments) older than a week. We recommend running this periodically.</td></tr><tr><td><code>invalidate_cases</code></td><td>Invalidates all cases for all tenants and forces the rule engine to recalculate all cases and case results when a case is opened again</td></tr><tr><td><code>delete_all_cases_and_instances</code><br><code>-t TENANT_ID</code></td><td>Delete all cases and instances for a specific tenant</td></tr><tr><td><code>delete_all_data</code></td><td>Delete all case and instance data in the whole database.</td></tr><tr><td><code>delete_tenant</code><br><code>TENANT_ID1</code><br><code>[TENANT_ID2 ... TENANT_IDN]</code></td><td>Delete the tenants with the given ids.</td></tr><tr><td><code>make_order_consecutive</code><br><code>-t TENANT_ID</code></td><td>Make order consecutive for configuration items (e.g. Documents, Categories, Information, etc.) for the specified tenant.</td></tr><tr><td><code>clear_admin_logs -t TENANT_ID</code></td><td>Removes all the logs from the database for the given tenant</td></tr><tr><td><code>remove_pdfs_without_files</code></td><td>Deletes all PDFs that do not have files attached</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/deploying/management-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
