#cpp #command-line-tool #cli #project-manager

app cpr-cli

A simple git-based project manager aimed at C/C++

7 releases

0.1.6 Feb 24, 2025
0.1.5 Feb 24, 2025

#553 in Command line utilities

Download history 252/week @ 2025-02-12 467/week @ 2025-02-19 114/week @ 2025-02-26

833 downloads per month

MIT license

34KB
704 lines

CPR

C PRoject manager

Crates.io Version Crates.io Size Crates.io License Crates.io Total Downloads

Description

CPR is a simple command line utility for managing C/C++ projects through templates. It allows you to initialize a new project and start working quickly while also giving template maintainers flexibility in how they want to structure their templates.

Features

  • Fetch templates from GitHub
  • Custom template questions
  • if and for statements in templates
  • Nested templates (TODO)

Non-Goals

While the structure of this project is not fully defined yet, the following are NOT goals of this project:

  • A full-fledged build system
  • A package manager

Installation

Prerequisites

  • Cargo
  • Rust 1.74.1 or later

Using cargo install

cargo install cpr-cli

Using cargo build

git clone https://github.com/cpr-rs/cpr.git
cd cpr
cargo build --release

Usage

A simple git-based project manager aimed at C/C++

Usage: cpr [OPTIONS] <COMMAND>

Commands:
  init  Initialize a directory with a template
  new   Create a new project with a template
  help  Print this message or the help of the given subcommand(s)

Options:
  -c, --config <CONFIG>  Global configuration file path
  -h, --help             Print help
  -V, --version          Print version

Configuration

The default configuration file should be located at $HOME/.cpr/config.toml. You can specify a custom configuration file using the -c or --config flag. Below is the default configuration file:

default_service = "gh"

[services.gh]
url = "https://github.com/{{ repo }}.git"

[services.gl]
url = "https://gitlab.com/{{ repo }}.git"

[services.bb]
url = "https://bitbucket.org/{{ repo }}.git"

Each prefix can then be used to fetch templates from the respective service. {{ repo }} will be replaced with the given requested repository. For example, to fetch the cpr-rs/cpp template from GitHub, you can use the following command:

cpr new gh:cpr-rs/cpp

License

This project is licensed under the MIT License - see the LICENSE file for details.

Dependencies

~20–36MB
~577K SLoC