Recommendations on file/dir/module structure, common dependencies, and/or anti-patterns for writing CLI tool in Rust

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • SonarQube - Static code analysis for 29 languages.
  • InfluxDB - Access the most powerful time series database as a service
  • SaaSHub - Software Alternatives and Reviews
  • starship

    ☄🌌️ The minimal, blazing-fast, and infinitely customizable prompt for any shell!

    I'm quite new to Rust, and have been trying to learn more by working on some real solution I could see myself benefitting from, which happens to be a CLI tool at this time. I know there are some great tools written in Rust which I use day to day (such as Starship, bat, exa, etc.), but I wanted to hear experts' suggestions / recommendations on any project I should check out for clean, clear, and extensible structure (or lack thereof), and any dependencies I should start with / avoid.

  • bat

    A cat(1) clone with wings.

    I'm quite new to Rust, and have been trying to learn more by working on some real solution I could see myself benefitting from, which happens to be a CLI tool at this time. I know there are some great tools written in Rust which I use day to day (such as Starship, bat, exa, etc.), but I wanted to hear experts' suggestions / recommendations on any project I should check out for clean, clear, and extensible structure (or lack thereof), and any dependencies I should start with / avoid.

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • tokio

    A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...

    The main focus of the CLI tool would be around working on filesystem, and also making several network requests simultaneously. Although some may argue it would be easier/faster writing in other languages, this is more for my own learning to write in Rust. It will be a simple toy project at first, but I'd like to prepare for more complex Rust programming in the future with it. For instance, I see different directory / file / module structures used, Rust version / edition differences here and there, some common dependencies such as Tokio, etc.

  • exa

    A modern replacement for ‘ls’.

    I'm quite new to Rust, and have been trying to learn more by working on some real solution I could see myself benefitting from, which happens to be a CLI tool at this time. I know there are some great tools written in Rust which I use day to day (such as Starship, bat, exa, etc.), but I wanted to hear experts' suggestions / recommendations on any project I should check out for clean, clear, and extensible structure (or lack thereof), and any dependencies I should start with / avoid.

  • flux2

    Open and extensible continuous delivery solution for Kubernetes. Powered by GitOps Toolkit.

    Flux CLI (for Flux, GitOps) for Cobra based implementation with a clean and extensible setup

  • cobra

    A Commander for modern Go CLI interactions

    Flux CLI (for Flux, GitOps) for Cobra based implementation with a clean and extensible setup

  • cli

    GitHub’s official command line tool

    I personally prefer GitHub CLI implementation over Flux's, as the most of the implementation details are handled in separate, "internal" packages, making their responsibilities clear

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

  • mkcert

    A simple zero-config tool to make locally trusted development certificates with any names you'd like.

    mkcert for small dependency footprint - a bit more lengthy implementation but the code base is easy enough to follow

  • kubectl

    Issue tracker and mirror of kubectl code

    kubectl is for sure battle tested, but it involves very Kubernetes specific implementations and is going to be too complicated for the first pointer

  • glow

    Render markdown on the CLI, with pizzazz! 💅🏻

    Charm's Glow is a joy to use, a good example of having the Charm's Bubbletea usage - but from the code perspective, it's a bit difficult to navigate as many code paths are put in the same package

  • bubbletea

    A powerful little TUI framework 🏗

    Charm's Glow is a joy to use, a good example of having the Charm's Bubbletea usage - but from the code perspective, it's a bit difficult to navigate as many code paths are put in the same package

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts