cli.rst 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. .. _commandline:
  2. Command Line Interface
  3. ======================
  4. Here you find the documentation about FlaskBB's Command Line Interface.
  5. The command line is provided by click.
  6. To get help for a commands, just type ``flaskbb COMMAND --help``.
  7. If no command options or arguments are used it will print out all
  8. available commands
  9. .. sourcecode:: text
  10. Usage: flaskbb [OPTIONS] COMMAND [ARGS]...
  11. This is the commandline interface for flaskbb.
  12. Options:
  13. --help Show this message and exit.
  14. Commands:
  15. db Perform database migrations.
  16. install Interactively setup flaskbb.
  17. plugins Plugins command sub group.
  18. populate Creates the database with some test data.
  19. run Runs a development server.
  20. setup Runs a preconfigured setup for FlaskBB.
  21. shell Runs a shell in the app context.
  22. start Starts a production ready wsgi server.
  23. themes Themes command sub group.
  24. translations Translations command sub group.
  25. upgrade Updates the migrations and fixtures.
  26. users Create, update or delete users.
  27. Commands
  28. --------
  29. You can find a complete overview, including the ones from the sub groups,
  30. below.
  31. .. program:: flaskbb
  32. .. option:: install
  33. Installs flaskbb. If no arguments are used, an interactive setup
  34. will be run.
  35. .. option:: upgrade
  36. Updates the migrations and fixtures to the latest version.
  37. .. option:: --all, -a
  38. Upgrades migrations AND fixtures to the latest version.
  39. .. option:: --fixture FIXTURE, -f FIXTURE
  40. The fixture which should be upgraded or installed.
  41. All fixtures have to be places inside flaskbb/fixtures/
  42. .. option:: --force-fixture, -ff
  43. Forcefully upgrades the fixtures. WARNING: This will also overwrite
  44. any settings.
  45. .. option:: populate
  46. Creates the necessary tables and groups for FlaskBB.
  47. .. option:: --test, -t
  48. Adds some test data.
  49. .. option:: --posts
  50. Number of posts to create in each topic (default: 100).
  51. .. option:: --topics
  52. Number of topics to create (default: 100).
  53. .. option:: --force, -f
  54. Will delete the database before populating it.
  55. .. option:: runserver
  56. Starts the development server
  57. .. option:: start
  58. Starts a production ready wsgi server.
  59. TODO: Unsure about this command, would 'serve' or 'server' be better?
  60. .. option:: --server SERVER
  61. Defaults to gunicorn. The following WSGI Servers are supported:
  62. - gunicorn (default)
  63. - TODO
  64. .. option:: shell
  65. Creates a python shell with an app context.
  66. .. option:: translations
  67. Translations command sub group.
  68. .. option:: add LANGUAGE_CODE
  69. Adds a new language to FlaskBB's translations.
  70. The ``LANGUAGE_CODE`` is the short identifier for the language i.e.
  71. '``en``', '``de``', '``de_AT``', etc.
  72. .. option:: -p, --plugin PLUGIN_NAME
  73. Adds a new language to a plugin.
  74. .. option:: update
  75. Updates all translations, including the ones from the plugins.
  76. Use -p <PLUGIN_NAME> to only update the translation of a given
  77. plugin.
  78. .. option:: -p, --plugin PLUGIN_NAME
  79. Update the language of the given plugin.
  80. .. option:: compile
  81. Compiles all translations, including the ones from the plugins.
  82. .. option:: -p, --plugin PLUGIN_NAME
  83. Compiles only the given plugin translation.
  84. .. option:: plugins
  85. Plugins command sub group.
  86. .. option:: create PLUGIN_NAME
  87. Creates a basic starter template for a new plugin.
  88. .. option:: add PLUGIN_NAME
  89. Adds a new plugin.
  90. .. option:: remove PLUGIN_NAME
  91. Removes a plugin.
  92. .. option:: themes
  93. Themes command sub group.
  94. .. option:: create THEME_NAME
  95. Creates a basic starter template for a new theme.
  96. .. option:: add THEME_NAME
  97. Adds a new theme.
  98. .. option:: remove THEME_NAME
  99. Removes a theme.
  100. .. option:: users
  101. Creates a new user. Pass any arguments to omit the interactive mode.
  102. .. option:: -g, --group GROUP
  103. Uses ``GROUP`` as the primary group.
  104. .. option:: -u, --username USERNAME
  105. Uses ``USERNAME`` as the name of the new user.
  106. .. option:: -p, --password PASSWORD
  107. Uses ``PASSWORD`` as password for the new user. But you have to ḱnow,
  108. that when choosing this option, the password is most likely stored
  109. in a history file (i.e. ``.bash_history``).
  110. .. option:: -e, --email EMAIL
  111. Uses ``EMAIL`` as the email address for the new user.