COMMANDS.md

October 31, 2016 ยท View on GitHub

<-- Back to main section

Commands

Special commands

CommandDescription
ct self-updateUpdate ct command (download new version)
ct updateUpdates all system components, ssh configuration, ct command update etc.
ct makeSearch for "Makefile" in tree and start "make" in this directory

System commands

CommandDescription
ct shutdown (alias)Shutdown system

Log commands

All log commands are using a grep-filter (specified as optional argument)

CommandDescription
ct log:mailShows mail logs

Docker commands

CommandDescription
ct docker:createCreate new docker boilerplate in directory (first argument)
ct docker:create projectname -> Create new docker boilerplate instance in directory "projectname"
ct docker:create projectname --code=git@github.com/foo/bar -> Create new docker boilerplate instance in directory "projectname" and git code repository
ct docker:create projectname --docker=git@github.com/foo/bar -> Create new docker boilerplate instance in directory "projectname" and custom docker boilerplate repository
ct docker:create projectname --code=git@github.com/foo/bar --make=build -> Create new docker boilerplate instance in directory "projectname" and git code repository, will run automatic make (Makefile) task "build" after checkout
ct docker:shellJump into a shell inside a docker container (using predefined user defined with CLI_USER in docker env)
ct docker:shell -> enter main container
ct docker:shell mysql -> enter mysql container
__ct docker:shell --user=www-data -> enter main container as user www-data
ct docker:rootJump into a shell inside a docker container as root user
ct docker:mysqlJump into a mysql client inside a docker container
ct docker:mysql -> execute mysql client inside main container
ct docker:sniffStart network sniffer for various protocols
ct docker:sniff http -> start HTTP sniffing
ct docker:execExecute command in docker container
ct docker:exec ps -> run 'ps' inside main container
ct docker:cliExecute special cli command in docker container
ct docker:cli scheduler -> run 'scheduler' in TYPO3 CMS
ct docker:composeExecute docker-compose (recursive up-searching for docker-compose.yml)
ct docker:compose ps -> list all running docker-compose containers

MySQL commands

CommandDescription
ct mysql:clearClear database (remove all tables in database)
ct mysql:clear typo3
ct mysql:connectionsLists all current connections
ct mysql:createCreate (and drops if already exists) a database
ct mysql:create typo3
ct mysql:debugShows mysql debug log (lists all queries) with basic filter support
ct mysql:debug (full log)
ct mysql:debug tt_content (full log)
ct mysql:slowlogShows mysql slow log
ct mysql:slowlog (show slow queries with 1 sec and more)
ct mysql:slowlog --time=10 (show slow queries with 10 sec and more)
ct mysql:slowlog --no-index (show not using index and slow (1sec) queries)
ct mysql:dropDrops a database
ct mysql:drop typo3
ct mysql:listLists all databases with some statitics
ct mysql:restartRestart MySQL server
ct mysql:backupBackup a database to file
Compression type will be detected from file extension (default plain sql)
ct mysql:restore typo3 dump.sql -> plain sql dump
ct mysql:restore typo3 dump.sql.gz -> gzip'ed sql dump
ct mysql:restore typo3 dump.sql.bzip2 -> bzip2'ed sql dump
ct mysql:restore typo3 dump.sql.xz -> xz'ed (lzma'ed) sql dump
ct mysql:restore typo3 dump.sql --filter=typo3 -> No TYPO3 cache tables in dump
ct mysql:restoreCreate (and drops if already exists) a database and restore from a dump
Dump file can be plaintext, gzip, bzip2 or lzma compressed
and will automatically detected
ct mysql:restore typo3 dump.sql.bz2
ct mysql:convertConvert character set and collation of a database
ct mysql:convert typo3 -> Convert typo3 into UTF-8 with utf8_general_ci
ct mysql:convert typo3 --charset=latin1 -> Convert typo3 into LATIN-1
ct mysql:convert typo3 --collation=utf8_unicode_ci -> Convert typo3 into UTF-8 with utf8_unicode_ci
ct mysql:convert typo3 --stdout -> Print sql statements to stdout

Sync commands

CommandDescription
ct sync-initCreate example clisync.yml in current working directory and open file for editing
ct sync serverSearch for clisync.yml in tree and start server synchronization (eg. from live or preview to local development instance
ct sync production -> Use "production" configuration and start sync
ct sync preview --rsync -> Use "preview" configuration and start only rsync
ct sync staging --mysql -> Use "staging" configuration and start only mysql sync
ct deploy serverSearch for clisync.yml in tree and start server deployment (eg. from local development to live or preview environment
ct deploy production -> Use "production" configuration and start deployment
ct deploy preview --rsync -> Use "preview" configuration and start only rsync
ct deploy staging --mysql -> Use "staging" configuration and start only mysql sync
ct share:backupSearch for clisync.yml in tree and start backup to shared server
ct share:backup -> Backup files and database from share
ct share:backup --rsync -> Backup only files from share
ct share:backup --mysql -> Backup only database from share
ct share:restoreSearch for clisync.yml in tree and start restore from shared server
ct share:restore -> Restore files and database from share
ct share:restore --rsync -> Restore only files from share
ct share:restore --mysql -> Restore only database from share

PHP commands

CommandDescription
ct php:traceTrace syscalls from one or all PHP processes (strace)
ct php:trace --all -> Trace all php processes immediately
ct php:composerSearch for "composer.yml" in tree and start "composer" in this directory

Samba commands

CommandDescription
ct samba:restartRestart Samba server

System commands

CommandDescription
ct system:envLists common environment variables
ct system:openfilesLists current open files count grouped by process
ct system:shutdownShutdown system
ct system:swapShow swap usage for running processes
ct system:updateUpdates all system components, ssh configuration, ct command update etc.
ct system:versionShows version for common packages

TYPO3 commands

CommandDescription
ct typo3:beuserInjects a dev user (pass dev) to all or one specified TYPO3 database
ct typo3:beuser
ct typo3:beuser typo3
ct typo3:cleanupCleanup command tables to same some table space
ct typo3:cleanup
ct typo3:cleanup typo3
ct typo3:domainAdd default suffix to all domains (default: .vm)
ct typo3:domain --baseurl Also update config.baseURL in SetupTS
ct typo3:domain --list Print list of domains and exit
ct typo3:domain --remove='*.vagrantshare.com' Remove all *.vagrantshare.com domains (used by vagrant:share command)
ct typo3:domain --duplicate='foobar.vagrantshare.com' Duplicates all domains and add suffix 'foobar.vagrantshare.com' (used by vagrant:share command)

Vagrant commands

CommandDescription
ct vagrant:shareStart sharing (with some workflow stuff) (ALPHA! not finished!)

User commands

CommandDescription
ct user:rebuildsshconfigRebuild SSH config from ct repository (/vagrant/provision/sshconfig)