onepub-dev / onepub-dev/dcli

Implement a scheduler

Open
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
Dart
Stars
265
Forks
30
PR merge metrics
No merged PRs in 30d

Description

I wonder if it might be nice to have a scheduler. Cron syntax is cryptic. A modern syntax might be nice.
Particularly with a built support for testing that your scheduled jobs ran at the correct time and with the correct permissions.
Something like

dshell schedule simulate 10:15 jobx.dart

This would run the scheduled job as if it was 10:15.

Other commands might be:

dshell schedule list

dshell schedule list <script.dart>

dshell schedule <script.dart> at 10:15

dshell schedule delete <n> - where <n> is a number output by list.
dshell schedule delete <script.dart> at 10:15
dshell schedule add <script.dart> interval 1 hour
dshell schedule add <script.dart> interval 1 hour, 30 seconds named backup
dshell schedule delete backup

The scheduled jobs would be stored in a configuration file under the ~/.dshell

Yaml would possible be a good target as it is already used in pubspec.yaml so would be familiar:

So maybe syntax like:

jobs:
/path/to/exe/or/script
name: backup
first_run: yyyy-mm-dd hh:MM:ss
re_occurs:
count: 1
or
forever
or
until: yyyy-mm-dd hh:MM:ss

interval:
seconds: 10
or
hours: 2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing CLI entry points and how pubspec.yaml uses YAML; the issue names no specific files or tests. The scope would need agreement around the proposed schedule commands, ~/.dshell storage, simulation, permissions, and recurrence behavior before completion can be assessed.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, yaml
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.