Background and scheduled audits
Without serve, each command starts Damdit CLI for as long as it runs: damdit-cli audit audits in the foreground and ends when the audit is done. damdit-cli serve keeps Damdit CLI running in the background instead. It:
- runs scheduled audits,
- runs audits started with
damdit-cli audit --detach, - answers commands and AI agents started meanwhile; they share it.
Start, stop and read the log
Section titled “Start, stop and read the log”damdit-cli serve # starts it in the backgrounddamdit-cli logs # its log; add -f to follow itdamdit-cli stop # stops itserve runs in the Docker container damdit-cli. Docker starts it again when Docker itself starts, until you run damdit-cli stop. Scheduled audits run only while Docker runs and the computer is awake.
The log has one line per event: started, an audit queued or due, started, finished with its score, failed or cancelled, and stopping. Set DAMDIT_LOG=json before serve for JSON lines instead.
Variables
Section titled “Variables”serve takes the DAMDIT_* variables set when you start it, such as DAMDIT_CI_KEY and DAMDIT_PAGESPEED_KEY. It keeps them in a file only your user can read, and stop removes it. Docker doesn’t keep them in the container’s settings.
To change a variable, stop serve and start it again:
damdit-cli stopexport DAMDIT_PAGESPEED_KEY=…damdit-cli serveThe access level of serve (DAMDIT_CLI_ACCESS) is the most any command or AI agent may do through it. See Access levels.
Schedule audits
Section titled “Schedule audits”damdit-cli schedule Example weekly --weekday monday --hour 6damdit-cli schedule Example daily --hour 3damdit-cli schedule Example monthly --day 1damdit-cli schedule Example off--houris a whole hour, 0–23 (9 by default). A weekly schedule takes--weekday(Monday by default), a monthly one--day, 1–28 (1 by default). Values you don’t give stay as saved.- Hours are in this computer’s time zone: the launcher passes it to Docker.
serve’s first log line names the time zone. - A scheduled audit is the same Full Audit as any other. It audits the project’s default address.
- Scheduled audits run only while
damdit-cli serveruns. They can’t be stopped withdamdit-cli cancel;damdit-cli stopstops a running one.
Update while serve runs
Section titled “Update while serve runs”damdit-cli update moves an idle serve to the new version with the same variables. If serve is auditing, it keeps the previous version until you run damdit-cli update again after the audit.