Skip to main content

CLI tool for adding calendar events

Project description

ccal

中文文档

A CLI tool that turns natural language text or images into calendar events. Powered by LLMs.

Features

  • Text input — describe an event in plain language, ccal parses it into structured fields
  • Image input — extract text from screenshots/photos via OCR, then parse
  • Multi-LLM support — works with OpenAI, Anthropic, Gemini, OpenRouter, Deepseek, Groq, Mistral, and more (via litellm)
  • ICS export — generate standard .ics files importable by any calendar app
  • Google Calendar sync — create events directly on Google Calendar via API
  • Apple Calendar sync — add events via AppleScript (macOS only, auto-fallback to ICS on other platforms)
  • Secure key storage — API keys stored in your system keyring, never in plain text
  • Geolocation — auto-detect timezone and location for accurate event scheduling
  • Stdin support — pipe text from other commands

Requirements

Installation

git clone https://github.com/your-username/ccal.git
cd ccal
uv sync

Prebuilt binaries

If you want a ready-to-run command-line executable, download the asset for your platform from the GitHub Releases page. The release binaries are built for Linux, macOS, and Windows, and they include the core CLI without the optional OCR extra.

Typical filenames look like:

  • ccal-vX.Y.Z-linux-x86_64
  • ccal-vX.Y.Z-windows-x86_64.exe
  • ccal-vX.Y.Z-macos-x86_64
  • ccal-vX.Y.Z-macos-arm64

After downloading:

  • Linux and macOS:
    chmod +x ccal
    ./ccal --help
    
  • Windows:
    .\ccal.exe --help
    

Quick Start

1. Setup

ccal setup

This will walk you through configuring:

  • LLM provider and model
  • API key (stored securely in system keyring)
  • Default output method (ICS file, Google Calendar, or Apple Calendar)
  • Google Calendar setup, including client type, auth mode, credentials location, and Calendar ID

2. Add an event

From text:

ccal add "Team meeting tomorrow at 3pm in Conference Room A"

From an image:

ccal add flyer.png

From stdin:

echo "Lunch with Alice Friday noon" | ccal add

With options:

ccal add "Dinner Friday 7pm at Luigi's" -o google       # sync to Google Calendar
ccal add "Weekly standup Mon 9am" -o apple               # add to Apple Calendar (macOS)
ccal add "Weekly standup Mon 9am" -o ics                  # export as .ics file
ccal add "会议明天下午两点" -m anthropic/claude-sonnet-4-20250514  # use a specific model
ccal add screenshot.png -l chi_sim                        # OCR with Chinese language
ccal add "Demo at 2pm" -y                                 # skip confirmation
ccal add "Demo at 2pm" --json                             # output as JSON

3. Parse only (no save)

ccal parse "Workshop next Wednesday 10am-12pm, Room 301"
ccal parse "下周一上午10点团队周会" --json

4. View config

ccal config

Commands

Command Description
ccal add [text|image] Parse input and create a calendar event
ccal parse [text|image] Parse and display event fields without saving
ccal setup Interactive configuration wizard
ccal config Show current configuration and platform info

ccal add options

Option Description
-o, --output Output method: ics, google, or apple
-p, --provider LLM provider name
-m, --model LLM model (e.g. openai/gpt-4o)
-y, --yes Skip confirmation, output directly
-l, --language OCR language (e.g. chi_sim, eng+chi_sim)
--json Output parsed event as JSON

Platform Support

Feature macOS Linux Windows
ICS export
Google Calendar
Apple Calendar ❌ fallback to ICS ❌ fallback to ICS

Configuration

Config is stored at ~/.config/ccal/config.toml. API keys are stored in your system's native keyring (macOS Keychain / Linux Secret Service / Windows Credential Locker).

For Google Calendar integration, ccal uses two different local files:

  • google_credentials.json: the OAuth client credentials JSON downloaded from Google Cloud Console. This contains the client id and client secret. Keep this file around after setup.
  • google_token_*.json: the cached login token created after the first successful authorization. The access token inside can expire and refresh automatically, so you usually do not need to touch it. ccal picks the cache file based on the current credentials path and auth mode.

During ccal setup, place the credentials JSON in the configured directory, or point setup directly at the JSON file. The setup tutorial also explains:

  • Desktop app vs TVs and Limited Input devices
  • External vs Internal
  • Testing status and Test users
  • how to find a Google Calendar ID
  • setup-time validation of the selected Calendar ID

You can also configure Google Calendar during ccal setup through the dedicated middle step, even if your default output is not Google.

Project Structure

src/
├── main.py                  # CLI entry point (Typer)
├── config.py                # Configuration & keyring management
├── models/
│   ├── model.py             # CalendarEvent Pydantic model
│   └── llm.py               # LLM parsing via litellm
├── input/
│   ├── ocr.py               # Image text extraction (pytesseract)
│   └── geo.py               # IP-based geolocation for timezone
└── connections/
    ├── google_calendar.py   # Google Calendar API integration
    ├── apple_calendar.py    # Apple Calendar via AppleScript (macOS)
    └── ics.py               # ICS file export

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ccal-0.1.7.tar.gz (181.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ccal-0.1.7-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file ccal-0.1.7.tar.gz.

File metadata

  • Download URL: ccal-0.1.7.tar.gz
  • Upload date:
  • Size: 181.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ccal-0.1.7.tar.gz
Algorithm Hash digest
SHA256 643b838e093737426c1d9c1f72ebf22daed24f9d421e193be11d175ab27492ae
MD5 a868da50b52db89bc8842da38e3e8606
BLAKE2b-256 60a8ee97e6071cc7fbc42f0bf1f7878b80b36efcfa5a856e83a7b18afd67d599

See more details on using hashes here.

Provenance

The following attestation bundles were made for ccal-0.1.7.tar.gz:

Publisher: publish.yml on Q1ngX1/ccal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ccal-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: ccal-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ccal-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 8ee3b6fe2067d87721cba5947a6f262826a210599ff6a75868d300e17eb03e13
MD5 1dca215348957ab0cd89e97379ba141b
BLAKE2b-256 c5a915665858aed58310cf7d028502a3da000e65c9b401bdf49a66363d7c5c7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ccal-0.1.7-py3-none-any.whl:

Publisher: publish.yml on Q1ngX1/ccal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page