Command-line reference

Look up the syntax, requirements, and effects of each bundled command.

Choose the task that matches what you need to do. The pages explain the relevant workflow and link to related guides and reference material. Examples use the local site garden; use your own site name and check the command’s scope before running it.

Find help and available commands

Run bin/zotonic from the checkout root to see the available commands. Consult this guide's Command-line reference collection for their arguments and effects.

Use task-specific commands instead of guessing flags from other tools. For example, dispatch accepts a site name or URL, while rpc passes trailing arguments as strings rather than parsing Erlang expressions.

Before running a command, identify its scope: the entire node, one site, a local file, or an external browser. Configuration commands can display secrets; inspect output locally and redact it before sharing.

The launcher and the server must agree on their node configuration and authentication. A connection error is not proof that a site's code failed to compile. See Connect to the running Erlang shell.

Edit on GitHub

In this section

  1. 1addsite: Create a site application from a skeletonCreate a site application from a skeleton.
  2. 2backup: List, create, or restore backupsList, create, or restore backups.
  3. 3chrome: Open a site in ChromeOpen a site in Chrome.
  4. 4chromium: Open a site in ChromiumOpen a site in Chromium.
  5. 5compile: Request recompilation on the running nodeRequest recompilation on the running node.
  6. 6compilefile: Recompile one Erlang source fileRecompile one Erlang source file.
  7. 7config: Display configuration resolved from filesDisplay configuration resolved from files.
  8. 8configfiles: List selected global configuration filesList selected global configuration files.
  9. 9configtest: Check whether global configuration files can be readCheck whether global configuration files can be read.
  10. 10connectdb: Test the configured PostgreSQL connectionTest the configured PostgreSQL connection.
  11. 11createdb: Prepare a site database and schemaPrepare a site database and schema.
  12. 12debug: Start Zotonic in the foreground with an Erlang shellStart Zotonic in the foreground with an Erlang shell.
  13. 13decrypt: Decrypt a local encrypted backup fileDecrypt a local encrypted backup file.
  14. 14dispatch: Inspect dispatch rules or trace a URLInspect dispatch rules or trace a URL.
  15. 15etop: Inspect active Erlang processesInspect active Erlang processes.
  16. 16flush: Flush site cachesFlush site caches.
  17. 17load: Load changed BEAM filesLoad changed BEAM files.
  18. 18logtail: Print recent lines from a configured log filePrint recent lines from a configured log file.
  19. 19open: Open the site URL in a browserOpen the site URL in a browser.
  20. 20pot: Generate gettext translation template filesGenerate gettext translation template files.
  21. 21resetratelimit: Reset a site rate limiterReset a site rate limiter.
  22. 22restart: Restart Zotonic and all sites within the current VMRestart Zotonic and all sites within the current VM.
  23. 23restartsite: Restart one siteRestart one site.
  24. 24rpc: Call an exported Erlang function on the nodeCall an exported Erlang function on the node.
  25. 25runtests: Run selected core test modulesRun selected core test modules.
  26. 26setconfig: Set a global runtime Zotonic valueSet a global runtime Zotonic value.
  27. 27shell: Connect an Erlang shell to the running nodeConnect an Erlang shell to the running node.
  28. 28siteconfig: Display a site configuration resolved from filesDisplay a site configuration resolved from files.
  29. 29siteconfigfiles: List configuration files selected for a siteList configuration files selected for a site.
  30. 30sitedir: Show a site application directoryShow a site application directory.
  31. 31sitetest: Run site tests using an isolated test schemaRun site tests using an isolated test schema.
  32. 32start: Start Zotonic in the backgroundStart Zotonic in the background.
  33. 33start_nodaemon: Start Zotonic in the foreground without an interactive shellStart Zotonic in the foreground without an interactive shell.
  34. 34startsite: Start a selected site on the nodeStart a selected site on the node.
  35. 35status: Show node and site stateShow node and site state.
  36. 36stop: Stop the Zotonic nodeStop the Zotonic node.
  37. 37stopsite: Stop one siteStop one site.
  38. 38update: Compile, load, flush, and rescan the serverCompile, load, flush, and rescan the server.
  39. 39wait: Wait until the node answers a pingWait until the node answers a ping.

Also in: Developer guide

Referred by

Reference

The addsite command

Adding a site to Zotonic is done through the zotonic shell command. It syntax is like this:

Developer guide

The Zotonic workspace

The checkout is an Erlang umbrella project: one build contains many applications.