https://github.com/blackwell-systems/tree-sitter-gcf
Tree-sitter grammar for GCF. Full spec compliance, WASM build for browser playground.
https://github.com/blackwell-systems/tree-sitter-gcf
ai-agents code-highlighting developer-tools editor gcf grammar graph-compact-format helix json-alternative llm mcp neovim parser structured-data syntax-highlighting text-editor token-efficiency tree-sitter wire-format zed
Last synced: about 4 hours ago
JSON representation
Tree-sitter grammar for GCF. Full spec compliance, WASM build for browser playground.
- Host: GitHub
- URL: https://github.com/blackwell-systems/tree-sitter-gcf
- Owner: blackwell-systems
- License: mit
- Created: 2026-06-07T05:23:21.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-06-23T05:06:52.000Z (15 days ago)
- Last Synced: 2026-06-23T07:07:40.070Z (15 days ago)
- Topics: ai-agents, code-highlighting, developer-tools, editor, gcf, grammar, graph-compact-format, helix, json-alternative, llm, mcp, neovim, parser, structured-data, syntax-highlighting, text-editor, token-efficiency, tree-sitter, wire-format, zed
- Language: C
- Homepage: https://www.gcformat.com/
- Size: 232 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tree-sitter-gcf
Tree-sitter grammar for [GCF](https://gcformat.com/), the token-optimized wire format for LLMs.
Enables syntax highlighting in Neovim, Helix, Zed, Emacs, and any editor that supports tree-sitter.

## Supported syntax
- Header lines (`GCF tool=... symbols=... edges=...`)
- Section headers (`## targets`, `## edges [N]`, `## name [N]{fields}`)
- Symbol lines (`@0 fn pkg.Auth 0.78 lsp_resolved`)
- Edge lines (`@0<@1 calls`)
- Bare references (`@0 # previously transmitted`)
- Key-value pairs (`key=value`)
- Inline arrays (`tags[3]: read,write,admin`)
- Tabular rows (`Alice|Engineering|95000`)
- Nested fields (`.customer`)
- Summary trailers (`## _summary symbols=3 edges=2`)
- Comments (`# text`)
## Neovim
Add to your tree-sitter config:
```lua
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.gcf = {
install_info = {
url = "https://github.com/blackwell-systems/tree-sitter-gcf",
files = { "src/parser.c" },
branch = "main",
},
filetype = "gcf",
}
```
Then `:TSInstall gcf`.
Copy `queries/highlights.scm` to `~/.config/nvim/queries/gcf/highlights.scm`.
## Helix
Add to `languages.toml`:
```toml
[[language]]
name = "gcf"
scope = "source.gcf"
file-types = ["gcf"]
roots = []
[language.auto-pairs]
[[grammar]]
name = "gcf"
source = { git = "https://github.com/blackwell-systems/tree-sitter-gcf", rev = "main" }
```
Then `hx --grammar fetch && hx --grammar build`.
## Development
```bash
npm install
tree-sitter generate
tree-sitter parse test.gcf
tree-sitter highlight test.gcf
```
## License
MIT - [Dayna Blackwell](https://github.com/blackwell-systems)