Bulk operations
Batch update/delete with --ids and --dates; idempotent creates with --if-not-exists
The CLI supports batching and idempotent behaviour so you can script updates and deletes efficiently and avoid duplicate creates.
Batch update and delete
For resources that use an id (organisations, containers, projects, tasks, routine blocks, reviews), use the --ids flag to pass comma-separated IDs:
monoid tasks update dummy-id --ids "id1,id2,id3" --bucket done
monoid tasks delete dummy-id --ids "id1,id2,id3"For daily-notes, which are keyed by date, use --dates:
monoid daily-notes update 2025-01-01 --dates "2025-01-01,2025-01-02" --content "Updated"
monoid daily-notes delete 2025-01-01 --dates "2025-01-01,2025-01-02"- Limit — At most 25 IDs (or dates) per invocation. Use multiple invocations for larger batches.
- Concurrency — The CLI runs requests with limited concurrency (e.g. 5 at a time) to avoid overloading the API.
- Retries — On 429 Too Many Requests, the CLI retries with backoff (e.g. respecting
Retry-Afteror exponential backoff).
The response includes a summary (e.g. total, succeeded, failed) and per-item results when using JSON output.
Idempotent creates (--if-not-exists)
For create commands, --if-not-exists makes the operation idempotent: if a resource already exists that matches (e.g. daily note for a date, container by name, review by date and type), the CLI returns the existing one instead of creating a duplicate.
monoid daily-notes create --date 2025-03-17 --content "Note" --if-not-exists
monoid containers create --name "Work" --if-not-exists
monoid reviews create --date 2025-03-17 --type daily --if-not-existsUse this in scripts and agent workflows to avoid duplicate resources when the same command may run multiple times.
Best practices
- Scripting — Prefer
--output jsonand parse the summary and per-item results. Handle non-zero exit codes and checkfailedin the summary. - Agent workflows — Use
--if-not-existson creates where appropriate; use--ids/--datesfor batch updates and deletes to reduce round-trips. - Rate limits — Stay within the 25-ID limit per call and use multiple calls for larger batches; the CLI’s built-in retry helps with occasional 429s.
For per-resource options and examples, see the resource command pages (e.g. tasks, daily-notes).
All rights reserved.