/rtask

📝 Manage your tasks effortlessly with this Rust & SQLx-based to-do app, enabling you to add, complete, and list tasks with simple commands!

Primary LanguageRustGNU General Public License v3.0GPL-3.0

TODOs Example

Setup

  1. Declare the database URL
  • GNU/Linux /w Bash
export DATABASE_URL="sqlite:todos.db"
  • For Command Prompt (cmd.exe)
set DATABASE_URL=sqlite:todos.db
  • PowerShell
$env:DATABASE_URL="sqlite:todos.db"
  1. Create the database.
sqlx db create
  1. Run SQL migrations
sqlx migrate run

Usage

Using Cargo Commands

Add a todo:

cargo run -- add "todo description"

Add a todo with a category:

cargo run -- add "todo description" "category name"

Complete a todo:

cargo run -- done <todo_id>

List all todos:

cargo run

Delete all completed todos:

cargo run -- delete-done

Using Justfile Aliases

Initialize the database and run migrations:

just init
just i

Add a todo:

just add "todo description"
just a "todo description"

Add a todo with a category:

just add "todo description" "category name"
just a "todo description" "category name"

Complete a todo:

just done <todo_id>
just d <todo_id>

List all todos:

just list
just ls

List all todos filtered by category:

just list "category name"
just ls "category name"

Delete all completed todos:

just delete-done
just dd

Run Clippy to check for common mistakes:

just clippy
just c

Format the code using Rustfmt:

just format
just f