Skip to content

๐Ÿ” 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

  • --branch is ignored for local paths.
  • If no textual files match the filters, youโ€™ll see a warning.
  • Use --log-level debug to 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


Back: Quickstart