{"_id":"@adamwett/ctxr","_rev":"4-1bd7e9290dc90852833fafbfd9136d45","name":"@adamwett/ctxr","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@adamwett/ctxr","version":"0.0.1","keywords":["cli","llm","context","markdown","ai"],"author":{"url":"https://wett.dev","name":"Adam Wettreich","email":"adam@wett.dev"},"license":"MIT","_id":"@adamwett/ctxr@0.0.1","maintainers":[{"name":"adamwett","email":"adamwettreich@protonmail.com"}],"bin":{"ctxr":"dist/index.js"},"dist":{"shasum":"ce3e4ae485296dcd6768b11bcd733c5dd7586ad9","tarball":"https://registry.npmjs.org/@adamwett/ctxr/-/ctxr-0.0.1.tgz","fileCount":8,"integrity":"sha512-1+Ok0tZfFBDIvUBSVKY6JKKzGSypo5XxFTmytSFrRSne9VW414tErJYifXBwbe0KqIBE7eLrzhqvB2xI/T0CSw==","signatures":[{"sig":"MEYCIQDiO5MXJ4ruxmLikLrO6ZS7RPh0pciZukme6EFhd45oNgIhAIkQYiMvDn7cyCeN5KGUUdi7CKHtK1XPUjG1LHAth8Ho","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4378},"type":"module","_from":"file:adamwett-ctxr-0.0.1.tgz","exports":{".":"./dist/ctxr.js"},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"adamwett","email":"adamwettreich@protonmail.com"},"_resolved":"/private/var/folders/sw/px292kxj5s55nxf_1h0n7mp80000gn/T/590aeef3356af4318ca014e5176bc72c/adamwett-ctxr-0.0.1.tgz","_integrity":"sha512-1+Ok0tZfFBDIvUBSVKY6JKKzGSypo5XxFTmytSFrRSne9VW414tErJYifXBwbe0KqIBE7eLrzhqvB2xI/T0CSw==","_npmVersion":"11.11.0","description":"Bundle a markdown file and its linked dependencies into LLM context","directories":{},"_nodeVersion":"25.8.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","@vitest/ui":"4.0.18","typescript":"5.9.3","@types/node":"^25.2.3","@workspace/typescript-config":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ctxr_0.0.1_1772928937664_0.46455871431047635","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@adamwett/ctxr","version":"0.0.2","keywords":["cli","llm","context","markdown","ai"],"author":{"url":"https://wett.dev","name":"Adam Wettreich","email":"adam@wett.dev"},"license":"MIT","_id":"@adamwett/ctxr@0.0.2","maintainers":[{"name":"adamwett","email":"adamwettreich@protonmail.com"}],"bin":{"ctxr":"dist/index.js"},"dist":{"shasum":"46236929aec33b9860719aff07a7925f071447e8","tarball":"https://registry.npmjs.org/@adamwett/ctxr/-/ctxr-0.0.2.tgz","fileCount":9,"integrity":"sha512-AI/dPRPPPhszVSE/J0+iEg01Fy5t9EejJ5F8o6ATiDmZ8GNLiNoWD6W6rldVcWvIMsLVxWYnrxf1X5vC8YNKGw==","signatures":[{"sig":"MEQCIF7PmlnzCRQyDNpkOwamD61NgLbtOeC6Zpalg1blcdxzAiAOEzY9gJLaMofqzLMRQPNhdkBshc5QdPAxYZIUsCt37A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7223},"type":"module","_from":"file:adamwett-ctxr-0.0.2.tgz","exports":{".":"./dist/ctxr.js"},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"adamwett","email":"adamwettreich@protonmail.com"},"_resolved":"/private/var/folders/sw/px292kxj5s55nxf_1h0n7mp80000gn/T/5b2a92442c09da5dc0ae352dc175ba7d/adamwett-ctxr-0.0.2.tgz","_integrity":"sha512-AI/dPRPPPhszVSE/J0+iEg01Fy5t9EejJ5F8o6ATiDmZ8GNLiNoWD6W6rldVcWvIMsLVxWYnrxf1X5vC8YNKGw==","_npmVersion":"11.11.0","description":"Bundle a markdown file and its linked dependencies into LLM context","directories":{},"_nodeVersion":"25.8.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","@vitest/ui":"4.0.18","typescript":"5.9.3","@types/node":"^25.2.3","@workspace/typescript-config":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ctxr_0.0.2_1772929045404_0.9605751381351892","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@adamwett/ctxr","version":"0.0.3","keywords":["cli","llm","context","markdown","ai"],"author":{"url":"https://wett.dev","name":"Adam Wettreich","email":"adam@wett.dev"},"license":"MIT","_id":"@adamwett/ctxr@0.0.3","maintainers":[{"name":"adamwett","email":"adamwettreich@protonmail.com"}],"bin":{"ctxr":"dist/index.js"},"dist":{"shasum":"55b0c84218edf74bf7660863ce68a73412c5bbc0","tarball":"https://registry.npmjs.org/@adamwett/ctxr/-/ctxr-0.0.3.tgz","fileCount":9,"integrity":"sha512-0lknmsQJcmz3ViBZzL7D1glHywnOdURvAxMcCJdD7TwIDxhh3hK3pezJKCw3GCxzyOa8sBBYfsOWaB08UA3xTQ==","signatures":[{"sig":"MEQCIAx2PA9dqcLK9un8g+Gj9E7tAJQtYGUp1Tm/gQgnf0V0AiAOqVnQZs6D/BKlNXdBIB9W78QdbDNfdFxRKqRLosQWXQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8941},"type":"module","_from":"file:adamwett-ctxr-0.0.3.tgz","exports":{".":"./dist/ctxr.js"},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"adamwett","email":"adamwettreich@protonmail.com"},"_resolved":"/private/var/folders/sw/px292kxj5s55nxf_1h0n7mp80000gn/T/6f1e1b622110423342156ecd09b64328/adamwett-ctxr-0.0.3.tgz","_integrity":"sha512-0lknmsQJcmz3ViBZzL7D1glHywnOdURvAxMcCJdD7TwIDxhh3hK3pezJKCw3GCxzyOa8sBBYfsOWaB08UA3xTQ==","_npmVersion":"11.11.0","description":"Bundle a markdown file and its linked dependencies into LLM context","directories":{},"_nodeVersion":"25.8.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","@vitest/ui":"4.0.18","typescript":"5.9.3","@types/node":"^25.2.3","@workspace/typescript-config":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ctxr_0.0.3_1772929556921_0.3485807460723158","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@adamwett/ctxr","author":{"name":"Adam Wettreich","email":"adam@wett.dev","url":"https://wett.dev"},"repository":{"type":"git","url":"git+https://gitlab.com/adamwett/ctxr.git"},"version":"0.0.4","description":"Bundle a markdown file and its linked dependencies into LLM context","type":"module","bin":{"ctxr":"dist/index.js"},"exports":{".":"./dist/ctxr.js"},"keywords":["cli","llm","context","markdown","ai"],"license":"MIT","publishConfig":{"access":"public"},"devDependencies":{"@types/node":"^25.2.3","@vitest/ui":"4.0.18","typescript":"5.9.3","vitest":"^4.0.18","@workspace/typescript-config":"0.0.0"},"scripts":{"build":"tsc","dev":"tsc --watch","test":"vitest run","typecheck":"tsc --noEmit"},"_id":"@adamwett/ctxr@0.0.4","bugs":{"url":"https://gitlab.com/adamwett/ctxr/issues"},"homepage":"https://gitlab.com/adamwett/ctxr#readme","_integrity":"sha512-AjrIf9PGBy26jrnhGmGVToasdKmlbbN9qfRM6/a7hoGedji+qeNAhvctKEMwKLSPwLGhe806ivxY6mOsi6lOJg==","_resolved":"/private/var/folders/sw/px292kxj5s55nxf_1h0n7mp80000gn/T/17bc7b95bfc3c6e21ae47d6c1730effc/adamwett-ctxr-0.0.4.tgz","_from":"file:adamwett-ctxr-0.0.4.tgz","_nodeVersion":"25.8.0","_npmVersion":"11.11.0","dist":{"integrity":"sha512-AjrIf9PGBy26jrnhGmGVToasdKmlbbN9qfRM6/a7hoGedji+qeNAhvctKEMwKLSPwLGhe806ivxY6mOsi6lOJg==","shasum":"da18c4b4122dae90f05f5ce02bbc686ec624c37d","tarball":"https://registry.npmjs.org/@adamwett/ctxr/-/ctxr-0.0.4.tgz","fileCount":9,"unpackedSize":9114,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD3k4YU1dIYWBNBK1LdqaTUTa/6LSAu4/+Hgmdi9uq1EAIhAMr+sKpRIsBSF5c9zA8yPK+3gTf1IKhVpwRAxM//A/GL"}]},"_npmUser":{"name":"adamwett","email":"adamwettreich@protonmail.com"},"directories":{},"maintainers":[{"name":"adamwett","email":"adamwettreich@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ctxr_0.0.4_1772930164883_0.8459178848491011"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-08T00:15:37.562Z","modified":"2026-03-08T00:36:05.152Z","0.0.1":"2026-03-08T00:15:37.809Z","0.0.2":"2026-03-08T00:17:25.559Z","0.0.3":"2026-03-08T00:25:57.085Z","0.0.4":"2026-03-08T00:36:05.039Z"},"author":{"name":"Adam Wettreich","email":"adam@wett.dev","url":"https://wett.dev"},"license":"MIT","keywords":["cli","llm","context","markdown","ai"],"description":"Bundle a markdown file and its linked dependencies into LLM context","maintainers":[{"name":"adamwett","email":"adamwettreich@protonmail.com"}],"readme":"# ctxr\n\n`ctxr` is a CLI tool that bundles a markdown file and its linked dependencies into a single, tagged output suitable for feeding as context to an LLM.\n\n## Usage\n\n```\nctxr [--circular] <file>\n```\n\nReads `<file>`, resolves any `ctxr` link comments, and prints the result to stdout.\n\n```bash\nctxr index.md\nctxr docs/context.md | pbcopy\nctxr README.md > context.txt\n```\n\n## Link syntax\n\nInside any markdown file, use an HTML comment to declare a link to another file:\n\n```\n<!-- ctxr: ./path/to/file.md -->\n```\n\n- The path is relative to the file containing the comment\n- The comment is replaced in the output by the linked file's content, wrapped in XML-style tags\n- Links are resolved recursively (linked files may themselves contain `<!-- ctxr: ... -->` comments)\n\n## Output format\n\nEvery file's content is wrapped in XML-style tags using the file's basename:\n\n```\n<filename.md>\n...content...\n</filename.md>\n```\n\nThe entry file wraps the entire output. Linked files are inlined at the position of their `<!-- ctxr: ... -->` comment, each wrapped in their own tags.\n\n**Duplicate basenames:** if two linked files share the same basename (e.g. `a/index.md` and `b/index.md`), the tag uses the link path as written in the comment with the leading `./` stripped:\n\n```\n<!-- ctxr: ./a/index.md -->  →  <a/index.md>...</a/index.md>\n<!-- ctxr: ./b/index.md -->  →  <b/index.md>...</b/index.md>\n```\n\nTag names are determined after all links are resolved, so a basename is only promoted to its full path if it appears more than once across the entire output.\n\n## Examples\n\n### No links\n\nInput (`input.md`):\n```markdown\n## A markdown file\n\nJust a basic markdown file nothing fancy\n```\n\nOutput:\n```\n<input.md>\n## A markdown file\n\nJust a basic markdown file nothing fancy\n</input.md>\n```\n\n---\n\n### One link\n\nInput (`input.md`):\n```markdown\n## A markdown file with a link\n\nThis markdown file contains a link to another markdown file\n\n<!-- ctxr: ./link.md -->\n\nThere is also some content below the link\n```\n\n`link.md`:\n```markdown\n## Linked markdown file\n\nThis file is linked to by the input for this test\n\n> It has a blockquote!\n```\n\nOutput:\n```\n<input.md>\n## A markdown file with a link\n\nThis markdown file contains a link to another markdown file\n\n<link.md>\n## Linked markdown file\n\nThis file is linked to by the input for this test\n\n> It has a blockquote!\n</link.md>\n\nThere is also some content below the link\n</input.md>\n```\n\n## Flags\n\n### `--circular`\n\nBy default, circular links are an error. With `--circular`, a file that has already been visited in the current resolution chain is not expanded again. Instead, the link is replaced with a placeholder tag:\n\n```\n<a.md>circular link to b.md</a.md>\n```\n\nWhere `a.md` is the file that contains the circular `<!-- ctxr: ... -->` comment, and `b.md` is the file that was already visited. A warning is also printed to stderr:\n\n```\n⚠️ Circular link from a.md to b.md\n```\n\n## Error cases\n\n- **File not found:** if the entry file does not exist, exit with a non-zero code and print an error to stderr\n- **Unresolvable link:** if a `<!-- ctxr: ... -->` path cannot be resolved, exit with a non-zero code and print the offending path to stderr\n- **Circular links:** if a file transitively links back to itself, exit with a non-zero code indicating a cycle (unless `--circular` is passed)\n","readmeFilename":"README.md","homepage":"https://gitlab.com/adamwett/ctxr#readme","repository":{"type":"git","url":"git+https://gitlab.com/adamwett/ctxr.git"},"bugs":{"url":"https://gitlab.com/adamwett/ctxr/issues"}}