Working from the command line

Use the shell and CLI to inspect and manage a development installation.

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.

In this section

  1. 1Command-line referenceLook up the syntax, requirements, and effects of each bundled command.
  2. 2Start in the foreground or backgroundChoose a startup mode for the environment:
  3. 3Find the status site and your site's adminThe status site manages the running Zotonic installation. A site's /admin manages that site's content and enabled modules. They have different scopes and can use different credentials.
  4. 4Start, stop, and restart a siteUse these commands for one named site:
  5. 5Connect to the running Erlang shellFrom the checkout root:
  6. 6Compile changed code and load modulesUse make for the normal project build. On a running development node, the CLI also provides focused operations:
  7. 7Automatic recompilation and file watchingZotonic's file handler watches source changes when a supported watcher is available. Erlang, templates, dispatch files, and assets have different handlers.
  8. 8Inspect global and site configurationUse the command suited to the question:
  9. 9Trace URL dispatch from the command lineUse dispatch inspection to discover why a path selects a particular controller:
  10. 10Inspect logs and running processesUse bin/zotonic logtail for the configured console log, or select error or crash when those files are available. The command prints the last 500 lines and exits; it does not follow the log continuously.
  11. 11Test the database connectionRun bin/zotonic connectdb to test a connection using the global Zotonic database configuration. It does not open PostgreSQL’s interactive client and has no site selector in this checkout.
  12. 12Run tests and site checksUse the project's test workflow in a dedicated development or test environment. Two CLI entry points have different scopes:
  13. 13Translate interface textWrite the source text in English and mark static interface text for translation.
  14. 14Back up and restore site dataFor a site with backup support enabled: