How hassanhassankerdash/codetxt works
Project type and purpose
• CodeTxt is a Node.js / TypeScript CLI tool that “ingests” any Git repository (remote or local), filters and formats its code, and emits a prompt-friendly text dump for LLMs or other downstream consumers.
• It is not a full-stack app or microservices system; it is a single, monolithic CLI pipeline with well-defined modular stages.
File structure
• Top-level:
• README.md, package.json, tsconfig.json – project metadata, build and runtime configuration.
• src/ – the entire CLI implementation.
• src breakdown:
• index.ts – CLI entry point; wires up the command, flags, and kicks off main logic.
• main.ts – orchestrates the overall pipeline.
• clone.ts – handles git clone or local dir resolution.
• ingestion.ts – walks the filesystem or cloned repo to read files.
• query-parser.ts – parses include/exclude glob patterns and other flags.
• output-formatter.ts – assembles and writes the final text output.
• types.ts – shared type definitions across modules.
• utils/ – helper modules:
– constants.ts (flag defaults, size limits)
– ignore-helper.ts (parsing .gitignore and include-gitignored logic)
– pattern-matcher.ts (glob matching engine)
– display.ts (console logging, progress display)
• No additional services (databases, HTTP servers, etc.).
Key README insights
• Describes CLI flags and behavior (branch, max-size, include/exclude patterns, output destination).
• Emphasizes pattern-based filtering as a core feature.