23 releases

0.1.23 Sep 5, 2023
0.1.22 Sep 5, 2023
0.1.21 Aug 3, 2023
0.1.19 Jul 31, 2023

#451 in Command line utilities

Download history 24/week @ 2023-08-15 22/week @ 2023-08-22 2/week @ 2023-08-29 41/week @ 2023-09-05 27/week @ 2023-09-12 31/week @ 2023-09-19 39/week @ 2023-09-26 4/week @ 2023-10-03 1/week @ 2023-10-10 8/week @ 2023-10-17 5/week @ 2023-10-24 31/week @ 2023-10-31 5/week @ 2023-11-07 4/week @ 2023-11-14 74/week @ 2023-11-21 75/week @ 2023-11-28

158 downloads per month

MIT license

657 lines

Learn Rust by 500 lines code

crate_version crate_downloads license

English | 中文

  • RTD (Rust To Do) is a todo app cli tool write by 500 lines Rust code. (exclude space lines/comments/long line break display/test code)
  • RTD is also a tutorial, designed to learn Rust by doing.


Table of contents

What can you learn from RTD?

Assuming you know nothing about Rust, through the Learn Rust by 500 lines code tutorial, step by step to build the project from scratch, you will learn:

  • Rust common syntax
  • Rust module system (package/binary crate/library crate/mod/pub/use)
  • Rust ownership model (Bernstein conditions)
  • Rust lifetime
  • Rust error/null handling model (Result<T, E>/Option<T>)
  • Rust generic
  • Rust pattern matching (if let , match ...)
  • Rust unit test
  • Rust file I/O (File Seek/Buffed File I/O)
  • Rust manipulating environment variables
  • Rust command line parameter parsing
  • Rust release package to crate.io
  • The general process of developing a program (requirements/design/implementation/testing/release/maintenance)
  • Layered abstraction (data storage layer/model mapping layer/data model layer/business logic layer/application interface layer/user interface layer)
  • Handwritten serialization/deserialization from scratch
  • Implement the recycle bin function (virtualization concept)



Use a local file $HOME/.rtd.csv store all data

data_storage rtd_list_all

After completing this tutorial or installing RTD directly, you will get:

  • Extremely lightweight and concise todo command line application
  • Cross-platform, Rust's excellent build system naturally supports cross-platform
  • Safe, supports recycle bin, completely local, no network, no database
  • All data storage uses only one local csv file, which can be switched between different machines by copying the csv file

Interesting fact: I use RTD to complete the RTD tutorial :)

If you like my tutorial, don't forget to give me a star~


  • Rust is naturally cross-platform. This project is built and tested in the linux environment, and Windows/MacOS are also supported. You can choose to download the corresponding Cargo according to your own operating system.
  • Cargo Rust's package management and build tool, can be installed directly through the Rust official website rustup one line command. Then, all things will be done by Cargo, so cute, right?


Via crate.io :

cargo install rtd-tutorial

Or via git repo :

git clone https://github.com/cuppar/rtd.git
cargo install --path rtd


View help document

rtd -h
rtd --help

rtd_help_summary rtd_help

Add a todo

rtd -a <item-name>
rtd --add <item-name>


List all uncompleted todos

rtd -l
rtd -l uncompleted
rtd --list
rtd --list uncompleted


Complete a todo

rtd -c <item-id>
rtd --complete <item-id>


List all completed todos

rtd -l completed
rtd --list completed


Uncomplete a todo

rtd -u <item-id>
rtd --uncomplete <item-id>


Throw a todo into the recycle bin

rtd -d <item-id>
rtd --delete <item-id>


List all recycle bin todos

rtd -l deleted
rtd --list deleted


Restore a todo from the recycle bin

rtd -r <item-id>
rtd --restore <item-id>


Physically destroy a todo

rtd --destroy <item-id>


Empty recycle bin

rtd --destroy-deleted


List all todos

rtd -l all
rtd --list all


Clear all todos

rtd --clear


About author

Cuppar He(He Zhiying), software development engineer, likes programming, technical writing, learning new things, especially computer science, worked for SAP(World Top 100) and Alibaba Group(World Top 100 & Chinese internet giant). I am currently in Gap Year, if you are looking for a software development engineer and can provide a high-quality offer(Both remote and on-site), please contact me cuppar.hzy@gmail.com.