Skip to content

create_schedule

Creates a Narnia-owned scheduled job. Narnia generates a self-contained wrapper script that runs copilot -p with the given prompt on the given cadence, and registers it as a Windows Task Scheduler task (unless register is false). Narnia never edits your own scripts — the wrapper lives entirely in Narnia's own app-data folder.

The prompt is the job: there's no hidden orchestration beyond generating the wrapper and registering the task. Name the skill to invoke and say exactly what to do with its output.

Parameters

Parameter Type Required Default Description
name string Yes Display name for the job
prompt string Yes The full prompt passed to copilot -p
cwd string No null Working directory the job runs in. Required when the prompt depends on a repo-local skill
description string No null Short description for the catalog
cadenceKind string No "daily" "daily", "weekly", or "monthly"
time string No "05:00" Local fire time, 24-hour HH:mm
days string[] No null Day names for a weekly cadence, e.g. ["Monday","Friday"]
dayOfMonth integer No null Day of month (1-31) for a monthly cadence
allowFlags string No "--allow-all-tools --allow-all-paths" Copilot allow-flags
copilotArgs string No null Extra arguments appended to the copilot invocation
skills object[] No null Skills/plugins the prompt invokes, in order — { "skill": "...", "resolution": "plugin" \| "repolocal" } — recorded for documentation only
register boolean No true true registers the task now; false only returns the generated script + registration command

Response

Registered (register: true):

{ "registered": true, "id": "cca24e9e-1234-4a1b-9abc-000000000000" }

Copy-paste (register: false):

{
  "registered": false,
  "script": "# Auto-generated by Narnia...\n$prompt = @'\n...\n'@\n& copilot -p $prompt ...",
  "command": "Register-ScheduledTask -TaskName \"Example\" -TaskPath \"\\Narnia\\\" ..."
}

Example Prompts

  • "Schedule a daily 5am job that runs the example-radar skill in C:\dev\example-repo"
  • "Create a weekly job every Friday at 6am for my example report, but don't register it yet — just give me the script"

Notes

Failures (missing name/prompt, unsupported platform, or a registration error) return a plain Error: ... string. See the narnia-scheduler skill for the full workflow — designing a self-contained prompt, migrating an existing Windows Scheduled Task, and running a supervised dry run before trusting a new job.