gram
Command-line tool and Rust library for working with gram notation — a graph data format inspired by the property graph model.
Note: This crate is published as
gram-dataon crates.io but installs a binary namedgram.
Install
CLI usage
Lint gram files
# Lint one or more files
# Lint all .gram files in a directory
# Lint an inline expression
# Read from stdin
|
# Exit non-zero on warnings too
# Machine-readable JSON output
gram checkis a legacy alias forgram lint.
Manage extensions
Extensions are external binaries named gram-<name> installed to ~/.gram/bin/.
# List available and installed extensions
# Install an extension
# Remove an extension
Install agent skills
gram skill installs gram's SKILL.md into AI coding agents (Claude Code, Cursor, Codex, Copilot, Gemini CLI, Kiro). The skill tells the agent how to work with .gram files and surfaces cargo install gram-data as a prerequisite for users who discover the skill first.
# Install to all detected agents in the current project
# Install globally (home-directory paths)
# Install to a specific agent only
# List installed locations
# Remove from all detected locations
Supported agents: claude, cursor, codex, copilot, gemini, kiro
Dispatch to extensions
Any subcommand not built into gram is dispatched to a gram-<name> binary on PATH or in ~/.gram/bin/:
Exit codes
| Code | Meaning |
|---|---|
0 |
No errors (warnings allowed unless --strict) |
1 |
Parse or semantic errors found |
2 |
Tool or I/O error |
Rust library
gram-data also publishes a library target for tools that want to lint .gram files or extract gram snippets from Markdown without shelling out to the binary.
[]
= "0.3"
Diagnostic types are re-exported from gram-diagnostics, which is also used by cypher-data, so multi-language tools receive a single Diagnostic type regardless of which linter ran.
Lint a source string
use ;
let diags = lint_source;
Lint a file
use Path;
use ;
let diags = lint_file?;
Extract and lint gram snippets from Markdown
use ;
use LintOptions;
// Just extract
let snippets = extract_snippets;
// Extract and lint in one pass
let results = lint_markdown;
for in results
Recognised fence tags: ```gram and ~~~gram (case-insensitive).