A calendar tui written in go.
Find a file
2025-06-28 23:08:50 -04:00
.env update flake config 2025-06-28 17:50:38 -04:00
.envrc update flake config 2025-06-28 17:50:38 -04:00
.gitignore update git ignore 2025-06-28 17:50:54 -04:00
constants.go annotated main 2025-06-28 23:08:27 -04:00
flake.lock init go commit 2025-06-27 15:06:03 -04:00
flake.nix update flake config 2025-06-28 17:50:38 -04:00
go.mod fix dependency issue 2025-06-28 17:51:08 -04:00
go.sum got month grid going 2025-06-28 21:39:40 -04:00
justfile added just file for convenience 2025-06-27 15:11:38 -04:00
main.go annotated main 2025-06-28 23:08:27 -04:00
model.go annotated main 2025-06-28 23:08:27 -04:00
readme.md updated readme 2025-06-28 23:08:50 -04:00
styles.go annotated main 2025-06-28 23:08:27 -04:00
update.go restructured main 2025-06-28 22:42:27 -04:00
view.go restructured main 2025-06-28 22:42:27 -04:00

GoCal

This is a terminal-based calendar and hourly schedule viewer built using Bubble Tea and styled with Lipgloss.


Project Structure

File Description
main.go Entry point of the application. Initializes the program and sets the initial model state (current year/month and cursor position).
constants.go Defines global constants such as calendar grid size and cell dimensions used throughout the app.
styles.go Contains all the Lipgloss style definitions for calendar cells, headers, and hourly schedule views.
model.go Defines the data model struct (model) that holds the application state, and the viewMode type representing current UI mode. Also contains the Init function for Bubble Tea.
update.go Implements all update logic for handling user input and updating the model state in both month and hourly views. Includes the fix to properly update cursor position when switching months.
view.go Contains all rendering logic that converts the current model state into styled terminal output for both month and hourly views.

Features

  • Month view with navigable calendar grid.
  • Highlighted current day.
  • Cursor highlighting with keyboard navigation.
  • Enter key switches to hourly schedule view for the selected day.
  • Hourly view with current hour highlighted.
  • Switch back to month view with ESC.

Usage

Run the program:

go run .

Controls:

  • [a] / [d]: Navigate previous / next month.

  • Arrow keys: Move cursor around days.

  • [Enter]: Switch to hourly view for selected day.

  • [Esc]: Return to month view.

  • [q] / Ctrl+C: Quit.