copytree [path] [options]Arguments:
path- Directory path or GitHub URL to copy (defaults to current directory)
Use a specific profile for file selection. If omitted, CopyTree uses the default profile.
Examples:
copytree --profile mycustom
copytree -p mycustomNote: The default profile is automatically used when no profile is specified. Create custom profiles in ~/.copytree/profiles/ or .copytree/ for project-specific needs.
Include files matching glob patterns. Can be used multiple times.
copytree --filter "*.js" --filter "*.ts"
copytree -f "src/**/*.php" -f "tests/**/*.php"Only include files modified since the last Git commit.
copytree --modified
copytree -mInclude files changed since a specific Git reference (commit, branch, or tag).
copytree --changed HEAD~5
copytree -c main
copytree --changed v1.0.0Save output to a file.
copytree --output output.xml
copytree -o output.xmlDisplay output in console instead of copying to clipboard.
copytree --display
copytree -iStream output without buffering (useful for piping).
copytree --stream | less
copytree -S > project.xmlExplicitly copy to clipboard (default behavior).
copytree --clipboardOutput format: xml, markdown|md, json, ndjson, sarif, or tree.
Default: xml
copytree --format json
copytree --format ndjson
copytree --format sarif
copytree --format tree
copytree --format xml # default
copytree --format markdownLimit to first N files processed.
copytree --head 50
copytree -l 100Character limit for total output.
copytree --char-limit 100000
copytree -C 50000Show only directory structure, no file contents.
copytree --only-tree
copytree -tSort files by: path, size, modified, name, or extension.
copytree --sort modified
copytree --sort size
copytree -s nameInclude Git status indicators for each file.
copytree --with-git-statusAlways include these patterns (force-include), even if excluded by profile.
copytree --always "*.config.js" --always "config.example.js"Include line numbers in output.
copytree --with-line-numbersShow file sizes in output.
copytree --show-sizeShow information table with project statistics.
copytree --infoInclude binary files in output (normally excluded).
copytree --include-binaryRemove duplicate files from output.
copytree --dedupeGenerate reference documentation format.
copytree --as-reference
copytree -rInclude external sources (GitHub URLs or local paths).
copytree --external https://github.com/user/repoNote: Transformers are configured in profiles, not via CLI flags. Built-in transformers include file-loader, binary, and streaming-file-loader.
Simulate execution without generating output.
copytree --dry-runValidate profile syntax without processing files.
copytree --validate --profile myprofileDisable caching for AI operations and external sources.
copytree --no-cacheDisable configuration validation (for testing/debugging).
copytree --no-validateDisable including instructions in output.
copytree --no-instructionsUse custom instructions set (default: default).
copytree --instructions custom
copytree --instructions default0- Success1- Profile validation or loading errors2- Invalid option combination3- File system or Git errors
# Copy current directory to clipboard
copytree
# Copy specific directory
copytree /path/to/project
# Copy from GitHub
copytree https://github.com/facebook/react# Uses default profile automatically
copytree
# Use custom profile
copytree --profile mycustom
# Preview profile selection
copytree --profile mycustom --dry-run# Pattern matching
copytree --filter "src/**/*.js" --filter "*.json"
# Git integration
copytree --modified
copytree --changed HEAD~5# Save to file (Markdown by default)
copytree --output project-snapshot.md
# Save as XML
copytree --output project-snapshot.xml --format xml
# Display in console
copytree --display
# Different formats
copytree --format json
copytree --format tree# Combine multiple options
copytree --profile myproject --modified --output snapshot.md
# Dry run with validation
copytree --dry-run --validate
# Limit output
copytree --head 50 --char-limit 100000
# Stream large projects
copytree --stream | gzip > project.md.gz- The
--validateoption cannot be combined with output options or filters - External sources (GitHub URLs) are cached by default in
~/.copytree/repos/ - Use
DEBUG=copytree:*environment variable for detailed debugging