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 fileadd— Add source code from GitHub, HTTP URLs, or ZIP archivesremove— Remove previously copied source filesupdate— Re-fetch specific tracked source(s) by pathupdate-all— Re-fetch all tracked sourceslicenses-sync— Reorganize license files (centralize or restore side-by-side)
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--freeze— Pin this source so update and update-all skip it--no-license— Skip copying license 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--overwrite— Overwrite existing files without prompting--skip— Skip existing files without prompting--freeze— Pin this source so update and update-all skip it--unfreeze— Unpin this source so it can be updated again
copit update-all
Re-fetch all tracked sources
Usage: copit update-all [OPTIONS]
Examples: # Re-fetch all tracked sources copit update-all
# Re-fetch all with backup for excluded modified files copit update-all --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--overwrite— Overwrite existing files without prompting--skip— Skip existing files without prompting
copit licenses-sync
Reorganize license files (centralize or restore side-by-side)
Usage: copit licenses-sync [OPTIONS]
Examples: # Move licenses into a centralized directory copit licenses-sync --licenses-dir licenses
# Move licenses back to side-by-side (next to each source) copit licenses-sync --no-dir
# Re-sync based on current config copit licenses-sync
Options:
--no-dir— Move licenses back to side-by-side (remove licenses_dir)-l,--licenses-dir <LICENSES_DIR>— Move licenses into a centralized directory--dry-run— Preview what would be moved without making changes
This document was generated automatically by
clap-markdown.