An open API service indexing awesome lists of open source software.

https://github.com/cryptaliagy/cli-rs

A template repository for rapidly starting up new Rust-based CLI applications
https://github.com/cryptaliagy/cli-rs

Last synced: 5 months ago
JSON representation

A template repository for rapidly starting up new Rust-based CLI applications

Awesome Lists containing this project

README

          

# Rust Command Line Interface

[![tests](https://github.com/taliamax/cli-rs/actions/workflows/test.yml/badge.svg)](https://github.com/taliamax/cli-rs/actions/workflows/test.yml)
[![release](https://github.com/taliamax/cli-rs/actions/workflows/release.yml/badge.svg)](https://github.com/taliamax/cli-rs/actions/workflows/release.yml)
[![nightly-scan](https://github.com/taliamax/cli-rs/actions/workflows/nightly-scan.yml/badge.svg)](https://github.com/taliamax/cli-rs/actions/workflows/nightly-scan.yml)

This is a template repository meant to be used as a starting point for developing a new Rust-based CLI. This handles most of the key bootstrapping elements that I require when writing a new CLI.

## How to use

1. Create a new repository templated from this repo
1. Change the package name in the `Cargo.toml` file
1. Update `src/main` to use the new crate name
1. Update `.github/workflows/release.yml` to use the new binary name

## Features

### CLI

1. Logging configuration with the `tracing` crate
1. Initial base CLI struct with count-based verbosity
1. `manfile` generation on build based on `clap` CLI command

### CI/CD

1. PR / Testing pipeline with:
- Security scanning
- Linting with Clippy
- Cargo tests (debug)
1. A binary release pipeline for main branch (controlled through environment):
- Target can be set through environment variable in pipeline
- Major & Minor version tracked through `VERSION` file
- Patch version tracked through pipeline. Actual binary/crate version set at release time.
- `manfile` published alongside binary
- Manually-triggered release pipeline (can be configured to auto-deploy from main)
- Publishing to `crates.io` via commented-out section