[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-74676":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":37,"readmeContent":38,"aiSummary":39,"trendingCount":16,"starSnapshotCount":16,"syncStatus":40,"lastSyncTime":41,"discoverSource":42},74676,"sem","Ataraxy-Labs\u002Fsem","Ataraxy-Labs","Semantic version control => entity-level diffs, blame, and impact analysis on top of git. 26 languages via tree-sitter. Built for coding agents.","https:\u002F\u002Fataraxy-labs.github.io\u002Fsem\u002F",null,"Rust",2589,83,3,13,0,465,478,594,1395,27.77,"Apache License 2.0",false,"main",true,[27,28,29,30,31,32,33,34,35,36],"ai-agents","code-intelligence","coding-agents","developer-tools","git","llm-tools","semantic-diff","tree-sitter","typescript","version-control","2026-06-12 02:03:26","> **Part of the [Ataraxy Labs](https:\u002F\u002Fataraxy-labs.com) stack** — agent-native infrastructure for software development. See also: [weave](https:\u002F\u002Fataraxy-labs.com\u002Fweave) (entity-level git merge driver) · [inspect](https:\u002F\u002Fgithub.com\u002FAtaraxy-Labs\u002Finspect) (semantic code review) · [opensessions](https:\u002F\u002Fgithub.com\u002FAtaraxy-Labs\u002Fopensessions) (tmux sidebar for coding agents).\n>\n> Read the manifesto: https:\u002F\u002Fataraxy-labs.com\u002F#thesis · Essays: https:\u002F\u002Fataraxy-labs.com\u002Fblogs · LLMs: https:\u002F\u002Fataraxy-labs.com\u002Fllms.txt\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fbanner.svg\" alt=\"sem\" width=\"600\" \u002F>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cstrong>Semantic version control built on Git.\u003C\u002Fstrong>\u003Cbr>\n  Instead of lines changed, sem tells you what entities changed: functions, methods, classes.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fataraxy-labs.com\u002Fblogs\u002Fcode-is-not-text\">Why sem?\u003C\u002Fa> ·\n  \u003Ca href=\"#install\">Install\u003C\u002Fa> ·\n  \u003Ca href=\"#commands\">Commands\u003C\u002Fa> ·\n  \u003Ca href=\"#mcp-server\">MCP Server\u003C\u002Fa> ·\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FAtaraxy-Labs\u002Fsem\u002Freleases\u002Flatest\">Releases\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FAtaraxy-Labs\u002Fsem\u002Freleases\u002Flatest\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002FAtaraxy-Labs\u002Fsem?color=blue&label=release\" alt=\"Release\">\u003C\u002Fa>\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Frust-stable-orange\" alt=\"Rust\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Ftests-133_passing-brightgreen\" alt=\"Tests\">\n  \u003Ca href=\"LICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-yellow\" alt=\"License\">\u003C\u002Fa>\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flanguages-26-blue\" alt=\"Languages\">\n\u003C\u002Fp>\n\nsem is a semantic version control tool that works on top of Git. It parses your code with tree-sitter, extracts every function, class, and method as an entity, and diffs at the entity level instead of lines. This means you see \"function `blahh` was modified\" instead of \"lines x-y changed.\"\n\nIt works in any Git repo with no setup.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fterminal.svg\" alt=\"sem diff\" width=\"800\" \u002F>\n\u003C\u002Fp>\n\n## Install\n\n```bash\nbrew install sem-cli\n```\n\nOr install the npm wrapper into `node_modules`:\n\n```bash\nnpm install --save-dev @ataraxy-labs\u002Fsem\n```\n\nWith Bun, trust the package so its `postinstall` script can download the binary:\n\n```bash\nbun add -d @ataraxy-labs\u002Fsem\nbun pm trust @ataraxy-labs\u002Fsem\n```\n\nOr build from source (requires Rust):\n\n```bash\ncargo install --git https:\u002F\u002Fgithub.com\u002FAtaraxy-Labs\u002Fsem sem-cli\n```\n\nOr grab a binary from [GitHub Releases](https:\u002F\u002Fgithub.com\u002FAtaraxy-Labs\u002Fsem\u002Freleases).\n\nOr run via Docker:\n\n```bash\ndocker build -t sem .\ndocker run --rm -it -u \"$(id -u):$(id -g)\" -v \"$(pwd):\u002Frepo\" sem diff\n```\n\n## Name conflict with GNU Parallel\n\nGNU Parallel ships a `sem` binary (`\u002Fusr\u002Fbin\u002Fsem`) as a symlink to `parallel`. If you have both installed, they'll collide. Run `sem --version` to check which one you're using. ([#77](https:\u002F\u002Fgithub.com\u002FAtaraxy-Labs\u002Fsem\u002Fissues\u002F77))\n\n**Quick fixes:**\n\n```bash\n# Option 1: alias in your shell profile (~\u002F.bashrc, ~\u002F.zshrc)\nalias sem=\"$HOME\u002F.cargo\u002Fbin\u002Fsem\"\n\n# Option 2: make sure cargo bin comes first in PATH\nexport PATH=\"$HOME\u002F.cargo\u002Fbin:$PATH\"\n\n# Option 3: if installed via Homebrew\nexport PATH=\"$(brew --prefix)\u002Fbin:$PATH\"\n```\n\nIf you installed via npm\u002Fbun, the binary lives in `node_modules\u002F.bin\u002Fsem` and is invoked through `npx sem` or `bunx sem`, which avoids the conflict entirely.\n\n## Commands\n\nWorks in any Git repo. No setup required. Also works outside Git for arbitrary file comparison.\n\n### sem diff\n\nEntity-level diff with rename detection, structural hashing, and word-level inline highlights.\n\n```bash\n# Semantic diff of working changes\nsem diff\n\n# Staged changes only\nsem diff --staged\n\n# Specific commit\nsem diff --commit abc1234\n\n# Commit range\nsem diff --from HEAD~5 --to HEAD\n\n# Verbose mode (word-level inline diffs for each entity)\nsem diff -v\n\n# Plain text output (git status style)\nsem diff --format plain\n\n# JSON output (for AI agents, CI pipelines)\nsem diff --format json\n\n# Markdown output (for PRs, reports)\nsem diff --format markdown\n\n# Compare any two files (no git repo needed)\nsem diff file1.ts file2.ts\n\n# Read file changes from stdin (no git repo needed)\necho '[{\"filePath\":\"src\u002Fmain.rs\",\"status\":\"modified\",\"beforeContent\":\"...\",\"afterContent\":\"...\"}]' \\\n  | sem diff --stdin --format json\n\n# Only specific file types\nsem diff --file-exts .py .rs\n```\n\n### sem impact\n\nCross-file dependency graph shows what breaks if an entity changes.\n\n```bash\n# Full impact analysis\nsem impact authenticateUser\n\n# Direct dependencies only\nsem impact authenticateUser --deps\n\n# Direct dependents only\nsem impact authenticateUser --dependents\n\n# Affected tests only\nsem impact authenticateUser --tests\n\n# JSON output\nsem impact authenticateUser --json\n\n# Disambiguate by file\nsem impact authenticateUser --file src\u002Fauth.ts\n```\n\n### sem blame\n\nEntity-level blame showing who last modified each function, class, or method.\n\n```bash\nsem blame src\u002Fauth.ts\n\n# JSON output\nsem blame src\u002Fauth.ts --json\n```\n\n### sem log\n\nTrack how a single entity evolved through git history.\n\n```bash\nsem log authenticateUser\n\n# Verbose mode (show content diff between versions)\nsem log authenticateUser -v\n\n# Limit commits scanned\nsem log authenticateUser --limit 20\n\n# JSON output\nsem log authenticateUser --json\n```\n\n### sem entities\n\nList all entities under a file or directory path. No path is the same as `.`.\n\n```bash\nsem entities\n\nsem entities .\n\nsem entities src\u002Fauth.ts\n\n# JSON output\nsem entities --json\nsem entities src\u002Fauth.ts --json\n```\n\n### sem context\n\nToken-budgeted context for LLMs: the entity, its dependencies, and its dependents, fitted to a token budget.\n\n```bash\nsem context authenticateUser\n\n# Custom token budget\nsem context authenticateUser --budget 4000\n\n# JSON output\nsem context authenticateUser --json\n```\n\n## Use as default Git diff\n\nReplace `git diff` output with entity-level diffs. Agents and humans get sem output automatically without changing any commands.\n\n```bash\nsem setup\n```\n\nNow `git diff` shows entity-level changes instead of line-level. No prompts, no agent configuration needed. Everything that calls `git diff` gets sem output automatically. Also installs a pre-commit hook that shows entity-level blast radius of staged changes.\n\nTo disable and go back to normal git diff:\n\n```bash\nsem unsetup\n```\n\n## What it parses\n\n26 programming languages with full entity extraction via tree-sitter:\n\n| Language | Extensions | Entities |\n|----------|-----------|----------|\n| TypeScript | `.ts` `.tsx` `.mts` `.cts`  | functions, classes, interfaces, types, enums, exports |\n| JavaScript | `.js` `.jsx` `.mjs` `.cjs` | functions, classes, variables, exports |\n| Python | `.py` | functions, classes, decorated definitions |\n| Go | `.go` | functions, methods, types, vars, consts |\n| Rust | `.rs` | functions, structs, enums, impls, traits, mods, consts |\n| Java | `.java` | classes, methods, interfaces, enums, fields, constructors |\n| C | `.c` `.h` | functions, structs, enums, unions, typedefs |\n| C++ | `.cpp` `.cc` `.hpp` | functions, classes, structs, enums, namespaces, templates |\n| C# | `.cs` | classes, methods, interfaces, enums, structs, properties |\n| Ruby | `.rb` | methods, classes, modules |\n| PHP | `.php` | functions, classes, methods, interfaces, traits, enums |\n| Swift | `.swift` | functions, classes, protocols, structs, enums, properties |\n| Elixir | `.ex` `.exs` | modules, functions, macros, guards, protocols |\n| Bash | `.sh` | functions |\n| HCL\u002FTerraform | `.hcl` `.tf` `.tfvars` | blocks, attributes (qualified names for nested blocks) |\n| Kotlin | `.kt` `.kts` | classes, interfaces, objects, functions, properties, companion objects |\n| Fortran | `.f90` `.f95` `.f` | functions, subroutines, modules, programs |\n| Vue | `.vue` | template\u002Fscript\u002Fstyle blocks + inner TS\u002FJS entities |\n| XML | `.xml` `.plist` `.svg` `.csproj` | elements (nested, tag-name identity) |\n| ERB | `.erb` `.html.erb` | blocks, expressions, code tags |\n| Svelte | `.svelte` `.svelte.js` `.svelte.ts` | component blocks + rune JS\u002FTS modules |\n| Perl | `.pl` `.pm` `.t` | subroutines, packages |\n| Dart | `.dart` | classes, mixins, extensions, enums, type aliases, functions |\n| OCaml | `.ml` `.mli` | values, modules, types, classes, externals |\n| Scala | `.scala` `.sc` `.sbt` | classes, objects, traits, enums, functions, vals, extensions |\n| Zig | `.zig` | functions, tests, variables |\n\nPlus structured data formats:\n\n| Format | Extensions | Entities |\n|--------|-----------|----------|\n| JSON | `.json` | properties, objects (RFC 6901 paths) |\n| YAML | `.yml` `.yaml` | sections, properties (dot paths) |\n| TOML | `.toml` | sections, properties |\n| CSV | `.csv` `.tsv` | rows (first column as identity) |\n| Markdown | `.md` `.mdx` | heading-based sections |\n\nEverything else falls back to chunk-based diffing.\n\n### Custom extensions and extensionless files\n\nFor files with non-standard extensions, create a `.semrc` in your project root:\n\n```\n.xyz = cpp\n.j = json\n.mypy = python\n```\n\nsem also reads `.gitattributes` patterns (`diff=` and `linguist-language=`) if you already have those set up. `.semrc` takes priority when both define the same extension.\n\nFor files with no extension at all, sem detects the language automatically from content (imports, declarations, shebang lines, vim modelines). This covers 19 languages with no config needed.\n\n## How matching works\n\nThree-phase entity matching:\n\n1. **Exact ID match** — same entity in before\u002Fafter = modified or unchanged\n2. **Structural hash match** — same AST structure, different name = renamed or moved (ignores whitespace\u002Fcomments)\n3. **Fuzzy similarity** — >80% token overlap = probable rename\n\nThis means sem detects renames and moves, not just additions and deletions. Structural hashing also distinguishes cosmetic changes (whitespace, formatting) from real logic changes.\n\n## MCP Server\n\nsem includes an MCP server with 6 tools for AI agents: `sem_entities`, `sem_diff`, `sem_blame`, `sem_impact`, `sem_log`, `sem_context`. These mirror the CLI commands exactly.\n\n```json\n{\n  \"mcpServers\": {\n    \"sem\": {\n      \"command\": \"sem-mcp\"\n    }\n  }\n}\n```\n\nInstall the MCP binary:\n\n```bash\ncd sem\u002Fcrates\ncargo install --path sem-mcp\n```\n\n## JSON output\n\n```bash\nsem diff --format json\n```\n\n```json\n{\n  \"summary\": {\n    \"fileCount\": 2,\n    \"added\": 1,\n    \"modified\": 1,\n    \"deleted\": 1,\n    \"total\": 3\n  },\n  \"changes\": [\n    {\n      \"entityId\": \"src\u002Fauth.ts::function::validateToken\",\n      \"changeType\": \"added\",\n      \"entityType\": \"function\",\n      \"entityName\": \"validateToken\",\n      \"filePath\": \"src\u002Fauth.ts\"\n    }\n  ]\n}\n```\n\n## As a library\n\nsem-core can be used as a Rust library dependency:\n\n```toml\n[dependencies]\nsem-core = { git = \"https:\u002F\u002Fgithub.com\u002FAtaraxy-Labs\u002Fsem\", version = \"0.5\" }\n```\n\nUsed by [weave](https:\u002F\u002Fgithub.com\u002FAtaraxy-Labs\u002Fweave) (semantic merge driver) and [inspect](https:\u002F\u002Fgithub.com\u002FAtaraxy-Labs\u002Finspect) (entity-level code review).\n\n## Architecture\n\n- **tree-sitter** for code parsing (native Rust, not WASM)\n- **git2** for Git operations\n- **rayon** for parallel file processing\n- **xxhash** for structural hashing\n- Plugin system for adding new languages and formats\n\n## Contributing\n\nWant to add a new language? See [CONTRIBUTING.md](CONTRIBUTING.md) for a step-by-step guide.\n\n## Star History\n\n[![Star History Chart](https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=Ataraxy-Labs\u002Fsem&type=Date)](https:\u002F\u002Fstar-history.com\u002F#Ataraxy-Labs\u002Fsem&Date)\n\n## License\n\nMIT OR Apache-2.0\n","sem 是一个基于 Git 的语义版本控制工具，它通过 tree-sitter 解析代码，将函数、类和方法等实体提取出来，并在这些实体级别上进行差异比较，而不是传统的行级比较。其核心功能包括实体级别的差异显示、责任追踪以及影响分析。项目采用 Rust 语言编写，支持 26 种编程语言，适用于需要更细粒度代码变更跟踪的场景，特别是对于编码代理（coding agents）和开发者工具领域。sem 可以无缝集成到任何现有的 Git 仓库中而无需额外配置。",2,"2026-06-11 03:50:23","high_star"]