{"id":48735097,"url":"https://github.com/scottbaggett/dex","last_synced_at":"2026-04-12T03:42:59.647Z","repository":{"id":304444055,"uuid":"1018763220","full_name":"scottbaggett/dex","owner":"scottbaggett","description":"Context optimization for agentic workflows. Extract and format code changes with surgical precision for LLM.","archived":false,"fork":false,"pushed_at":"2026-02-22T21:50:40.000Z","size":1441,"stargazers_count":3,"open_issues_count":24,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-23T00:30:33.043Z","etag":null,"topics":["agentic-ai","cli","context-engineering","llms"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scottbaggett.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-07-13T01:48:04.000Z","updated_at":"2026-02-22T21:50:44.000Z","dependencies_parsed_at":"2025-08-24T01:44:50.729Z","dependency_job_id":"062a5dfc-9c1d-41b2-b94e-56b549f58cb3","html_url":"https://github.com/scottbaggett/dex","commit_stats":null,"previous_names":["scottbaggett/dex"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scottbaggett/dex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottbaggett%2Fdex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottbaggett%2Fdex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottbaggett%2Fdex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottbaggett%2Fdex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottbaggett","download_url":"https://codeload.github.com/scottbaggett/dex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottbaggett%2Fdex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31703501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"online","status_checked_at":"2026-04-12T02:00:06.763Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-ai","cli","context-engineering","llms"],"created_at":"2026-04-12T03:42:58.807Z","updated_at":"2026-04-12T03:42:59.634Z","avatar_url":"https://github.com/scottbaggett.png","language":"TypeScript","readme":"# DEX\nContext extraction and codebase analysis for AI workflows. Generate precise, token‑efficient context, combine files, distill entire repos, and visualize APIs — all from one CLI.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Token_Efficiency-90%25_Reduction-cyan?style=for-the-badge\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/LLM_Ready-Markdown_JSON_txt-cyan?style=for-the-badge\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Focus-Surgically_Precise-cyan?style=for-the-badge\" /\u003e\n  \u003cbr/\u003e\n  \u003ci\u003eLocal installation via Bun\u003c/i\u003e\n  \u003cbr/\u003e\n  \u003ccode\u003egit clone\u003c/code\u003e\n  ·\n  \u003ccode\u003ebun link\u003c/code\u003e\n  ·\n  \u003ccode\u003edex --help\u003c/code\u003e\n\n\u003c/p\u003e\n\n## Quick Start\n\n```bash\n# Clone and install locally\ngit clone https://github.com/scottbaggett/dex.git\ncd dex\nbun install\nbun link\n\n# Now use dex globally\ndex --help\n\n# Extract your current changes (txt by default)\ndex -s --format md --clipboard\n```\n\n## Safety Stance\n\nDex treats AI context generation as a trust-boundary operation. When context leaves your repository and enters a model prompt, leakage risk is real.\n\nDex is opinionated by design:\n\n1. Always scan content for secrets and obvious PII before output.\n2. Redact sensitive spans by default.\n3. Write an audit manifest entry for every generated output.\n\nUnsafe behavior should be an explicit override, not a hidden default.\n\n## Core Commands\n\n## `Extract` (default command)\nExtracts Git changes and formats context for LLMs.\n\n```bash\ndex                         # Current unstaged changes\ndex -s                      # Staged changes only\ndex -a                      # Staged + unstaged\ndex HEAD~5..HEAD            # Specific commit range\ndex -p \"src/**\" -t ts,tsx    # Filter by path and types\ndex --select                # Interactive file picker (TTY)\n```\n\nKey options:\n- -s, --staged: Only staged changes\n- -a, --all: Staged + unstaged changes\n- --full \u003cpattern\u003e: Include full files matching pattern\n- --diff-only: Force diffs (disable Smart Context)\n- -p, --path \u003cpattern\u003e: Filter by file path\n- -t, --type \u003ccsv\u003e: Filter by file types (e.g. ts,tsx,js)\n- -f, --format \u003cfmt\u003e: md | json | txt (default: txt)\n- -c, --clipboard: Copy output to clipboard\n- -u, --include-untracked: Include untracked files\n- --untracked-pattern \u003cglob\u003e: Pattern for untracked files\n- --optimize \u003cflags...\u003e: aid, symbols\n- --no-metadata: Omit metadata block\n- --select: Interactive file selection (TTY)\n- --sort-by \u003copt\u003e: name | updated | size | status\n- --sort-order \u003cord\u003e: asc | desc\n- --filter-by \u003copt\u003e: all | staged | unstaged | untracked | modified | added | deleted\n- --include-sensitive: Include sensitive content without redaction safeguards\n- --target \u003ctarget\u003e: claude | gpt | local | custom (recorded in audit metadata)\n- --yes: Required in non-TTY usage with `--include-sensitive`\n\nOutputs are saved to `.dex/` by default unless `--clipboard`, `--stdout` (where available), or an explicit `--output` is used.\n\n## Distill\nExtract clean API signatures from entire codebases, removing implementation details for token-efficient LLM context.\n\n```bash\ndex distill .                          # Distill current project\ndex distill packages/api               # Distill a specific directory\ndex distill src/index.ts               # Distill a single file\ndex distill . --private 1              # Include private members\ndex distill . --include \"*.ts\"         # Only TypeScript files\ndex distill . --stdout                 # Print to stdout\n```\n\nKey options:\n- -f, --format \u003ctype\u003e: txt | md | json (default: txt)\n- -o, --output \u003cfile\u003e: Write to a specific file\n- -c, --clipboard: Copy output to clipboard\n- --stdout: Print to stdout\n- -s, --select: Interactive file selection\n- --include \u003cpatterns...\u003e: Include file patterns (e.g., \"*.ts\" \"src/**/*.js\")\n- --exclude \u003cpatterns...\u003e: Exclude file patterns\n- --comments \u003c0|1\u003e: Include comments (default: 0)\n- --docstrings \u003c0|1\u003e: Include docstrings (default: 1)\n- --private \u003c0|1\u003e: Include private members (default: 0)\n- --protected \u003c0|1\u003e: Include protected members (default: 0)\n- --internal \u003c0|1\u003e: Include internal members (default: 0)\n- --workers \u003cnumber\u003e: Number of worker threads (default: 1)\n- --dry-run: Preview what would be processed\n- --staged: Only process staged files\n- --include-sensitive: Include sensitive content without redaction safeguards\n- --target \u003ctarget\u003e: claude | gpt | local | custom (recorded in audit metadata)\n- --yes: Required in non-TTY usage with `--include-sensitive`\n\n## `Combine`\nCreate a single, LLM‑friendly document from many files.\n\n```bash\ndex combine src/auth/ src/api/         # Combine directories\ndex combine file1.ts file2.ts          # Combine specific files\ndex combine -s                         # Pick files interactively (TTY)\ndex combine --staged -c                # Use staged files; copy to clipboard\n```\n\n**Key options:**\n- -f, --format \u003cfmt\u003e: txt | md | json (default: txt)\n- --staged: Use all staged files (full contents)\n- -c, --clipboard: Copy to clipboard\n- -o, --output \u003cfile\u003e: Write to file instead of saving to `.dex/`\n- --include \u003cpatterns...\u003e: Include patterns, e.g. \"*.ts\" \"*.js\"\n- --exclude \u003cpatterns...\u003e: Exclude patterns, e.g. \"*.test.*\" \"*.spec.*\"\n- --max-files \u003cn\u003e: Limit files processed (default 1000)\n- --no-gitignore: Ignore .gitignore\n- -s, --select: Interactive picker (TTY)\n- --stdout: Print output to stdout\n- --since \u003cref\u003e: Only process files changed since git ref\n- --dry-run: Show what files would be processed\n- --include-sensitive: Include sensitive content without redaction safeguards\n- --target \u003ctarget\u003e: claude | gpt | local | custom (recorded in audit metadata)\n- --yes: Required in non-TTY usage with `--include-sensitive`\n\n## `Scan`\nRun detection-only safety scans without generating context artifacts.\n\n```bash\ndex scan .                  # Human-readable summary\ndex scan . --format json    # CI-friendly machine output\n```\n\n**Key options:**\n- -f, --format \u003cformat\u003e: txt | json (default: txt)\n\n### Tree\nGenerate a beautiful API tree or outline for quick understanding.\n\n```bash\ndex tree src/                          # Tree view\ndex tree . --outline                   # Outline view\ndex tree . --group-by type --show-types --show-params\n```\n\nKey options:\n- -o, --output \u003cfile\u003e: Write to file\n- --stdout: Print to stdout\n- -c, --clipboard: Copy to clipboard\n- --exclude \u003cpattern...\u003e: Exclude patterns\n- --include-private: Include private/internal APIs\n- --show-types: Show param and return types\n- --show-params: Show function parameters\n- --group-by \u003cmethod\u003e: file | type | none (default: file)\n\n\n## Installation\n\n### Local Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/scottbaggett/dex.git\ncd dex\n\n# Install dependencies and link globally\nbun install\nbun link\n\n# Verify installation\ndex --help\n```\n\n### Alternative: Run directly from source\n\n```bash\n# With Bun (no build needed, runs TypeScript directly)\ncd /path/to/dex\nbun run src/cli.ts [command] [options]\n```\n\nDEX saves outputs to `.dex/` with descriptive, timestamped filenames. Use `--clipboard`, `--stdout` (where available), or `--output \u003cfile\u003e` to override.\n\n## Performance \u0026 Parallel Processing\n\nDEX supports worker threads for CPU parallelism during `distill`:\n\n```bash\n# Default: sequential worker mode\ndex distill .\n\n# Sequential processing for small projects\ndex distill . --workers 1\n\n# Parallel processing for larger codebases\ndex distill . --workers 4\n```\n\n**Performance Notes:**\n- **Default safety**: Sequential mode avoids worker startup overhead in small runs\n- **Small projects** (\u003c100 files): Keep `--workers 1`\n- **Large projects** (1000+ files): Try `--workers 2` to `--workers 8`\n- **Memory-intensive**: Each worker has independent parser state\n\n## Requirements\n\n- Bun 1.0+\n- Git (for change tracking)\n\n## Tips\n\n- Use `--select` to interactively choose files when you don’t want to depend on Git state.\n- Prefer `--format txt` for agents that parse structure, `--format md` for human review, and `--format json` for programmatic pipelines.\n- `distill` supports `--dry-run` to preview scope and `--exclude` repeatedly for fine control.\n\n## Contributing\n\n- ⭐ Star the repo: https://github.com/scottbaggett/dex\n- 🐛 Issues: https://github.com/scottbaggett/dex/issues\n- 🔧 PRs: https://github.com/scottbaggett/dex/pulls\n\n## License\n\nMIT — see [LICENSE](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottbaggett%2Fdex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottbaggett%2Fdex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottbaggett%2Fdex/lists"}