Skip to content

Command-Line Help for copit

This document contains the help content for the copit command-line program.

Command Overview:

copit

Copy reusable source code into your project

Usage: copit <COMMAND>

Subcommands:
  • init — Initialize a new copit.toml config file
  • add — Add source code from GitHub, HTTP URLs, or ZIP archives
  • remove — Remove previously copied source files
  • update — Re-fetch specific tracked source(s) by path
  • sync — Re-fetch all tracked sources

copit init

Initialize a new copit.toml config file

Usage: copit init

copit add

Add source code from GitHub, HTTP URLs, or ZIP archives

Usage: copit add [OPTIONS] [SOURCES]...

Examples: # Copy a single file from GitHub copit add github:owner/repo@v1.0.0/src/utils.rs

# Same, using the short alias copit add gh:owner/repo@v1.0.0/src/utils.rs

# Copy an entire folder from GitHub copit add gh:owner/repo@main/src/helpers

# Copy a raw file from a URL copit add https://example.com/LICENSE-MIT

# Copy a file from a ZIP archive copit add https://example.com/archive.zip#src/utils.rs

# Copy to a specific directory copit add gh:owner/repo@v1.0.0/src/lib.rs --to vendor/

Arguments:
  • <SOURCES> — Source(s) to add

Supported formats: github:owner/repo@ref/path - file or folder from a GitHub repo (alias: gh:) https://example.com/file.txt - raw file from a URL https://...archive.zip#path - file or folder inside a ZIP archive

Options:
  • --to <TO> — Target directory to copy files into
  • --overwrite — Overwrite existing files without prompting
  • --skip — Skip existing files without prompting
  • --backup — Save .orig copy of new version for excluded modified files

copit remove

Remove previously copied source files

Usage: copit remove [OPTIONS] [PATHS]...

Examples: # Remove a specific file copit remove vendor/lib.rs

# Remove multiple files copit rm vendor/lib.rs vendor/utils.rs

# Remove all tracked sources copit rm --all

Arguments:
  • <PATHS> — Path(s) to remove (as shown in copit.toml)
Options:
  • --all — Remove all tracked sources

copit update

Re-fetch specific tracked source(s) by path

Usage: copit update [OPTIONS] [PATHS]...

Examples: # Re-fetch a specific tracked source copit update vendor/mylib

# Re-fetch with a new version copit update vendor/mylib --ref v2.0

# Re-fetch with backup for excluded modified files copit update vendor/mylib --backup

Arguments:
  • <PATHS> — Path(s) to update (as shown in copit.toml)
Options:
  • --ref <VERSION_REF> — Override the version ref for this update
  • --backup — Save .orig copy of new version for excluded modified files

copit sync

Re-fetch all tracked sources

Usage: copit sync [OPTIONS]

Examples: # Re-fetch all tracked sources copit sync

# Re-fetch all with backup for excluded modified files copit sync --backup

Options:
  • --ref <VERSION_REF> — Override the version ref (only valid with a single source)
  • --backup — Save .orig copy of new version for excluded modified files

This document was generated automatically by clap-markdown.