# Tasksquire ## Project Overview Tasksquire is a Terminal User Interface (TUI) for [Taskwarrior](https://taskwarrior.org/), built using Go and the [Charm](https://charm.sh/) ecosystem (Bubble Tea, Lip Gloss, Huh). It provides a visual and interactive way to manage your tasks, contexts, and reports directly from the terminal. The application functions as a wrapper around the `task` command-line tool, parsing its output (JSON, config) and executing commands to read and modify task data. ## Architecture The project follows the standard [Bubble Tea](https://github.com/charmbracelet/bubbletea) Model-View-Update (MVU) architecture. ### Key Directories & Files * **`main.go`**: The entry point of the application. It initializes the `TaskSquire` wrapper, sets up logging, and starts the Bubble Tea program with the `MainPage`. * **`taskwarrior/`**: Contains the logic for interacting with the Taskwarrior CLI. * `taskwarrior.go`: The core wrapper (`TaskSquire` struct) that executes `task` commands (`export`, `add`, `modify`, etc.) and parses results. * `models.go`: Defines the Go structs matching Taskwarrior's data model (Tasks, Reports, Config). * **`pages/`**: Contains the different views of the application. * `main.go`: The top-level component (`MainPage`) that manages routing/switching between different pages. * `report.go`: Displays lists of tasks (Taskwarrior reports). * `taskEditor.go`: UI for creating or editing tasks. * **`common/`**: Shared utilities, global state, and data structures used across the application. * **`components/`**: Reusable UI components (e.g., inputs, tables). * **`timewarrior/`**: Contains logic for integration with Timewarrior (likely in progress or planned). ## Building and Running ### Prerequisites * **Go**: Version 1.22 or higher. * **Taskwarrior**: The `task` binary must be installed and available in your system's `PATH`. ### Commands To run the application directly: ```bash go run main.go ``` To build a binary: ```bash go build -o tasksquire main.go ``` ### Nix Support This project includes a `flake.nix` for users of the Nix package manager. You can enter a development shell with all dependencies (Go, tools) by running: ```bash nix develop ``` ## Configuration Tasksquire respects your existing Taskwarrior configuration (`.taskrc`). It looks for the configuration file in the following order: 1. `TASKRC` environment variable. 2. `$HOME/.taskrc` 3. `$HOME/.config/task/taskrc` Logging is written to `app.log` in the current working directory. ## Development Conventions * **UI Framework**: Uses [Bubble Tea](https://github.com/charmbracelet/bubbletea) for the TUI loop. * **Styling**: Uses [Lip Gloss](https://github.com/charmbracelet/lipgloss) for terminal styling. * **Forms**: Uses [Huh](https://github.com/charmbracelet/huh) for form inputs. * **Logging**: Uses `log/slog` for structured logging.