๐ Scanning Repositories¶
The gittxt scan command is the core of the Gittxt CLI. It extracts structured, AI-ready outputs from local folders or GitHub repositories.
๐ฆ Basic Usage¶
gittxt scan [REPO] [OPTIONS]
You can provide:
- A local path (e.g., .)
- A GitHub URL (e.g., https://github.com/sandy-sp/gittxt)
๐ง Common Options¶
| Flag | Description | 
|---|---|
-o, --output-dir | 
Output location (default: ~/Gittxt) | 
-f, --output-format | 
Formats: txt, json, md (comma-separated) | 
--zip | 
Bundle outputs into a .zip archive | 
--lite | 
Generate minimal reports (summary only) | 
-x, --exclude-dir | 
Exclude folder paths | 
-i, --include-patterns | 
Include only specific file globs | 
-e, --exclude-patterns | 
Exclude file globs | 
--sync | 
Sync with .gitignore rules | 
--size-limit | 
Skip files over N bytes | 
--branch | 
Branch name (GitHub repos only) | 
--tree-depth | 
Limit directory tree depth | 
--log-level | 
Logging level: debug, info, warning, error | 
--docs | 
Only scan Markdown docs (e.g. README.md, guides) | 
--no-tree | 
Exclude directory tree section from all output formats | 
๐ Scan Remote Repositories¶
gittxt scan https://github.com/sandy-sp/gittxt
Target a branch or subfolder:
gittxt scan https://github.com/sandy-sp/gittxt --branch gh-pages --subdir cli-reference
๐ Scan Local Directories¶
gittxt scan . --output-format txt,json
Exclude directories:
gittxt scan . -x node_modules -x tests
Include only Python and Markdown:
gittxt scan . -i "**/*.py" -i "**/*.md"
๐งช Scan Command Examples¶
Full scan with Markdown and JSON output¶
gittxt scan https://github.com/sandy-sp/gittxt -f md,json
Scan only Markdown files¶
gittxt scan --docs https://github.com/sandy-sp/gittxt
Skip directory tree¶
gittxt scan --no-tree https://github.com/sandy-sp/gittxt
Minimal scan¶
gittxt scan --lite https://github.com/sandy-sp/gittxt
---¶
โ ๏ธ Warnings and Tips¶
--branchis ignored for local paths.- If no textual files match the filters, youโll see a warning.
 - Use 
--log-level debugto see skipped files and reasons. 
โ Sample Command¶
gittxt scan https://github.com/sandy-sp/gittxt \
  -f txt,json \
  --zip \
  --lite \
  -i "**/*.py" \
  -e "tests/**" \
  --log-level info
๐งช Next Steps¶
- Learn how to customize scan behavior with Configuration
 - Explore available Output Formats
 - Reverse engineer previous scans with Reverse Engineering
 
Back: Quickstart