Skip to content

BartSimpson2911/CoTask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 cotask β€” Versioned Task Manager

A Git-like task manager built in Rust with full version control mechanics

Rust Serde CLI


πŸ“– Overview

cotask is a command-line task manager built in Rust that works like a simplified Git. Instead of tracking files, it tracks tasks with full version history. Every change creates a new snapshot (commit). You can branch, merge, rebase, tag releases, stash changes, and even export the entire repository state.

πŸ“ Repository Structure

.
β”œβ”€β”€ Cargo.lock
β”œβ”€β”€ Cargo.toml
β”œβ”€β”€ README.md
β”œβ”€β”€ x.sh                          # Installation script
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ bin
β”‚   β”‚   └── cli.rs                # CLI entry point
β”‚   β”œβ”€β”€ lib.rs                    # Library root
β”‚   β”œβ”€β”€ main.rs                   # Main binary entry
β”‚   β”œβ”€β”€ logic                     # Core business logic
β”‚   β”‚   β”œβ”€β”€ add_task.rs
β”‚   β”‚   β”œβ”€β”€ branch.rs
β”‚   β”‚   β”œβ”€β”€ checkout.rs
β”‚   β”‚   β”œβ”€β”€ diff.rs
β”‚   β”‚   β”œβ”€β”€ export.rs
β”‚   β”‚   β”œβ”€β”€ gc.rs
β”‚   β”‚   β”œβ”€β”€ import.rs
β”‚   β”‚   β”œβ”€β”€ init_repo.rs
β”‚   β”‚   β”œβ”€β”€ list_task.rs
β”‚   β”‚   β”œβ”€β”€ merge.rs
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ rand_hash.rs
β”‚   β”‚   β”œβ”€β”€ rebase.rs
β”‚   β”‚   β”œβ”€β”€ resolve.rs
β”‚   β”‚   β”œβ”€β”€ revert.rs
β”‚   β”‚   β”œβ”€β”€ show_help.rs
β”‚   β”‚   β”œβ”€β”€ show_log.rs
β”‚   β”‚   β”œβ”€β”€ stash.rs
β”‚   β”‚   └── tag.rs
β”‚   β”œβ”€β”€ models                    # Data structures
β”‚   β”‚   β”œβ”€β”€ commit_model.rs
β”‚   β”‚   β”œβ”€β”€ export_model.rs
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   └── task_model.rs
β”‚   └── storage                   # Persistence layer
β”‚       β”œβ”€β”€ commit.rs
β”‚       β”œβ”€β”€ head.rs
β”‚       └── mod.rs

.cotask Directory Structure

.cotask/
β”œβ”€β”€ commits/      # Commit snapshots (JSON)
β”œβ”€β”€ refs/         # Branch pointers
β”œβ”€β”€ tags/         # Release tags
β”œβ”€β”€ stash/        # Temporary saved states
└── HEAD          # Current branch or detached commit

πŸš€ Features

βœ… Core Task Tracking

  • Add tasks
  • Mark tasks complete
  • Snapshot history automatically

πŸ•“ History System

  • Commit log
  • Checkout commit, branch, or tag
  • Diff between commits

🌿 Branching & Versioning

  • Create/delete branches
  • Merge branches
  • Rebase branches

🏷 Release Management

  • Tags (fixed references to commits)

⚠️ Conflict Handling

  • Detect merge conflicts
  • Manual resolution

🧹 Maintenance Tools

  • Garbage collection (remove unreachable commits)
  • Stash system (temporary state save)
  • Export/import full repository state

πŸ“¦ Installation

Prerequisites

  • Rust toolchain (rustc, cargo)
  • Unix-like system (Linux, macOS) for the installation script

Quick Install

git clone https://github.com/BartSimpson2911/CoTask
cd CoTask
chmod +x x.sh
./x.sh

What the script does:

  • Builds the project in release mode (cargo build --release)
  • Installs the binary globally (cargo install --path .)
  • Makes cotask available system-wide

πŸ›  Commands Reference

Command Description
cotask init Initialize a new task repository
cotask export Backup repository state to JSON
cotask import <file> Restore repository from backup
cotask gc Clean unused commits
Command Description
cotask add "task" Add a new task
cotask list List all current tasks
cotask done <id> Mark a task as complete
Command Description
cotask log Show commit history
cotask checkout <ref> Switch branch/tag/commit
cotask diff <c1> <c2> Compare two commits
cotask revert <commit> Revert state
Command Description
cotask branch <name> Create branch
cotask merge <branch> Merge
cotask rebase <branch> Rebase
cotask branches List branches
cotask branch-delete <name> Delete branch
Command Description
cotask tag <name> Create tag
cotask tags List tags
Command Description
cotask stash Save state
cotask stash-pop Restore stash

πŸ’‘ Quick Start

cotask init
cotask add "Learn Rust"
cotask add "Build CLI"
cotask done 1
cotask log

🧠 How It Works

  • Commits β†’ Snapshot of task state
  • Branches β†’ Pointers in .cotask/refs/
  • Tags β†’ Fixed commit references
  • HEAD β†’ Current position
  • DAG β†’ Commit graph like Git

πŸ¦€ Built With

  • Rust
  • Serde
  • Standard Library

πŸ“Œ Future Ideas

  • Bisect
  • Commit signing
  • Storage compression
  • Remote sync
  • Interactive rebase
  • Hooks
  • Web UI

🀝 Contributing

  1. Fork
  2. Create branch
  3. Make changes
  4. Submit PR

πŸ“„ License

MIT LICENSE


cotask = Learn Rust + Learn Git Internals + Build a Real System πŸ¦€

Made with ❀️ using Rust and Serde

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •