Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 24, 2026

Adds deepwork schedule command to create periodic tasks using native OS schedulers (systemd timers on Linux, launchd agents on macOS).

Implementation

CLI Commands

  • deepwork schedule add <task-name> <command> [--interval <interval>] - Creates scheduled task
  • deepwork schedule remove <task-name> - Removes scheduled task
  • deepwork schedule list - Lists active scheduled tasks

Platform Support

  • Systemd: Generates service + timer units in ~/.config/systemd/user/
  • Launchd: Generates plist in ~/Library/LaunchAgents/
  • Logs to .deepwork/logs/<task-name>.{log,err}

Security

  • Task names validated: ^[a-zA-Z0-9_-]+$
  • Commands parsed with shlex.split() to handle quoted arguments correctly
  • XML special characters escaped in launchd plists
  • Shell escaping for systemd service files

Example

# Schedule daily sync
deepwork schedule add sync-daily "deepwork sync" --interval daily

# Schedule with quoted arguments
deepwork schedule add commit 'git commit -m "Automated"' --interval hourly

# Custom interval (seconds)
deepwork schedule add custom "echo test" --interval 3600

Supported Intervals

hourly, daily, weekly, monthly, or integer seconds (launchd) / systemd calendar expressions

Original prompt

This section details on the original issue you should resolve

<issue_title>Cronjobs</issue_title>
<issue_description>Install cronjobs automatically based on sysyemd or macOS</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 8 commits January 24, 2026 11:20
- Implement deepwork schedule add/remove/list commands
- Support systemd timers on Linux
- Support launchd agents on macOS
- Allow scheduling any command with customizable intervals

Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com>
- Add comprehensive unit tests for schedule functionality
- Document schedule commands in README
- All tests passing (488 unit tests)

Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com>
- Add 6 integration tests for schedule CLI
- All tests passing (631 tests total)
- Feature complete and ready for review

Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com>
- Replace bare Exception catches with specific exception types
- Add better error messages for cleanup failures
- Addresses code review feedback

Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com>
- Remove redundant pass statements
- Add validation for empty command
- Add test for empty command validation
- All 632 tests passing

Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com>
- Add task name validation (alphanumeric, hyphens, underscores only)
- Use shlex for proper command parsing with quoted arguments
- Add XML escaping for launchd plist arguments
- Use shell escaping for systemd commands
- Add explicit error for invalid intervals
- Add 7 new tests for validation and security features
- All 639 tests passing

Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com>
- Add monthly interval (30 days) to launchd interval map
- Ensures consistency with systemd monthly interval support
- All 639 tests passing

Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com>
- Remove CalledProcessError from exception handlers (not raised with check=False)
- Keep FileNotFoundError and OSError for actual failure cases
- Add clarifying comments about error handling
- All 639 tests passing

Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com>
Copilot AI changed the title [WIP] Add automatic installation of cronjobs for systemd or macOS Add scheduled task support via systemd/launchd Jan 24, 2026
Copilot AI requested a review from ncrmro January 24, 2026 11:33
@ncrmro ncrmro changed the title Add scheduled task support via systemd/launchd feat: cronjobs Jan 27, 2026
Extract platform-specific scheduling logic into a runner registry
pattern (matching AgentAdapter), making it straightforward to add
future runners like GitHub Actions or Kubernetes jobs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the DCO.
✅ (ncrmro)[https://github.com/ncrmro]
❌ @Copilot
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cronjobs

2 participants