All Projects → iamsauravsharma → cargo-trim

iamsauravsharma / cargo-trim

Licence: MIT license
Binary application to clean up .cargo/registry & .cargo/git cache

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to cargo-trim

Semantic Rs
🚀 Automatic crate publishing done right
Stars: ✭ 162 (+980%)
Mutual labels:  crates, cargo
Cargo Deny
❌ Cargo plugin for linting your dependencies 🦀
Stars: ✭ 533 (+3453.33%)
Mutual labels:  crates, cargo
kingslayer
A text-based adventure written in Rust
Stars: ✭ 28 (+86.67%)
Mutual labels:  crates, cargo
cargo-limit
Cargo with less noise: warnings are skipped until errors are fixed, Neovim integration, etc.
Stars: ✭ 105 (+600%)
Mutual labels:  crates, cargo
Alexandrie
An alternative crate registry, implemented in Rust.
Stars: ✭ 251 (+1573.33%)
Mutual labels:  crates, cargo
Meuse
A private Cargo crate registry, for Rust
Stars: ✭ 173 (+1053.33%)
Mutual labels:  crates, cargo
cargo-esr
Extended Search & Ranking tool for crates.
Stars: ✭ 23 (+53.33%)
Mutual labels:  crates, cargo
Naersk
Build rust crates in Nix. No configuration, no code generation, no IFD. Sandbox friendly.
Stars: ✭ 193 (+1186.67%)
Mutual labels:  crates, cargo
naersk
Build rust crates in Nix. No configuration, no code generation, no IFD. Sandbox friendly. [maintainer: @Patryk27]
Stars: ✭ 440 (+2833.33%)
Mutual labels:  crates, cargo
crates
crates is an extension aims to help people to manage their dependencies for rust (crates.io & TOML).
Stars: ✭ 156 (+940%)
Mutual labels:  crates, cargo
cross
“Zero setup” cross compilation and “cross testing” of Rust crates
Stars: ✭ 3,550 (+23566.67%)
Mutual labels:  cargo
nix-template
Make creating nix expressions easy
Stars: ✭ 161 (+973.33%)
Mutual labels:  cargo
minreq
Simple, minimal-dependency HTTP client.
Stars: ✭ 91 (+506.67%)
Mutual labels:  crates
obj-rs
Wavefront obj parser for Rust
Stars: ✭ 57 (+280%)
Mutual labels:  crates
gist
A simple Github Gist client
Stars: ✭ 27 (+80%)
Mutual labels:  cargo
salak.rs
A multi layered configuration loader and zero-boilerplate configuration parser.
Stars: ✭ 27 (+80%)
Mutual labels:  crates
crates-io-cn
Source code of crates-io.cn, also tools sets for sync crates.io
Stars: ✭ 20 (+33.33%)
Mutual labels:  crates
version-compare
↔️ Rust library to easily compare version strings. Mirror from https://gitlab.com/timvisee/version-compare
Stars: ✭ 32 (+113.33%)
Mutual labels:  crates
rust-kernel-barebones
A minimal 64-bit rust kernel and a bunch of configuration scripts that can be used to bootstrap Operating system development using Nightly-Rust compiler.
Stars: ✭ 42 (+180%)
Mutual labels:  cargo
MysteryBox
Crate implemention for PocketMine-MP (PMMP)
Stars: ✭ 19 (+26.67%)
Mutual labels:  crates

CARGO-TRIM

Project status & info:

License Crates Version
License: MIT Crate

Binary application for cleaning $CARGO_HOME/registry & $CARGO_HOME/git folder support orphan and old crates cleaning Default $CARGO_HOME is set as $HOME/.cargo

Install

For installation of cargo-trim:- You can install from crates.io registry

    cargo install cargo-trim

OR

For bleeding edge latest development version:

    cargo install --git https://github.com/iamsauravsharma/cargo-trim

Setup

Initially you need to set up cargo-trim for some commands such as orphan clean to work properly. To set up cargo-trim to properly work for all projects related to rust lang go to directory where all projects lies and run cargo trim init. You can even run this command multiple time to add multiple directory. Or run command cargo trim -d <directory-path>. All projects inside the directory will be used for listing orphan crates. So if there are any projects in the other directory then their dependencies will be classified as orphan crates. If not used by any other crates.

Command output

All cargo-trim can be run using cargo trim <command> cargo trim --help will produce out following output which list out all of available command for cargo-trim

cargo-trim 0.8.1
Saurav Sharma <[email protected]>
Binary application to cleanup $CARGO_HOME cache

USAGE:
    cargo-trim [OPTIONS] [SUBCOMMAND]

OPTIONS:
    -a, --all
            Clean up all registry & git crates

    -d, --directory <DIRECTORY>
            Extra list of directory of Rust projects for current command [env: TRIM_DIRECTORY=]

    -g, --gc <GIT_COMPRESS>
            Git compress to reduce size of .cargo (git command required) [possible values: all,
            index, git, git-checkout, git-db]

    -h, --help
            Print help information

    -i, --ignore <IGNORE>
            Extra list of ignore file name which should be ignored for current command [env:
            TRIM_IGNORE=]

    -l, --light
            Light cleanup repo by removing git checkout and registry source but stores git db and
            registry archive for future compilation without internet requirement

    -n, --dry-run
            Run command in dry run mode to see what would be done

    -o, --old
            Clean old cache crates

    -q, --query
            Return size of different .cargo/cache folders

    -r, --remove <crate>
            Remove provided crates from registry or git

        --scan-hidden-folder <SCAN_HIDDEN_FOLDER>
            Whether to scan hidden folder for current command [env: TRIM_SCAN_HIDDEN_FOLDER=]
            [possible values: true, false]

        --scan-target-folder <SCAN_TARGET_FOLDER>
            Whether to scan target folder for current command [env: TRIM_SCAN_TARGET_FOLDER=]
            [possible values: true, false]

    -t, --top <number>
            Show certain number of top crates which have highest size

    -u, --update
            Generate and Update Cargo.lock file present inside config directory folder path

    -V, --version
            Print version information

    -w, --wipe <folder>
            Wipe folder [possible values: git, checkouts, db, registry, cache, index, index-cache,
            src]

    -x, --orphan
            Clean orphan cache crates i.e all crates which are not present in lock file generated
            till now use cargo trim -u to guarantee your all project generate lock file

    -z, --old-orphan
            Clean crates which is both old and orphan

SUBCOMMANDS:
    clear       Clear current working directory from cargo cache config
    config      Query about config file data used by CLI
    git         Perform operation only to git related cache file
    help        Print this message or the help of the given subcommand(s)
    init        Initialize current working directory as cargo trim directory
    list        List out crates
    registry    Perform operation only to registry related cache file
    set         Set config file values
    unset       Unset values from config file

Configuration

cargo-trim store its config file to config directory of OS and name config file as cargo_trim_config.toml. In file cargo-trim stores different information for scanning projects as well as listing crates. To list where cargo trim is storing config file you can use cargo trim config --location Below are a list of configuration and their default value a well as corresponding env variable that can be used for setting same value without editing config file

1. directory

default: []

env: TRIM_DIRECTORY

List of directory to scan for a Rust projects

2. ignore_file_name

default: []

env: TRIM_IGNORE

File/Directory name which should be ignored while scanning through directories. This can be used to exclude some folder such as npm node_modules folder or python venv folder if the directory present in config contains such folder it will help to significantly increase performance.

3. scan_hidden_folder

default: false

env: TRIM_SCAN_HIDDEN_FOLDER

Whether to scan hidden folder(i.e. folder which start with dot notation) or not

4. scan_target_folder

default: false

env: TRIM_SCAN_TARGET_FOLDER

Whether to scan target folder. Currently, it searches for environment variable CARGO_BUILD_TARGET_DIR or CARGO_TARGET_DIR or set default value as target to determine a target folder name

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].