[命令行]

本节介绍ThinkCMF命令行程序相关基础知识。

在命令行切换到ThinkCMF根目录(注意是think文件所在目录,不是public目录),执行如下命令:

  1. php think

以上命令会输出项目下所有命令行程序:

  1. ThinkPHP v6.0.12LTS & ThinkCMF v6.0.5
  2. Usage:
  3. command [options] [arguments]
  4. Options:
  5. -h, --help Display this help message
  6. -V, --version Display this console version
  7. -q, --quiet Do not output any message
  8. --ansi Force ANSI output
  9. --no-ansi Disable ANSI output
  10. -n, --no-interaction Do not ask any interactive question
  11. -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
  12. Available commands:
  13. clear Clear runtime file
  14. cli List lightweight CLI commands
  15. help Displays help for a command
  16. list Lists commands
  17. run PHP Built-in Server for ThinkPHP
  18. version Show ThinkPHP & ThinkCMF version
  19. migrate
  20. migrate:create Create a new migration
  21. migrate:run Execute database migration
  22. publish
  23. publish:app Publish a ThinkCMF app
  24. publish:plugin Publish a ThinkCMF plugin
  25. publish:theme Publish a ThinkCMF theme
  26. service
  27. service:discover Discover Services for ThinkPHP
  28. vendor
  29. vendor:publish Publish any publishable assets from vendor packages

命令行执行的一般格式如下:

  1. php think 命令 [参数]