| Crates.io | complish |
| lib.rs | complish |
| version | 0.0.1 |
| created_at | 2025-08-08 23:24:41.557736+00 |
| updated_at | 2025-08-18 15:26:17.940913+00 |
| description | Core library for project-aware task management with git integration |
| homepage | https://github.com/aaronmallen/complish-dev |
| repository | https://github.com/aaronmallen/complish-dev |
| max_upload_size | |
| id | 1787396 |
| size | 78,349 |
A local-first task management library with project organization and efficient binary storage.
today, next, and someday listsAUTH-01, WEB-15)use complish::{Vault, TaskPriority};
use eyre::Result;
fn main() -> Result<()> {
// Load or create a vault
let mut vault = Vault::load()?;
// Create a simple task
let task = vault
.add_task("Fix login bug")
.in_list("today")?
.with_priority(TaskPriority::High)
.create()?;
println!("Created task: {}", task.friendly_id); // "1"
// Create a project-scoped task
let project_task = vault
.add_task("Update user authentication")
.for_project("AUTH")?
.in_list("next")?
.with_description("Implement OAuth 2.0 flow")
.create()?;
println!("Created task: {}", project_task.friendly_id); // "AUTH-01"
Ok(())
}
Individual work items with comprehensive metadata:
let mut task = vault.add_task("Write documentation").create()?;
// Status management
task.start_work()?;
task.complete();
task.reopen();
// Metadata
task.add_description("Add examples and API docs");
task.add_note("Remember to include code samples");
task.add_tag("documentation");
task.set_priority(TaskPriority::Medium);
// Work tracking
task.start_work_with_note("Starting research")?;
task.stop_work();
let total_time = task.total_time_worked();
Collections of related tasks with unique keys:
// Projects are automatically created when referenced
let task = vault
.add_task("Setup CI pipeline")
.for_project("DEVOPS")? // Creates "DEVOPS" project if it doesn't exist
.create()?;
// Task gets friendly ID: "DEVOPS-01"
The storage and indexing layer that manages everything:
let mut vault = Vault::load()?;
// Fast lookups by friendly ID
if let Some(task) = vault.find_task_by_friendly_id("AUTH-05") {
task.complete();
}
// List operations
let today_tasks = vault.get_tasks_in_list("today");
let auth_project_tasks = vault.get_tasks_for_project("AUTH");
// Persistence
vault.save()?; // Saves to ~/.local/share/complish/vault
bincode for fast serialization500)"AUTH-15", "42")pub struct Task {
pub id: u32, // Canonical ID
pub friendly_id: String, // User-facing ID
pub subject: String, // Title
pub description: Option<String>, // Detailed description
pub status: TaskStatus, // Todo, InProgress, Done
pub priority: TaskPriority, // P0 (highest) to P4 (lowest)
pub resolution: Option<TaskResolution>, // Completed, Cancelled, Delegated
pub tags: Vec<String>, // Flexible categorization
pub notes: Vec<TaskNote>, // Timestamped annotations
pub work_logs: Vec<TaskWorkLog>, // Time tracking entries
pub due_at: Option<DateTime<Utc>>, // Deadline
pub completed_at: Option<DateTime<Utc>>, // Completion timestamp
// ... timestamps and metadata
}
// Morning: Move tasks to today's list
vault.move_task_to_list("AUTH-05", "today")?;
vault.move_task_to_list("WEB-12", "today")?;
// During work: Track progress
let task = vault.find_task_by_friendly_id_mut("AUTH-05").unwrap();
task.start_work_with_note("Implementing OAuth redirect")?;
// ... later
task.complete_with_note("Tested with Google and GitHub providers");
// Evening: Review completed tasks
let completed_today = vault.get_completed_tasks_today();
// Create related tasks
for feature in ["Login page", "Password reset", "2FA setup"] {
vault.add_task(feature)
.for_project("AUTH")?
.in_list("next")?
.create()?;
}
// Get project overview
let auth_tasks = vault.get_tasks_for_project("AUTH");
let completed = auth_tasks.iter().filter(|t| t.is_complete()).count();
let total = auth_tasks.len();
println!("AUTH project: {}/{} tasks complete", completed, total);
let mut task = vault.find_task_by_friendly_id_mut("WEB-08").unwrap();
// Start work with context
task.start_work_with_source("vscode")?;
// Add notes during work
task.add_note("Found the issue in the CSS grid layout");
// Stop work
task.stop_work();
// Get insights
let total_time = task.total_time_worked();
let is_currently_active = task.is_being_worked();
The library uses eyre for ergonomic error handling:
use eyre::Result;
// Validation errors provide helpful context
match vault.add_task("Fix bug").for_project("INVALID") {
Ok(builder) => { /* ... */ }
Err(e) => println!("Error: {}", e), // "Project with key 'INVALID' not found"
}
// List validation
match vault.add_task("Task").in_list("invalid_list") {
Ok(builder) => { /* ... */ }
Err(e) => println!("{}", e), // "List 'invalid_list' not found. Must be one of: today, next, someday"
}
~/.local/share/complish/~/Library/Application Support/complish/%APPDATA%/complish/This library is part of the larger Complish productivity tool ecosystem. See the main repository for contribution guidelines.
Licensed under the MIT License. See LICENSE for details.