Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 60 variants Extract { path: PathBuf, format: Option<String>, }, Build { path: PathBuf, output: Option<PathBuf>, format: Option<Vec<String>>, no_llm: bool, llm: bool, code_only: bool, update: bool, force: bool, jobs: Option<usize>, }, Cluster { path: PathBuf, }, Analyze { path: PathBuf, }, Export { path: PathBuf, json: bool, html: bool, graphml: bool, obsidian: bool, }, Query { query: String, graph: Option<PathBuf>, model_path: Option<PathBuf>, mode: String, depth: usize, }, Path { source: String, target: String, path: Option<PathBuf>, }, Stats { path: PathBuf, }, Validate { path: PathBuf, }, Merge { a: PathBuf, b: PathBuf, }, MergeDriver { base: PathBuf, current: PathBuf, other: PathBuf, }, Mcp { global_dir: Option<PathBuf>, }, Serve { graph: Option<PathBuf>, path: Option<PathBuf>, port: u16, }, Diff { path: PathBuf, baseline: PathBuf, }, Explain { id: String, path: Option<PathBuf>, }, Affected { id: String, path: Option<PathBuf>, graph: Option<PathBuf>, depth: usize, relations: Vec<String>, }, Tree { path: PathBuf, root: Option<String>, max_depth: usize, }, Benchmark { path: PathBuf, runs: usize, }, Risk { path: PathBuf, dry_run: bool, }, Update { path: PathBuf, force: bool, }, Watch { path: Option<PathBuf>, output: Option<PathBuf>, }, Ingest { url: String, output: Option<PathBuf>, }, Hook { action: HookAction, }, Init { path: Option<PathBuf>, force: bool, }, Completions { shell: String, }, SaveResult { output: Option<PathBuf>, }, Install { platform: String, }, Claude { action: PlatformAction, }, Opencode { action: PlatformAction, }, Codex { action: PlatformAction, }, Codebuddy { action: PlatformAction, }, Claw { action: PlatformAction, }, Droid { action: PlatformAction, }, Cursor { action: PlatformAction, }, Vscode { action: PlatformAction, }, Aider { action: PlatformAction, }, Copilot { action: PlatformAction, }, Trae { action: PlatformAction, }, TraeCn { action: PlatformAction, }, Antigravity { action: PlatformAction, }, Hermes { action: PlatformAction, }, Kiro { action: PlatformAction, }, Pi { action: PlatformAction, }, Devin { action: PlatformAction, }, Global { action: GlobalAction, }, Diagnose { graph: PathBuf, json: bool, max_examples: usize, directed: bool, undirected: bool, }, CallflowHtml { graph_path: Option<PathBuf>, graph: Option<PathBuf>, output: Option<PathBuf>, project: Option<PathBuf>, max_sections: usize, diagram_scale: f64, max_diagram_nodes: usize, max_diagram_edges: usize, }, TreeHtml { graph: Option<PathBuf>, output: Option<PathBuf>, root: Option<String>, max_children: usize, label: Option<String>, }, Clone { url: String, branch: Option<String>, out: Option<PathBuf>, }, Prs { base: Option<String>, repo: Option<String>, limit: usize, graph: Option<PathBuf>, }, Version, HookCheck, CheckUpdate { path: PathBuf, }, CacheCheck { files_from: PathBuf, root: PathBuf, }, MergeChunks { files: Vec<PathBuf>, out: PathBuf, }, MergeSemantic { cached: Option<PathBuf>, new: Option<PathBuf>, out: PathBuf, }, Setup { client: Option<String>, workspace: Option<PathBuf>, }, Resolve { query: String, limit: usize, }, Module { action: ModuleAction, }, Telemetry { action: TelemetryAction, },
}

Variants§

§

Extract

Extract code structure from source files

Fields

§path: PathBuf
§format: Option<String>
§

Build

Build graph from extraction fragments

Fields

§path: PathBuf
§output: Option<PathBuf>
§format: Option<Vec<String>>
§no_llm: bool
§llm: bool

Enable LLM extraction for doc/paper files (provider from codesynapse.toml or env)

§code_only: bool
§update: bool
§force: bool
§

Cluster

Run community detection

Fields

§path: PathBuf
§

Analyze

Analyze the graph

Fields

§path: PathBuf
§

Export

Export graph in various formats

Fields

§path: PathBuf
§json: bool
§html: bool
§graphml: bool
§obsidian: bool
§

Query

Query the graph (BM25 + optional dense search via RRF)

Fields

§query: String
§graph: Option<PathBuf>

Path to graph.json exported by the build command.

§model_path: Option<PathBuf>

Path to model directory with tokenizer.json + model.safetensors.

§mode: String

Traversal mode: bfs or dfs.

§depth: usize

Traversal depth.

§

Path

Find shortest path between two nodes

Fields

§source: String
§target: String
§

Stats

Show graph statistics

Fields

§path: PathBuf
§

Validate

Validate extraction JSON

Fields

§path: PathBuf
§

Merge

Merge two graph JSON files

Fields

§

MergeDriver

Git merge driver for graph JSON files (union merge)

Fields

§base: PathBuf

Base version (ignored — present for git merge driver %O %A %B compatibility)

§current: PathBuf

Current version (written back with merged result)

§other: PathBuf

Other version to merge in

§

Mcp

Start MCP server (stdio transport for AI clients)

Fields

§global_dir: Option<PathBuf>

Override global registry directory (default: ~/.codesynapse)

§

Serve

Start gRPC server

Fields

§port: u16

TCP port for gRPC listener (default: 50051)

§

Diff

Diff two graphs for structural equivalence

Fields

§path: PathBuf
§baseline: PathBuf
§

Explain

Explain a node — show its details and relationships

Fields

§

Affected

Find nodes affected by changes to a given node

Fields

§graph: Option<PathBuf>

Load graph from JSON file instead of sled store

§depth: usize
§relations: Vec<String>

Filter to specific relation types (can be repeated)

§

Tree

Print an ASCII tree of the graph structure

Fields

§path: PathBuf
§max_depth: usize
§

Benchmark

Benchmark the extraction pipeline

Fields

§path: PathBuf
§runs: usize
§

Risk

Perform temporal risk analysis on the graph

Fields

§path: PathBuf
§dry_run: bool
§

Update

Incrementally update the graph from changed sources

Fields

§path: PathBuf
§force: bool
§

Watch

Watch a directory for changes and rebuild automatically

Fields

§output: Option<PathBuf>
§

Ingest

Ingest content from a URL (web page, GitHub, paper, etc.)

Fields

§output: Option<PathBuf>
§

Hook

Manage git hooks for automatic graph building

Fields

§action: HookAction
§

Init

Initialize a new codesynapse.toml config in the current directory

Fields

§force: bool
§

Completions

Generate shell completions

Fields

§shell: String
§

SaveResult

Save the last query or analysis result to a file

Fields

§output: Option<PathBuf>
§

Install

Install codesynapse for a specific platform (cursor, claude, etc.)

Fields

§platform: String
§

Claude

Manage Claude Desktop integration

Fields

§

Opencode

Manage OpenCode integration

Fields

§

Codex

Manage Codex integration

Fields

§

Codebuddy

Manage CodeBuddy integration

Fields

§

Claw

Manage Claw integration

Fields

§

Droid

Manage Droid integration

Fields

§

Cursor

Manage Cursor integration

Fields

§

Vscode

Manage VS Code integration

Fields

§

Aider

Manage Aider integration

Fields

§

Copilot

Manage GitHub Copilot integration

Fields

§

Trae

Manage Trae integration

Fields

§

TraeCn

Manage Trae CN integration

Fields

§

Antigravity

Manage Antigravity integration

Fields

§

Hermes

Manage Hermes integration

Fields

§

Kiro

Manage Kiro integration

Fields

§

Pi

Manage Pi integration

Fields

§

Devin

Manage Devin integration

Fields

§

Global

Manage the cross-repo global graph (~/.codesynapse/)

Fields

§

Diagnose

Diagnose multigraph edge-collapse issues in a graph JSON file

Fields

§graph: PathBuf

Path to graph.json to diagnose

§json: bool

Output JSON instead of human-readable report

§max_examples: usize

Max examples per edge group (default: 3)

§directed: bool

Force directed graph interpretation

§undirected: bool

Force undirected graph interpretation

§

CallflowHtml

Generate Mermaid call-flow architecture HTML from a graph.json

Fields

§graph_path: Option<PathBuf>

Optional path to graph.json (positional)

§graph: Option<PathBuf>

Path to graph.json (long flag, overrides positional)

§output: Option<PathBuf>

Output HTML file path

§project: Option<PathBuf>

Project root directory

§max_sections: usize

Maximum auto-derived sections (default: 15)

§diagram_scale: f64

Mermaid diagram scale (0.65–1.8, default: 1.0)

§max_diagram_nodes: usize

Max nodes per section diagram (default: 18)

§max_diagram_edges: usize

Max edges per section diagram (default: 24)

§

TreeHtml

Generate D3 collapsible-tree HTML from a graph.json (filesystem hierarchy view)

Fields

§graph: Option<PathBuf>

Path to graph.json

§output: Option<PathBuf>

Output HTML file path

§root: Option<String>

Override common root directory

§max_children: usize

Max children per directory node before truncation (default: 200)

§label: Option<String>

Project label for root node

§

Clone

Clone a GitHub repo to a local cache dir (or pull if already cloned)

Fields

§url: String

GitHub URL to clone

§branch: Option<String>

Branch to clone/pull

§out: Option<PathBuf>

Override destination directory

§

Prs

Show open PRs dashboard (requires gh CLI)

Fields

§base: Option<String>

Override detected default/base branch

§repo: Option<String>

Target GitHub repo (owner/repo)

§limit: usize

Max PRs to fetch (default: 50)

§graph: Option<PathBuf>

Path to graph.json for blast-radius calculation

§

Version

Print the codesynapse version string

§

HookCheck

No-op hook-check (installed agents call this on every tool use; always exits 0)

§

CheckUpdate

Check if semantic re-extraction is pending for a path (cron-safe)

Fields

§path: PathBuf
§

CacheCheck

Check semantic cache for a list of files; writes .codesynapse_cached.json + .codesynapse_uncached.txt

Fields

§files_from: PathBuf

File containing paths to check (one per line)

§root: PathBuf

Root directory for relative paths and output (default: current dir)

§

MergeChunks

Merge chunk JSON files produced by parallel semantic extraction

Fields

§files: Vec<PathBuf>

Chunk JSON files to merge

§out: PathBuf

Output path for merged JSON

§

MergeSemantic

Merge cached semantic results with freshly-extracted chunks

Fields

§cached: Option<PathBuf>

Path to cached results (.codesynapse_cached.json)

§new: Option<PathBuf>

Path to newly-extracted chunk results

§out: PathBuf

Output path for merged JSON

§

Setup

Register codesynapse MCP server in installed AI clients

Fields

§client: Option<String>

Register only this client (claude-code, cursor, vscode, windsurf, zed, continue, jetbrains)

§workspace: Option<PathBuf>

Workspace directory for VS Code .vscode/mcp.json (default: current dir)

§

Resolve

Answer an architecture question using the graph (same as codesynapse_resolve MCP tool)

Fields

§query: String

Natural-language question or symbol name

§limit: usize

Number of top nodes to return

§

Module

Manage source modules: add, refresh, list, remove

Fields

§

Telemetry

Manage anonymous usage telemetry (opt-in)

Fields

Trait Implementations§

Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more