Cloup is a template manager that provides the files you desire when you need them, written in Rust.

Overview

cloup

Downloads License

cloup is a template manager that delivers the files you desire when you need them, written in rust

you no longer need to locate your previous project and copy and paste files over

How it worksInstallation

Example image

Motivation

I always find myself having to go search for certain files or folders, usually config setups, that are the same across every project. These could be virtually anything, but for me it's usually .prettierrc, .eslintrc, tsconfig.json, tests/, etc.

The idea is to be able to retrieve these files at the speed of light in any project I need them. So.. instead of locating an old project and copying the files to then paste in the new project, I wanted a way to save them as templates and be able to apply them into the current directory with a command, but also to be able to create my own version of base templates with already-configured settings.

No longer do you need to use the same create-app-* and then change it to your liking. Run it once, create a base template that you like, and use cloup apply <your-template-name> and it inserts all the folders and files recursively into the current directory.

How it works

Say you have a folder with some files:

project
│   .prettierrc
│   .eslintrc
│   index.ts
│   package.json
│   tsconfig.json
└───src
    │   index.ts
    │   utils.ts
    └───folder
        │   another_file.ts
        │   ...

and you want to re-use the .prettierrc and .eslintrc for every project, you can create a cloup of those files by running the following command:

$ cloup create react-dotfiles -f .prettierrc .eslintrc

We've now created a cloup called react-dotfiles.

Now, say you create a new project:

new-project
│   index.ts
│   package.json
│   tsconfig.json

To apply the cloup in this directory, we simply run this command in the same directory:

$ cloup apply react-dotfiles

And the file tree now looks like this:

new-project
│   .prettierrc
│   .eslintrc
│   index.ts
│   package.json
│   tsconfig.json

It's that simple.

However, cloups are not limited to single files or folders. In the above examples, we used the -f flag to specify individual files and folders we wish to include in our cloup, but we can also create cloups of entire folders, with all their files recursively included.

Take this example:

project
│   .prettierrc
│   .eslintrc
│   index.ts
│   package.json
│   tsconfig.json
└───src
    │   index.ts
    │   ...
────tests
    │   ...

If we wanted this to be our "base template" for every new project we start, we can cloup the entire file by only giving the cloup a name and no extra arguments:

$ cloup create base-template

Now you can apply this cloup to any new empty folder with $ cloup apply base-template and have the entire folder structure with already-configured files and configs in moments.

Installation

Cloup is currently only available through Homebrew and Cargo. Other methods of installation are on the way!

Homebrew

$ brew tap benja/tap
$ brew install cloup

Cargo

$ cargo install cloup

Setup

After a successful install, create a new directory somewhere on your computer and run $ cloup init in that folder to initialise it as the template directory.

This is where all your cloups will be stored. Feel free to keep this folder versioned so you never lose your cloups if you switch computers.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

You might also like...
A blazing fast, type-safe template engine for Rust.

markup.rs A blazing fast, type-safe template engine for Rust. markup.rs is a template engine for Rust powered by procedural macros which parses the te

This is a template to build secret contracts in Rust to run in Secret Network

Secret Contracts Starter Pack This is a template to build secret contracts in Rust to run in Secret Network. To understand the framework better, pleas

A template to build smart contracts in Rust to run inside a Cosmos SDK module on all chains that enable it.

CosmWasm Starter Pack This is a template to build smart contracts in Rust to run inside a Cosmos SDK module on all chains that enable it. To understan

🖨 Template for Rust applications & smart contracts @okp4.

Rust Template Template for Rust projects @okp4. Purpose & Philosophy This repository holds the template for building Rust projects with a consistent s

Minimal compile-time Rust template engine

boilerplate boilerplate is a minimal compile-time Rust text template engine. Quick Start Add boilerplate to your project's Cargo.toml: [dependencies]

A template for your next Rust project.

Opinionated Rust Template A template for your next Rust project. To start coding run: cargo generate tomkarw/opinionated-rust-template Only requires j

A template for command-line Rust programs

This is a template for command-line Rust programs. Clone and run the rename script with both a lowercase and UpperCase name. In the dev profile, depen

Rust-Rocket framework template Demo

rocketapp Rust-Rocket framework template Demo dependencies are defined in Cargo.toml Clone as: git clone https://github.com/srikantgdev/rocketapp [op

Rust Cannon Template 🦀 💣 💥

A build system and a minimal Rust program for building MIPS binaries that are executable in the context of [Optimism Cannon]

Comments
  • Ci tests (#2)

    Ci tests (#2)

    hey 👏

    Added Ci to build the project on:

    • Ubuntu 22.04
    • Ubuntu 20.04
    • macos 12
    • macos 11
    • Windows 2022 (server)
    • Windows 2019 (server)

    Don't seem as we are able to use for example windows 10 but windows server does the job aswell.

    I also added a linter which complains about normal problems: https://github.com/rust-lang/rust-clippy and rust fmt check.

    opened by emilpriver 3
Releases(v0.1.1)
Owner
Benjamin Akar
Software Engineer & Designer
Benjamin Akar
A mdbook preprocessor that allows the re-usability of template files with dynamic arguments

mdbook-template A mdbook preprocessor that allows the re-usability of template files with dynamic arguments Table of Contents Author Notes Installatio

Hamothy 7 Dec 22, 2022
A CLI application which allows you to archive Urbit channels and all linked content in them.

The Urbit Content Archiver is a small CLI application that exports channels from your Urbit ship and auto-downloads any directly linked content locall

Robert Kornacki 33 Sep 25, 2022
A prototype project integrating jni rust into Kotlin and using protobuf to make them work together

KotlinRustProto a prototype project integrating jni rust into Kotlin and using protobuf to make them work together How to start add a RPC call in Droi

woo 11 Sep 5, 2022
Teach best practices by violating them.

Substrate Node Template A fresh FRAME-based Substrate node, ready for hacking ?? Getting Started Follow the steps below to get started with the Node T

Alexander Popiak 20 Dec 17, 2022
Taking the best of Substrate Recipes and applying them to a new framework for structuring a collection of how-to guides.

Attention: This repository has been archived and is no longer being maintained. It has been replaced by the Substrate How-to Guides. Please use the Su

Substrate Developer Hub 35 Oct 17, 2022
Manage lockfiles in PKGBUILDs for upstreams that don't ship them, `updpkgsums` for dependency trees (Arch Linux tooling)

updlockfiles Manage lockfiles for packages that don't ship any upstream. Like updpkgsums but for 3rd party dependency trees. If you're not actively ma

null 11 Oct 27, 2022
A simple password manager written in rust

Passman - A password manager written in rust. How to use?: USAGE: passman option Currently available options are: new - initalize passman with a new m

Strawkage 7 Aug 26, 2021
A simple password manager written in Rust

ripasso A simple password manager written in Rust. The root crate ripasso is a library for accessing and decrypting passwords stored in pass format (G

Joakim Lundborg 550 Dec 30, 2022
A lightning-fast password generator and manager written in Rust

Passlane A lightning-fast password manager for the command line Features Generate passwords Place the generated password into the clipboard Save previ

Anssi Piirainen 4 Dec 15, 2022
Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana (WIP) ⛏👷🚧⚠️

Solana BPF Boilerplate Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana This boilerplate provides the following. Si

ono 6 Jan 30, 2022