contextLines
(Optional, default: 0) Number of context lines to show before and after each match. Overridden by beforeLines/afterLines if specified.
How to use it
contextLines is exposed by the Repomix MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the contextLines tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.
Install Repomix
npx repomix@latestOther tools in Repomix (15)
(Optional) Number of context lines to show after each match (like grep -A). Takes precedence over contextLines.
(Optional) Number of context lines to show before each match (like grep -B). Takes precedence over contextLines.
(Optional, default: false) Enable Tree-sitter compression to extract essential code signatures and structure while removing implementation details. Reduces token usage by ~70% while preserving semantic meaning. Generally not needed since greprepomixoutput allows incremental content retrieval. Use on
Absolute path to the directory to pack
(Optional) Ending line number (1-based, inclusive). If not specified, reads to end.
(Optional, default: false) Perform case-insensitive matching
(Optional) Specify additional files to exclude using fast-glob patterns. Multiple patterns can be comma-separated (e.g., "test/,.spec.js", "nodemodules/,dist/"). These patterns supplement .gitignore, .ignore, and built-in exclusions.
(Optional) Specify files to include using fast-glob patterns. Multiple patterns can be comma-separated (e.g., "/.{js,ts}", "src/,docs/"). Only matching files will be processed.
ID of the Repomix output file to read
(Optional) Per-file inclusion levels, mirroring the config-file output.patterns option. An array of { pattern, compress?, directoryStructureOnly? } entries; the first matching pattern wins, directoryStructureOnly takes precedence over compress, and a match with neither flag forces full content (usef
Path to a directory containing repomix-output.xml or direct path to a packed repository XML file
Search pattern (JavaScript RegExp regular expression syntax)
GitHub repository URL or user/repo format (e.g., "yamadashy/repomix", "https://github.com/user/repo", or "https://github.com/user/repo/tree/branch")
(Optional) Starting line number (1-based, inclusive). If not specified, reads from beginning.
(Optional, default: 10) Number of largest files by size to display in the metrics summary for codebase analysis.