# TYPO3 — The TYPO3 CMS Command Line

> Practical guide to the TYPO3 CLI (v13 LTS): manage caches, database, extensions, sites, scheduler and upgrades via vendor/bin/typo3.

Source: https://www.jpkc.com/db/en/cheatsheets/build-languages/typo3/

<!-- PROSE:intro -->
TYPO3 is a long-established open-source enterprise CMS for professional websites – and its command line is your most important tool for maintenance, deployment and automation. Through `vendor/bin/typo3` (Composer installation) or `typo3/sysext/core/bin/typo3` (Classic Mode) you control caches, the database schema, extensions, sites and the scheduler without ever opening the backend. This guide gathers the commands you reach for most in day-to-day work and in CI/CD pipelines – from `cache:flush` to complete deployment recipes.
<!-- PROSE:intro:end -->

## Command Paths

`vendor/bin/typo3 <command>` — Composer-based installation (recommended). Run from the project root.

```bash
vendor/bin/typo3 cache:flush
```

`typo3/sysext/core/bin/typo3 <command>` — Classic (non-Composer) installation. Run from the document root.

```bash
typo3/sysext/core/bin/typo3 cache:flush
```

`ddev typo3 <command>` — DDEV local development environment. Runs inside the DDEV web container.

```bash
ddev typo3 cache:flush
```

`typo3 list` — List all available console commands.

```bash
vendor/bin/typo3 list
```

`typo3 <command> --help` — Show detailed help and available options for a specific command.

```bash
vendor/bin/typo3 cache:flush --help
```

`typo3 list --format=json` — List all commands in JSON format for scripting.

```bash
vendor/bin/typo3 list --format=json
```

## Setup & Installation

`typo3 setup` — Interactive setup wizard. Creates database, admin user, and base configuration.

```bash
vendor/bin/typo3 setup
```

`typo3 setup --driver=mysqli --dbname=<db> --username=<user> --password=<pass> --host=<host>` — Non-interactive setup with database credentials.

```bash
vendor/bin/typo3 setup --driver=mysqli --dbname=typo3 --username=root --password=root --host=db
```

`typo3 setup --admin-username=<user> --admin-user-password=<pass> --admin-email=<email>` — Setup with admin credentials in non-interactive mode.

```bash
vendor/bin/typo3 setup --admin-username=admin --admin-user-password=Password1! --admin-email=admin@example.com
```

`typo3 setup --server-type=apache` — Setup with a specific web server type (apache or other).

```bash
vendor/bin/typo3 setup --server-type=apache
```

## Cache Management

`typo3 cache:flush` — Flush all caches. The most commonly used TYPO3 command.

```bash
vendor/bin/typo3 cache:flush
```

`typo3 cache:flush --group=pages` — Flush only the page caches.

```bash
vendor/bin/typo3 cache:flush --group=pages
```

`typo3 cache:flush --group=system` — Flush only system caches (configuration, DI container, etc.).

```bash
vendor/bin/typo3 cache:flush --group=system
```

`typo3 cache:flush --group=di` — Flush the dependency injection container cache.

```bash
vendor/bin/typo3 cache:flush --group=di
```

`typo3 cache:warmup` — Warm up all caches. Rebuilds cached data for faster first requests.

```bash
vendor/bin/typo3 cache:warmup
```

`typo3 cache:warmup --group=system` — Warm up only system caches.

```bash
vendor/bin/typo3 cache:warmup --group=system
```

## Database

`typo3 database:updateschema` — Update the database schema based on TCA and ext_tables.sql. Interactive by default.

```bash
vendor/bin/typo3 database:updateschema
```

`typo3 database:updateschema '*.add,*.change'` — Only add new fields/tables and change existing fields (safe operations).

```bash
vendor/bin/typo3 database:updateschema '*.add,*.change'
```

`typo3 database:updateschema '*.drop'` — Only drop unused tables and fields (destructive, use with caution).

```bash
vendor/bin/typo3 database:updateschema '*.drop'
```

`typo3 database:updateschema '*'` — Apply all schema changes including adds, changes, and drops.

```bash
vendor/bin/typo3 database:updateschema '*'
```

`typo3 database:updateschema --dry-run` — Preview what schema changes would be applied without executing them.

```bash
vendor/bin/typo3 database:updateschema --dry-run
```

`typo3 database:export` — Export the database to stdout as SQL. Pipe to a file for backups.

```bash
vendor/bin/typo3 database:export > backup.sql
```

`typo3 database:import < <file>` — Import a SQL file into the database via stdin.

```bash
vendor/bin/typo3 database:import < backup.sql
```

## Extension Management

`typo3 extension:list` — List all available extensions with their status (active/inactive).

```bash
vendor/bin/typo3 extension:list
```

`typo3 extension:setup` — Set up all active extensions (run ext_tables.sql, import data, etc.).

```bash
vendor/bin/typo3 extension:setup
```

`typo3 extension:setup --extension=<ext_key>` — Set up a specific extension.

```bash
vendor/bin/typo3 extension:setup --extension=news
```

`typo3 extension:deactivate <ext_key>` — Deactivate an extension (Classic Mode only, Composer uses composer require/remove).

```bash
typo3/sysext/core/bin/typo3 extension:deactivate indexed_search
```

`typo3 extension:activate <ext_key>` — Activate an extension (Classic Mode only).

```bash
typo3/sysext/core/bin/typo3 extension:activate indexed_search
```

## Site Management

`typo3 site:list` — List all configured sites with their identifiers and base URLs.

```bash
vendor/bin/typo3 site:list
```

`typo3 site:show <identifier>` — Show the full YAML configuration of a specific site.

```bash
vendor/bin/typo3 site:show main
```

## Language & Localization

`typo3 language:update` — Download and update all language packs for installed extensions.

```bash
vendor/bin/typo3 language:update
```

`typo3 language:update <locale>` — Update language packs for a specific locale only.

```bash
vendor/bin/typo3 language:update de
```

## Upgrade Wizards

`typo3 upgrade:list` — List all available upgrade wizards and their status (done/not done).

```bash
vendor/bin/typo3 upgrade:list
```

`typo3 upgrade:run` — Run all pending upgrade wizards interactively.

```bash
vendor/bin/typo3 upgrade:run
```

`typo3 upgrade:run <identifier>` — Run a specific upgrade wizard by its identifier.

```bash
vendor/bin/typo3 upgrade:run sysLogChannel
```

`typo3 upgrade:run --confirm=all` — Run all pending upgrade wizards non-interactively (auto-confirm).

```bash
vendor/bin/typo3 upgrade:run --confirm=all
```

`typo3 upgrade:mark-undone <identifier>` — Mark an upgrade wizard as undone so it can be run again.

```bash
vendor/bin/typo3 upgrade:mark-undone sysLogChannel
```

## Reference Index & Cleanup

`typo3 referenceindex:update` — Update the sys_refindex table. Ensures correct reference tracking between records.

```bash
vendor/bin/typo3 referenceindex:update
```

`typo3 cleanup:deletedrecords` — Permanently remove all soft-deleted records from the database.

```bash
vendor/bin/typo3 cleanup:deletedrecords
```

`typo3 cleanup:orphanrecords` — Remove orphaned records that have no valid parent page.

```bash
vendor/bin/typo3 cleanup:orphanrecords
```

`typo3 cleanup:missingfiles` — Find sys_file records that reference non-existing files on disk.

```bash
vendor/bin/typo3 cleanup:missingfiles
```

`typo3 cleanup:lostfiles` — Find files in fileadmin that are not referenced in the database.

```bash
vendor/bin/typo3 cleanup:lostfiles
```

`typo3 cleanup:multiplereferencedfiles` — Find files that are referenced by multiple records when they should be unique copies.

```bash
vendor/bin/typo3 cleanup:multiplereferencedfiles
```

`typo3 cleanup:flexforms` — Clean up FlexForm data by removing fields not defined in the data structure.

```bash
vendor/bin/typo3 cleanup:flexforms
```

`typo3 cleanup:missingrelations` — Find and report database relations pointing to non-existing records.

```bash
vendor/bin/typo3 cleanup:missingrelations
```

## Scheduler & Tasks

`typo3 scheduler:run` — Execute all due scheduled tasks. Typically called via system cron.

```bash
vendor/bin/typo3 scheduler:run
```

`typo3 scheduler:run --task=<uid>` — Execute a specific scheduled task by its UID.

```bash
vendor/bin/typo3 scheduler:run --task=5
```

`typo3 scheduler:run --force` — Force execution of tasks regardless of their scheduled time.

```bash
vendor/bin/typo3 scheduler:run --force
```

## Redirects (EXT:redirects)

`typo3 redirects:checkintegrity` — Check all redirects for conflicts (loops, duplicates, clashing with existing pages).

```bash
vendor/bin/typo3 redirects:checkintegrity
```

`typo3 redirects:cleanup` — Clean up redirect records (remove duplicates and invalid entries).

```bash
vendor/bin/typo3 redirects:cleanup
```

## Mailer & Spool

`typo3 mailer:spool:send` — Send all queued (spooled) emails. Used when TYPO3 is configured to spool mail.

```bash
vendor/bin/typo3 mailer:spool:send
```

`typo3 mailer:spool:send --message-limit=<n>` — Send a limited number of spooled emails per run.

```bash
vendor/bin/typo3 mailer:spool:send --message-limit=50
```

`typo3 mailer:spool:send --time-limit=<seconds>` — Stop sending after a time limit to prevent long-running processes.

```bash
vendor/bin/typo3 mailer:spool:send --time-limit=30
```

## Backend Users & Sessions

`typo3 backend:lock` — Lock the TYPO3 backend. Prevents all backend logins (maintenance window).

```bash
vendor/bin/typo3 backend:lock
```

`typo3 backend:unlock` — Unlock the TYPO3 backend after maintenance.

```bash
vendor/bin/typo3 backend:unlock
```

`typo3 backend:resetpassword <email>` — Send a password reset email to a backend user.

```bash
vendor/bin/typo3 backend:resetpassword admin@example.com
```

`typo3 backend:createadmin` — Interactively create a new backend admin user.

```bash
vendor/bin/typo3 backend:createadmin
```

`typo3 backend:createadmin --username=<user> --password=<pass> --email=<email>` — Create a backend admin user non-interactively.

```bash
vendor/bin/typo3 backend:createadmin --username=admin --password=Password1! --email=admin@example.com
```

## Deployment & CI/CD Recipes

`typo3 cache:flush && typo3 database:updateschema '*.add,*.change' && typo3 upgrade:run --confirm=all && typo3 cache:warmup` — Typical deployment pipeline: flush caches, update DB schema (safe only), run upgrades, warm caches.

```bash
vendor/bin/typo3 cache:flush && vendor/bin/typo3 database:updateschema '*.add,*.change' && vendor/bin/typo3 upgrade:run --confirm=all && vendor/bin/typo3 cache:warmup
```

`typo3 extension:setup && typo3 language:update && typo3 referenceindex:update` — Post-deployment: set up extensions, update translations, rebuild reference index.

```bash
vendor/bin/typo3 extension:setup && vendor/bin/typo3 language:update && vendor/bin/typo3 referenceindex:update
```

`typo3 backend:lock && <deploy> && typo3 backend:unlock` — Lock backend during deployment, then unlock when finished.

```bash
vendor/bin/typo3 backend:lock && git pull && composer install && vendor/bin/typo3 cache:flush && vendor/bin/typo3 backend:unlock
```

<!-- PROSE:outro -->
## Conclusion

The TYPO3 command line takes care of maintenance and deployment work that would be tedious or outright impossible in the backend. Treat its powerful commands with respect, though: always create a database backup before `database:updateschema`, before `cache:flush` on production, and before `upgrade:run`, and never run `*.drop` carelessly. Also make sure you run the CLI as the correct web server user so that file permissions and cache directories stay consistent – if the scheduler cron or `extension:setup` runs as a different user, permission problems are guaranteed. Handled this way, the console becomes the reliable backbone of your TYPO3 automation.

## Further Reading

- [TYPO3 Documentation](https://docs.typo3.org/) – official documentation for core and extensions
- [typo3.org](https://typo3.org/) – official project site, association and community
<!-- PROSE:outro:end -->

## Related Commands

- [artisan](https://www.jpkc.com/db/en/cheatsheets/build-languages/artisan/) – the command line of the Laravel PHP framework
- [cargo](https://www.jpkc.com/db/en/cheatsheets/build-languages/cargo/) – Rust's package manager and build tool
- [composer](https://www.jpkc.com/db/en/cheatsheets/build-languages/composer/) – dependency manager for PHP projects

