2.9 KiB
Tasksquire
Project Overview
Tasksquire is a Terminal User Interface (TUI) for Taskwarrior, built using Go and the Charm 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 Model-View-Update (MVU) architecture.
Key Directories & Files
main.go: The entry point of the application. It initializes theTaskSquirewrapper, sets up logging, and starts the Bubble Tea program with theMainPage.taskwarrior/: Contains the logic for interacting with the Taskwarrior CLI.taskwarrior.go: The core wrapper (TaskSquirestruct) that executestaskcommands (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
taskbinary must be installed and available in your system'sPATH.
Commands
To run the application directly:
go run main.go
To build a binary:
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:
nix develop
Configuration
Tasksquire respects your existing Taskwarrior configuration (.taskrc). It looks for the configuration file in the following order:
TASKRCenvironment variable.$HOME/.taskrc$HOME/.config/task/taskrc
Logging is written to app.log in the current working directory.
Development Conventions
- UI Framework: Uses Bubble Tea for the TUI loop.
- Styling: Uses Lip Gloss for terminal styling.
- Forms: Uses Huh for form inputs.
- Logging: Uses
log/slogfor structured logging.