khal Terminal calendar

Version 0.14.1 · source

Start here

khal list
Today's events
khal list today 7d
Next week
khal calendar
Month overview
khal new 18:00 <title>
Add an event today
khal new tomorrow 9:00 10:00 <title>
Pick start and end
khal search <text>
Find events
khal edit <text>
Change or delete
ikhal
Interactive TUI

Concepts

  1. Server CalDAV / Google
  2. Local vdir .ics files
  3. khal CLI and ikhal

Viewing

khal list
Events of today
khal list <start> <end>
Events in a date range
khal list today <n>d
Next n days (m, h, d work)
khal list today week
The week containing the start
khal calendar
Three months with events
khal at
Events happening now
khal at <time>
Events at a given time
khal list --once
Show multi-day events only once
khal list --notstarted
Only events not yet begun
khal search <text>
Search events by text
khal printcalendars
List configured calendars

Creating

khal new <start> <title>
Add an event (default 1 hour)
A start time alone means today. An end earlier than the start rolls to the next day.
khal new <start> <end> <title>
Add with explicit end
khal new <start> <delta> <title>
Add with a duration
khal new <date> <title>
Add an all-day event
khal new <start> <title> :: <notes>
Add with a description
khal new <start> <tz> <title>
Set the time zone
Use an Olson name such as Europe/Berlin; default is defaulttimezone from the config.
new -a <calendar>
Target calendar (once only)
new -l <place>
Location
In new, -l is --location; elsewhere it is --logfile.
new -g <cat,cat>
Categories
new -r <rule>
Repeat: daily, weekly, monthly, yearly
In new, -r is --repeat; in import it is --random-uid.
new -u <date>
Repeat until a date
new --alarms <delta,...>
Alarms, e.g. 1d,10m
new --url <url>
Attach a URL
khal new -i
Prompt for each field

Editing and import

khal edit <text>
Step through matches: change or delete
khal edit --show-past <text>
Include past events
khal import <file.ics>
Import events from an .ics file
khal import --batch <file.ics>
Overwrite same UIDs without asking
khal import -r <file.ics>
Give imported events new UIDs
khal configure
Create an initial config
Refuses to run if a config already exists.
khal printformats
Show a test date in each format

Output and options

-a <calendar>
Only this calendar (repeatable)
-d <calendar>
Exclude a calendar
Not supported by new.
--format "<template>"
Custom line template
--day-format "<template>"
Day heading template; empty hides it
--json <field>
Output JSON with chosen fields
--json all
JSON with every field
--color / --no-color
Force or remove colour
-c <file>
Use another config file
-v <level>
Log level, e.g. DEBUG
Common format fields
Field Meaning
{title} Event title
{start-time} Start time
{end-time} End time
{location} Location
{calendar} Calendar name
{description} Description
{uid} Unique ID
{nl} Newline

Dates

Date words
Input Means
today This day
tomorrow Next day
fri Next Friday
monday Next Monday
25.10. Date without year: future
18:00 Time today
30m / 2h / 3d Duration (list and new)

ikhal: calendar

ikhal
Start the interactive UI
Arrows
Move between days
Tab / Enter
Focus the event list
T
Jump to today
N
New event on the day or range
V
Select a date range
O
Jump to the other end of the range
/
Search events
Esc
Cancel or go back; quits at the top

ikhal: events

Enter
View event details; again to edit
D
Mark for deletion (applied on exit)
P
Duplicate event
E
Export event
Shift+Tab
Previous field in editor (Tab: next)
Alt+Enter
Save from anywhere in the editor
Documented as meta+Enter; meta is usually Alt.
Ctrl+A / Ctrl+X
Increment / decrement a date or time field
In text fields Ctrl+A moves to the line start.
Ctrl+W
Delete word back
Ctrl+U
Delete to line start

Recipes

Daily agenda in a script
khal list --format "{start-time} {title}" --day-format "" today eod
Weekly meeting with alarm
khal new -a work -r weekly --alarms 10m \  mon 10:00 11:00 Standup :: Team sync
Import and check an invite
khal import -a personal invite.icskhal list <date>
Sync then view
vdirsyncer synckhal list today 3d