{"id":20609533,"url":"https://github.com/colthreepv/llm-context","last_synced_at":"2026-02-16T17:30:53.918Z","repository":{"id":261263050,"uuid":"883771125","full_name":"colthreepv/llm-context","owner":"colthreepv","description":"A CLI tool that helps you generate context files for Large Language Models (LLMs).","archived":false,"fork":false,"pushed_at":"2025-01-08T02:23:47.000Z","size":158,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-19T17:42:05.934Z","etag":null,"topics":["ai","cli","context-builder","language-models","llm","nlp","prompt-engineering"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/llm-context","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/colthreepv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-05T14:44:43.000Z","updated_at":"2025-08-18T13:42:52.000Z","dependencies_parsed_at":"2024-12-23T13:29:00.245Z","dependency_job_id":"05bea61d-ffe4-4bdd-aa82-4ed62502871b","html_url":"https://github.com/colthreepv/llm-context","commit_stats":null,"previous_names":["colthreepv/llm-context"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/colthreepv/llm-context","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colthreepv%2Fllm-context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colthreepv%2Fllm-context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colthreepv%2Fllm-context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colthreepv%2Fllm-context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colthreepv","download_url":"https://codeload.github.com/colthreepv/llm-context/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colthreepv%2Fllm-context/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276064355,"owners_count":25578999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"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":["ai","cli","context-builder","language-models","llm","nlp","prompt-engineering"],"created_at":"2024-11-16T10:13:50.753Z","updated_at":"2025-09-26T11:30:52.724Z","avatar_url":"https://github.com/colthreepv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# llm-context\n\nA CLI tool that builds context files from your project for Large Language Models (LLMs). It traverses directories, collecting file structures and contents into a single `.txt` file optimized for LLM context.\n\n## Installation\n\n```bash\nnpm install -g llm-context\n```\n\nFor development:\n```bash\ngit clone https://github.com/colthreepv/llm-context\ncd llm-context\npnpm install\n# Build and link globally so you can invoke 'llm-context' anywhere\npnpm build\npnpm link --global\n```\n\n## Usage\n\nBasic syntax:\n```bash\nllm-context \u003cdirectory\u003e \u003csuffix\u003e [options]\n```\n\nExample:\n```bash\nllm-context ./ context\n```\nThis creates `llm-context.context.txt` containing:\n- A `\u003ctree\u003e` block showing your file structure with token counts\n- `\u003cfile\u003e` blocks containing each file's contents\n\n### File Ignoring System\n\nUse `-i` or `--ignore` to exclude files/directories:\n```bash\nllm-context ./src output -i \"*.test.ts\" -i cache -i docs -i web/src\n```\n\nThe ignore system uses a \"greedy\" pattern matching approach:\n- Patterns are converted to regular expressions\n- `*` matches any sequence of characters\n- `?` matches any single character\n- Matches are case-sensitive\n- A match anywhere in the path excludes the file/directory\n\nExamples:\n- `*.log` → matches `error.log`, `debug.log`\n- `test/*` → matches anything in the `test` directory\n- `.env.*` → matches `.env.local`, `.env.production`\n- `web/src` → matches `web/src/**/*`, but not something like `app/src/**/*`\n\nDefault ignored paths include:\n- VCS: `.git`, `.gitignore`\n- Dependencies: `node_modules`, `*lock.json`, `*.yaml`\n- Build outputs: `dist`, `build`, `.next`\n- Configs: `.env*`, `.vscode`, `.idea`\n- System files: `.DS_Store`, `Thumbs.db`\n- Temporary: `coverage`, `tmp`, `.cache`\n\n### Output Structure\n\nThe generated file contains:\n1. A `\u003ctree\u003e` block with directory structure and token counts:\n```\n\u003ctree\u003e\nproject (1234)\n  ├── src (789)\n  │   ├── index.ts (234)\n  │   └── utils.ts (555)\n  └── package.json (45)\n\u003c/tree\u003e\n```\n\n2. File contents in `\u003cfile\u003e` blocks:\n```\n\u003cfile name=\"src/index.ts\"\u003e\n// File contents here\n\u003c/file\u003e\n```\n\n### Token Estimation\n\nThe tool estimates tokens using a character-to-token ratio of ~3.62 characters per token. This is an approximation to help you stay within LLM context limits.\n\nLarge JSON files are automatically truncated to maintain reasonable context sizes:\n- Objects: Limited to first 4 key-value pairs\n- Arrays: Limited to first 2 items\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolthreepv%2Fllm-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolthreepv%2Fllm-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolthreepv%2Fllm-context/lists"}