ekctl icon indicating copy to clipboard operation
ekctl copied to clipboard

Include `availability` field in event list/show output

Open Noerr opened this issue 8 months ago • 2 comments

The in-progress v1.3.0 PR (#1) adds --availability support for add event and update event — great addition. However, eventToDict() doesn't include the availability property in its output, so there's no way to read back the free/busy status of events via list events or show event.

Request: Add event.availability to the dictionary returned by eventToDict() in EventKitManager.swift. Something like:

switch event.availability {
case .busy: dict["availability"] = "busy"
case .free: dict["availability"] = "free"
case .tentative: dict["availability"] = "tentative"
case .unavailable: dict["availability"] = "unavailable"
case .notSupported: dict["availability"] = "notSupported"
@unknown default: dict["availability"] = "unknown"
}

Use case: I'm using ekctl to read my Exchange work calendar for planning and review workflows. Knowing which events are "busy" vs "free" vs "tentative" is important for identifying actual availability windows.

Noerr avatar Mar 05 '26 21:03 Noerr

Thanks @Noerr — clean, well-scoped request, and the code snippet you provided was a direct drop-in. Used your exact switch-case shape in c05dddb so the output now includes an availability string on every event returned by list events / show event:

{
  ...,
  "availability": "busy"
}

Round-trips with the existing add event --availability ... and update event --availability ... flags from 1.3.0, so you can now read your Exchange free/busy state out, filter on it with jq, and feed it back through update commands.

schappim avatar May 23 '26 05:05 schappim

Thank you @schappim. I'm looking forward thenew release tag flowing through to the Homebrew formula.

Noerr avatar May 23 '26 18:05 Noerr