Getting started
What codeweb does
codeweb parses a source tree and builds a directed semantic graph. The core chain connects four layers:
- SQL layer: procedures, functions, packages, tables, views, triggers, and other DDL objects parsed from openGauss / GaussDB dialect SQL.
- Mapper layer: MyBatis/iBatis
<select>/<update>/<insert>/<delete>statements from XML mapper files. - Java layer: methods and classes parsed with tree-sitter, plus SQL embedded in annotations and JDBC calls.
- JSP layer (default feature
jsp): SQL embedded in scriptlets, declarations, and expressions.
The result is queryable in both directions: who calls a procedure, what does a Java method touch, and what breaks when a table changes.
Build from source
codeweb is a single Rust crate. Rust’s latest stable toolchain is required.
The binary lands in target/release/codeweb. Which subcommands exist depends on the feature set: serve needs the serve feature, mcp needs the mcp feature. See Architecture for the full feature matrix.
Create a project
codeweb init writes a codeweb.toml and a .codeweb/ state directory, registers the source directories to analyze, and immediately runs the first full analysis:
- Without
--root, the project is created in the current directory and every-dpath is registered for analysis. A-dthat points outside the current directory does not move the project there. --root <dir>creates the project in<dir>instead. A non-empty root without an existingcodeweb.tomlis refused unless you pass--force.
The generated codeweb.toml controls what is analyzed:
Analyze and inspect
Run from the same directory where you ran codeweb init — the project root holding codeweb.toml (or pass -p <dir> from anywhere):
Subsequent codeweb analyze runs only re-parse files whose fingerprint (blake3 hash) changed, so iterations are fast. To force a full re-analysis, delete the .codeweb/fingerprints state.
Trace your first chain
With the repository’s demo sources, run inside the codeweb checkout:
trace prints the callers and callees of the matched node as a tree. trace-sql finds MappedStatement and JavaSql nodes by SQL fragment and walks back to the Java methods that reach them.
Pick an interface
| Surface | Command | Feature | What you get |
|---|---|---|---|
| CLI | codeweb <command> | default | All analysis and export commands |
| TUI | codeweb tui | default | Terminal explorer with search and node detail |
| Browser UI | codeweb serve | serve | Cytoscape.js canvas plus a REST API |
| MCP | codeweb mcp | mcp | 11 JSON-RPC tools for LLM clients |
Next steps
- CLI reference — every command and flag.
- Graph model — node types, edge kinds, and naming rules.
- Trace and query — impact analysis and the JSON query engine.
- HTTP API and MCP tools — automate codeweb.