Skip to content

anryts/todo-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My plan is to create simple todo app but in console. i want to use rust for this project. to store data, i will just use json file. example of this json file:

{
  "todos": [
    {
      "id": 1,
      "title": "Learn Rust",
      "description": "Learn rust programming language",
      "status": "incomplete"
    },
    {
      "id": 2,
      "title": "Learn JavaScript",
      "description": "Learn go programming language",
      "status": "incomplete"
    }
  ]
}

so, it will have todos array, and each todo will have id, title, description, and status.

i will create simple command line interface to interact with this json file. the commands will be:

  • add todo
  • list todos
  • complete todo
  • delete todo
  • update todo
  • search todo
  • help

I want to create more user-friendly interface, so I will use dialoguer crate to create interactive command line interface.

my checklist for this project:

  • create todo struct
  • create todo status enum
  • create todo service
    • add todo
    • list todos
    • complete todo
    • delete todo
    • update todo
    • search todo
  • create command line interface
    • add todo - bash command: todo add --title Learn Rust --description Learn rust programming language
    • list todos - bash command: todo list --status 1
      • add more advanced print
    • complete todo - bash command: todo complete --id 1
    • delete todo - bash command: todo delete --id 1
    • update todo - bash command: todo update --id 1 --title "Learn Rust" --description "Learn rust programming language"
    • search todo - bash command: todo search --title "Learn Rust"
    • help - bash command: todo help
  • create json file service
    • read json file
    • write json file
  • add help command

CLI commands

I will call it from terminal like this:

$ todo add --title "Learn Rust" --description "Learn Rust programming language"
$ todo list --status "incomplete"
$ todo complete --id 1
$ todo delete --id 1
$ todo update --id 1 --title "Learn Rust" --description "Learn Rust programming language"
$ todo search --title "Learn Rust"
$ todo help

in future, need to do more fancy TUI

thanks to my memory, I will write some shortcuts for me in future

  • how to call something, examples:

About

my implementing todo cli with rust and clap library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages