master
Add a capture.adapter/update! multimethod so callers can edit an existing event in place (not just create). Its :default throws (with :read-only true) rather than System/exit, so a long-running server survives read-only providers. Nextcloud implements update! as GET -> transform -> PUT: get-event! fetches the current VCALENDAR, apply-event-edits unfolds the lines and swaps only the editable props (SUMMARY/DTSTART/DTEND/DESCRIPTION) while bumping SEQUENCE and refreshing DTSTAMP, preserving UID/RRULE/attendees. invalidate-cache! is factored out of capture! and reused. Both agenda adapters (nextcloud, google) now carry :uid and :description on each event so a UI can open + prefill an editor and round-trip the write. Tests: apply-event-edits preserves untouched props and handles all-day events.
org-mode-agenda-cli
A comprehensive Clojure CLI toolkit for org-mode files, featuring agenda views, literate programming (tangle), content capture, and file utilities.
Built on org-mode-parser with support for grouped agenda views (inspired by org-super-agenda), org-babel tangle, and extensible content workflows.
Features
Agenda Views
- Predicate DSL for filtering by TODO state, date, tags, file, and heading level
- Repeating event support — org-mode repeaters (
+1w,.+2m) and iCal RRULE - First-match-wins grouping with auto-groups (by tag, file, date, TODO state)
- Nextcloud CalDAV and Google Calendar adapters (with RRULE support)
- Multiple output formats: shell, HTML, EDN
- Config files evaluated via SCI
Literate Programming
- Org-babel tangle support — extract source code blocks from org files
- Multi-language support with proper file extension handling
- Configurable output directories and dry-run mode
- Generated files include org-mode links back to source headings
File Tools & Content
- Content capture with configurable templates
- Link title fetching and bare link conversion
- File deduplication and cleanup utilities
- Web content fetching via markdown.new + pandoc integration
Library Usage
- Usable as a Babashka library for custom views (calendars, reports, dashboards)
- Extensible adapter system for external data sources
Quick Start
# See all available commands
bb org --help
# Agenda: Today's active items
bb org agenda --files ~/org/*.org --today --todo
# Agenda: Grouped agenda from config file
bb org agenda --config config.edn --today
# Tangle: Extract code blocks from literate org files
bb org tangle --dry-run my-config.org
bb org tangle --output-dir ~/dotfiles config.org
# Tools: Clean up org files
bb org tools deduplicate --dry-run inbox.org
bb org tools fix-links document.org
# Content: Fetch and format web content
bb org content link-title "https://example.com"
bb org content fetch-content "https://blog.example.com/post"
# Capture: Add new entries to org files
bb org capture --template quick --target inbox.org "New task"
Agenda Config Example
{:sources ["/home/user/org/*.org"]
:match (none (todo/done?))
:groups [{:name "Overdue" :match (date/overdue?)}
{:name "Today" :match (date/today?)}
{:name "This Week" :match (date/this-week?)}
(group/by-tag)
{:name "Other" :match (constantly true)}]}
Tangle Usage
Extract source code blocks from literate org files:
* Configuration
** Shell Scripts
#+begin_src bash :tangle scripts/setup.sh
#!/bin/bash
echo "Setting up..."
#+end_src
** Clojure Code
#+begin_src clojure :tangle src/config.clj
(ns config.core)
(def version "1.0.0")
#+end_src
bb org tangle --dry-run config.org # Preview
bb org tangle config.org # Extract to files
bb org tangle --output-dir ~/dotfiles config.org # Custom location
Documentation
- CLI Reference -- all commands overview, agenda flags, output format, examples
- Tangle Reference -- literate programming, code block extraction, examples
- Config File Reference -- agenda predicates, combinators, auto-groups, adapters
- Library Usage -- using the agenda engine as a Babashka library
Command Help
All commands include built-in help:
bb org --help # Main command overview
bb org agenda --help # Agenda-specific options
bb org tangle --help # Tangle-specific options
bb org tools --help # File tools overview
bb org content --help # Content fetching overview
Description
Languages
Clojure
91.2%
JavaScript
3.2%
Emacs Lisp
2.6%
CSS
1.9%
TypeScript
0.5%
Other
0.6%