A terminal-based task management application written in Go, designed for developers and power users who want a fast, extensible, and feature-rich TODO experience. Tusk combines PostgreSQL persistence, concurrent file backups, and a rich terminal UI to keep your workflow smooth, both now in CLI form and future REST/API extensions.
- Backend: Go 1.24
- Database: PostgreSQL 12+
- SQL Tools:
sqlc- Type-safe SQL query generationgolang-migrate- Database migration managementpgx- PostgreSQL driver for Go
- CLI Framework: Cobra - Rich command-line interface with subcommands
- Terminal UI:
bubbletea- MVC framework for terminal applicationslipgloss- Styling for terminal UI components
- Configuration:
godotenv- Environment variable management - Authentication:
golang.org/x/crypto- Password hashing and verification - Version Control: Git
tusk-go/
βββ cmd/ # Entry points for different app interfaces
β βββ api/ # REST API server entry point (future)
β βββ cli/ # Command-line interface entry point
βββ configs/ # Configuration files and templates
βββ db/ # Database definitions
β βββ migrations/ # SQL migration files
β βββ queries.sql # SQL queries for sqlc generation
βββ internal/ # Internal application code (not exported)
β βββ adapters/ # External system adapters (hexagonal architecture)
β β βββ auth/ # Authentication adapter
β β βββ backup/ # File backup adapter
β β βββ db/ # Database adapter and repository implementations
β β β βββ sqlc/ # Generated SQL code
β β βββ tui/ # Terminal UI adapter
β β βββ bubbletea/ # BubbleTea implementation of the TUI
β βββ app/ # Application services orchestration
β βββ cli/ # CLI command implementations
β βββ config/ # Configuration loading and parsing
β βββ core/ # Core domain models and business logic
β β βββ errors/ # Domain-specific errors
β β βββ task/ # Task domain model
β β βββ user/ # User domain model
β βββ ports/ # Interface definitions (hexagonal architecture)
β β βββ input/ # Input ports (use cases)
β β βββ output/ # Output ports (repositories)
β βββ service/ # Service layer implementation
β β βββ task/ # Task service implementation
β β βββ user/ # User service implementation
β βββ util/ # Shared utilities
βββ migrations/ # Application-level migrations
βββ test/ # Integration and E2E tests
βββ go.mod # Go module definition
βββ go.sum # Go module checksums
βββ LICENSE # AGPL-3.0 license file
βββ README.md # This file
βββ sqlc.yaml # sqlc configuration
The project follows a hexagonal architecture (also known as ports and adapters) to maintain a clean separation of concerns:
- Core Domain: Contains pure business logic and domain models
- Ports: Define interfaces for the application to interact with external systems
- Adapters: Connect the application to external systems like databases and UI
- Services: Implement use cases by orchestrating domain models and ports
This architecture allows us to easily:
- Switch between different database providers
- Add new user interfaces (CLI, TUI, Web) without changing business logic
- Test business logic in isolation from external dependencies
This section outlines what's been completed, what's in progress, and upcoming milestones.
-
Scaffolding & Configuration (2025-04-23)
- Project structure with
cmd/,internal/,db/,migrations/, and config. - GitHub repo initialized,
.envsupport viajoho/godotenv. .gitignore,.env.example, and base README created.
- Project structure with
-
Database Integration (2025-04-24)
- PostgreSQL schema defined with
usersandtaskstables, supporting recursive subtasks. - Migrations implemented using
golang-migratewith triggers and constraints. - Type-safe DB layer generated via
sqlc, usingpgxandpgtype. - Smoke tests in
cmd/cli/main.goforCreateUserandCreateTask.
- PostgreSQL schema defined with
-
Domain Models & Repository Layer (2025-04-25)
- Define Go structs for
UserandTask, including subtasks hierarchy and progress logic. - Implement repository wrappers that call the generated
sqlcmethods. - Auto-calculation of parent task completion based on subtasks.
- Define Go structs for
-
Service Layer & CLI Handlers (2025-04-25)
- Built service interfaces and business logic for tasks and users.
- Implemented CLI commands for
add,list,complete,delete, andreorder. - Added Cobra command structure for intuitive CLI experience.
-
Initial Terminal UI (TUI) (2025-04-26)
- Implemented basic
bubbleteaframework with list view of tasks. - Added keyboard navigation and task status toggling.
- Created task deletion functionality with confirmation prompt.
- Designed basic styling with
lipglossfor improved visual hierarchy.
- Implemented basic
-
Advanced Terminal UI Features (2025-04-28)
- Implemented detail view for tasks with scrollable content.
- Added task creation form with field validation.
- Implemented time-based task categorization (overdue, today, upcoming).
- Added status messages and loading indicators for better user feedback.
- Enhanced UI with priority color-coding and status indicators.
-
TUI Enhancements (2025-05-01)
- Implemented subtask management within the TUI.
- Added task filtering and sorting options.
- Developed comprehensive keyboard shortcuts and help menu.
- Implemented edit mode for existing tasks.
- Refactored TUI codebase for better organization and maintainability.
-
Kanban View Implementation
- Developing a Kanban board view for task organization.
- Implementing drag-and-drop functionality between columns.
- Adding customizable columns based on task status or priority.
- Creating visual indicators for task relationships and dependencies.
-
Kanban View & Advanced Features
- Group tasks by status in columns, enable drag-and-drop or key-based moves.
- Persist column order and support custom sorting.
- View task dependencies and relationships visually.
-
User Authentication & Management
- Secure login prompt, session handling.
- CLI commands for adding and removing users.
- Role-based permissions for team task management.
-
File Backup & Concurrency
- Implement JSON/CSV backup that runs in parallel with DB writes via goroutines and channels.
- Error handling and retry mechanisms.
- Automated scheduled backups with configurable intervals.
-
Testing & CI
- Unit tests for repository and service layers.
- Integration tests with a test database.
- GitHub Actions for automated testing and linting.
- Code coverage reports and quality metrics.
-
REST API & Web App
- Expose the same business logic via a Go HTTP server.
- Build a minimal web frontend (e.g. Next.js, SvelteKit) to consume the API.
- Add JWT authentication for secure API access.
- Go 1.21+
- PostgreSQL 12+
sqlcv1.XX (for type-safe queries)golang-migratev4
-
Clone the repository
git clone https://github.com/YOUR_USERNAME/tusk.git cd tusk -
Configure environment
cp .env.example .env # Edit .env with your DATABASE_URL -
Run migrations
migrate -path db/migrations -database "$DATABASE_URL" up -
Generate DB code
sqlc generate
-
Build and run the CLI
go build -o tusk ./cmd/cli ./tusk help -
Run the TUI interface
./tusk tui
-
Navigation
β/βork/j- Navigate between tasksPage Up/Page DownorCtrl+b/Ctrl+f- Scroll by pageHome/Endorg/G- Jump to top/bottomTab- Cycle between panels (left to right)Left/Rightorh/l- Navigate between panels1/2/3- Toggle panel visibility
-
Task Management
Spaceorc- Toggle task completion statusEnter- View task detailsn- Create new taskd- Delete selected taske- Edit selected taskr- Refresh task lists- Toggle subtask visibilityf- Filter tasks by criteriao- Sort tasks by different fields
-
Application Controls
Esc- Return to previous view?- Show keyboard shortcut helpq- Quit the application
We welcome contributions! Please follow these guidelines:
- Fork the repo and create a feature branch (
git checkout -b feature/foo). - Run tests and ensure
sqlc generatepasses. - Follow the existing code style and include comments.
- Open a Pull Request with a clear description of your changes.
For best results, we recommend:
- VS Code with Go extension
- PostgreSQL running locally or in Docker
- Go 1.24 or newer
This project is licensed under the GNU Affero General Public License v3.0 or later. See the LICENSE file for details.
License header for source files:
// Copyright (C) 2025 Juan Antonio Gomez Pena
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.