Documentation

Schedule AI Coding Tasks with Cron

Run Andromity on a schedule with /cron to execute tests, fix failures, and refactor code while you are away.

Andromity includes a built-in background scheduler that allows you to automate coding tasks on a recurring schedule.

Type /cron in the chat bar to open the scheduler interface:

/cron

How it Works

  1. Job Definition: When you register a cron job, Andromity records:
    • The user prompt (e.g. "Run pytest, fix any failing tests, and commit the changes").
    • The permission mode (use FULL or YOLO for autonomous overnight runs).
    • The model and provider selected at creation time.
    • The schedule (cron expression or natural intervals).
  2. Persistent Storage: Jobs are stored locally in .andromity/crons.json inside your project directory.
  3. Execution Logs: Detailed execution traces and agent turns for each run are saved to .andromity/cron_runs/.

Supported Schedule Syntax

You can specify schedules using standard 5-part cron syntax or natural shorthand:

Schedule ExpressionMeaningTypical Use Case
0 2 * * *Everyday at 2:00 AMFull test suite execution & self-healing
0 8 * * 1Every Monday at 8:00 AMDependency vulnerability audits
every 30mEvery 30 minutesContinuous watcher & build fixer
every 4hEvery 4 hoursStale branch / TODO comment scanner

Example: Nightly Test Auto-Fixer

To set up a completely autonomous nightly test loop:

  1. Switch your session to FULL or YOLO mode:
    /mode full
  2. Open /cron and input:
    • Task: "Run pytest tests/. If any test fails, inspect the stack trace, modify the implementation files to resolve the failure, and rerun pytest until all tests pass."
    • Schedule: 0 3 * * *
  3. Leave the VS Code session or terminal workspace running.
  4. Next morning, check git logs or .andromity/cron_runs/ to review commits applied by the agent.