docs(cron): show how to view scheduled tasks
This commit is contained in:
parent
c68b4f3903
commit
efdbc988c2
4 changed files with 31 additions and 4 deletions
14
README.md
14
README.md
|
|
@ -1409,6 +1409,20 @@ PicoClaw supports scheduled reminders and recurring tasks through the `cron` too
|
|||
* **Recurring tasks**: "Remind me every 2 hours" → triggers every 2 hours
|
||||
* **Cron expressions**: "Remind me at 9am daily" → uses cron expression
|
||||
|
||||
To view your scheduled tasks:
|
||||
|
||||
```bash
|
||||
picoclaw cron list
|
||||
```
|
||||
|
||||
Useful follow-up commands:
|
||||
|
||||
```bash
|
||||
picoclaw cron disable 1 # pause job 1
|
||||
picoclaw cron enable 1 # resume job 1
|
||||
picoclaw cron remove 1 # delete job 1
|
||||
```
|
||||
|
||||
Jobs are stored in `~/.picoclaw/workspace/cron/` and processed automatically.
|
||||
|
||||
## 🤝 Contribute & Roadmap
|
||||
|
|
|
|||
|
|
@ -16,6 +16,13 @@ func NewCronCommand() *cobra.Command {
|
|||
Use: "cron",
|
||||
Aliases: []string{"c"},
|
||||
Short: "Manage scheduled tasks",
|
||||
Long: `Manage scheduled tasks.
|
||||
|
||||
Use 'picoclaw cron list' to view all jobs currently scheduled in your workspace.`,
|
||||
Example: `picoclaw cron list
|
||||
picoclaw cron add "Daily standup" "0 9 * * 1-5"
|
||||
picoclaw cron disable 1
|
||||
picoclaw cron remove 1`,
|
||||
Args: cobra.NoArgs,
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
return cmd.Help()
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ func TestNewCronCommand(t *testing.T) {
|
|||
require.NotNil(t, cmd)
|
||||
|
||||
assert.Equal(t, "Manage scheduled tasks", cmd.Short)
|
||||
assert.Contains(t, cmd.Long, "picoclaw cron list")
|
||||
assert.Contains(t, cmd.Example, "picoclaw cron list")
|
||||
|
||||
assert.Len(t, cmd.Aliases, 1)
|
||||
assert.True(t, cmd.HasAlias("c"))
|
||||
|
|
@ -46,6 +48,9 @@ func TestNewCronCommand(t *testing.T) {
|
|||
|
||||
assert.Len(t, subcmd.Aliases, 0)
|
||||
assert.False(t, subcmd.Hidden)
|
||||
if subcmd.Name() == "list" {
|
||||
assert.Contains(t, subcmd.Example, "picoclaw cron list")
|
||||
}
|
||||
|
||||
assert.False(t, subcmd.HasSubCommands())
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ func newListCommand(storePath func() string) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "list",
|
||||
Short: "List all scheduled jobs",
|
||||
Example: `picoclaw cron list`,
|
||||
Args: cobra.NoArgs,
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
cronListCmd(storePath())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue