Little example projects for learning Rust and building awesome cli tools! ⭐️

Overview

rust-cli-examples

Examples of clean and well-tested command line utilities, written in Rust. 🦀 👍

What is this repo?

This repo is a collection of many extremely small Rust projects.

This idea is to break down otherwise scary Rust code into small, approachable little functions.

The numbers prefixing each folder are meant to be a recommended path to following in exploring these projects, but feel free to jump around as they are completely independent of each other!


Running The Projects

In order to encapsulate each little example as a separate project we have freely called cargo new ___ to create many projects, each named in a way to describe the new thing it introduces.

First ensure you have rust and cargo installed:

You can then navigate into each project folder and run the cli tool:

cargo run

Note: look for tips and information for a better understanding in the rust source code files of each project

You can also run the automated tests:

cargo test

Note: This runs both unit tests and integration tests!

In addition to just running the tests, you can check code coverage:

cargo tarpaulin --out Html

Then view the tarpaulin-report.html file in a browser.


Why Rust For CLI Tools?

There are a few reasons why Rust makes an excellent language for writing command line utilities.

  • GC Free Programs

    Often times there is a delay on startup and during heavy processing for languages with a garbage collector.

    Since Rust CLI programs do not have to boot up a vm or gc they can extremely fast, thus saving developer time, energy, and happiness in addition to company dollars!

  • Cargo Is Awesome

    Cargo makes it very easy to build and deploy cli tools, and not just to cargo- you can also publish your super efficient binary to other package managers like npm!

  • Very Small Projects

    CLI tools, like the ones here, can be very small and self contained. These projects are meant to be an approachable way to ease into nuanced syntax of Rust. Although building massively scalable and intricate servers and websites in Rust is awesome

    It can sometimes be challenging to deal with all the networking nuances that come with building, deploying, and maintaining these. Here we aim to write friendly Rust code that's not scary!

  • Great For Low Level Things

    Rust code can interact extremely well with os calls, C/C++, and other low-level things that you might want a cli tool to do.

  • Coding In Rust Is Fun!!

    Once you get the hang of it you may find that you actually really enjoy working on projects in Rust. There is a reason why it is voted the "Most Loved Programming Language" on the Stack Overflow survey every year!


Contributing

Have a cool little cli tool you want to show off to others? Feel free to add a pull request! Also, feel free to open an issue just to discuss before hand or if you have any questions about the code / projects here.


Thanks!

Dang, you really are still reading this document?? Well, I'd love to get your feedback so feel free to open an issue about whatever and/or message me on the socials @JimLynchCodes. Also, if you like this repo it would mean so much to me if you could please give it a star. ⭐️ Thanks for stopping by!

You might also like...
'apk-yara-checker' is a little CLI tool written in Rust to check Yara rules against a folder of APK files.
'apk-yara-checker' is a little CLI tool written in Rust to check Yara rules against a folder of APK files.

apk-yara-checker 'apk-yara-checker' is a little CLI tool written in Rust to check Yara rules against a folder of APK files. You have to pass the folde

A CLI tool to get help with CLI tools 🐙
A CLI tool to get help with CLI tools 🐙

A CLI tool to get help with CLI tools 🐙 halp aims to help find the correct arguments for command-line tools by checking the predefined list of common

An awesome language and its compiler.

Calocom Project Build Build with cargo-make Just run cargo make in the root directory of the project. Or, if you want to build it in release mode, run

rust awesome(资源). 💥
rust awesome(资源). 💥

Rust Boom 💥 Rust Boom 是一个仓主在学习使用 Rust 的时候,对 Rust 的一些难点的解决方法以及一些 Rust 开源的好玩的库、书籍、文章的整理,希望可以帮助更多的 Rust 初学者来翻过 Rust 这座大山。 TOC Rust Boom 💥 TOC Blasting

Super-lightweight Immediate-mode Embedded GUI framework, based on the awesome embedded-graphics library. Written in Rust.

Kolibri - A GUI framework made to be as lightweight as its namesake What is Kolibri? Kolibri is an embedded Immediate Mode GUI mini-framework very str

Rust awesome(资源). 💥
Rust awesome(资源). 💥

Rust Boom 💥 Rust Boom 是一个仓主在学习使用 Rust 的时候,对 Rust 的一些难点的解决方法以及一些 Rust 开源的好玩的库、书籍、文章的整理,希望可以帮助更多的 Rust 初学者来翻过 Rust 这座大山。 TOC Rust Boom 💥 TOC Blasting

awesome fullstack rust web framework, made by axum & shaku & yew

Awesome Rust Full Stack Web Framework With Axum && shaku && yew, this repository represents how can we construct new web server used by rust. Still in

Just in time Oxidation. A little experimentation with inkwell and copy-and-patch compilation

Experimental Copy-and-Patch compiler backend written in Rust This is supposed to become an experimental compiler backend based on Copy and Patch to be

Zash - A Zuper Awesome Shell
Zash - A Zuper Awesome Shell

Zash - A Zuper Awesome Shell Welcome to zash, its activily being developed and is not near a stable release. Installation Arch: yay -S zash Paru seem

Owner
Jim Lynch
Mathematician, software engineer, and philosopher from the NJ / NYC area. Loves pair programming and TDD'ing some code.
Jim Lynch
Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other projects

Mercy ?? Documentation Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other pro

Umiko Security 2 Nov 27, 2022
Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other projects

Mercy ?? Documentation Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other pro

CyberSuki 2 Nov 27, 2022
An awesome CLI tool for effectively learning Rust and more. Project winner of the RustFi 2022 hackathon

rlrn An awesome CLI tool for effectively learning Rust and more Table of Contents About The Project Built With Getting Started Prerequisites Installat

Victor Kostyuk 6 Dec 25, 2022
Curated list of awesome projects and resources related to Rust and computer security

Awesome Rust Security Curated list of awesome projects and resources related to Rust and computer security Table of Contents Tools Web and Cloud Secur

Alan 131 Jan 1, 2023
(Pre-Release Software) Secure, Encrypted, P2P chat written atop Warp, IPFS, LibP2P, Dioxus and many more awesome projects and protocols.

Uplink Privacy First, Modular, P2P messaging client built atop Warp. Uplink is written in pure Rust with a UI in Dioxus (which is also written in Rust

Satellite 13 Jan 25, 2023
A simple cli to clone projects and fetch all projects in a GitHub org..

stupid-git A simple cli to clone projects and update all projects. get all repository from GitHub clone all pull all with git stash Usage create sgit.

Fengda Huang 5 Sep 15, 2022
Striving to create a great Application with full functions of learning languages by ChatGPT, TTS, STT and other awesome AI models

Striving to create a great Application with full functions of learning languages by ChatGPT, TTS, STT and other awesome AI models, supports talking, speaking assessment, memorizing words with contexts, Listening test, so on.

null 155 Apr 20, 2023
CLI program for building generative projects

NFT image generator This is the project to help artists to generate NFT collection, which can be generated from layers of PNG images. Usage Get archiv

null 10 Apr 27, 2022
⚙️ A curated list of static analysis (SAST) tools for all programming languages, config files, build tools, and more.

This repository lists static analysis tools for all programming languages, build tools, config files and more. The official website, analysis-tools.de

Analysis Tools 10.7k Jan 2, 2023
A toolkit for building your own interactive command-line tools in Rust

promkit A toolkit for building your own interactive command-line tools in Rust, utilizing crossterm. Getting Started Put the package in your Cargo.tom

null 70 Dec 18, 2022