Documentation
¶
Overview ¶
Package cli assembles GraphLume's command-line interface.
Index ¶
Constants ¶
const DefaultIndexMemoryLimit int64 = 768 << 20
DefaultIndexMemoryLimit is the soft heap limit `graphlume index` runs under when nothing else sets one and the repository is of ordinary size.
A soft limit (runtime/debug.SetMemoryLimit) does not stop the process at a size; it makes the collector work harder as the heap approaches it, so garbage that would have waited for the next cycle is returned sooner. An index run is a stream of parse trees that die young next to a graph that lives, which is the case it suits.
MEASURED, a full index of 561 C files (17.5 MiB of source, PostgreSQL's parser, 4 workers), median of three, on a 14-core Apple machine:
limit wall peak RSS none 15.5 s 1,114 MB 1 GiB 15.5 s 1,029 MB -8% 768 MiB 15.3 s 918 MB -18% (750 MiB measured) 500 MiB 16.1 s 844 MB -24% +4% wall
768 MiB is where the saving is still free: a fifth of the peak for no measurable time, where 500 MiB buys six points more for a few percent of wall clock.
const DefaultMemoryLimitMaxSource int64 = 64 << 20
DefaultMemoryLimitMaxSource is the most source a run may discover for the default limit to apply. Past it the live heap is bigger than the limit, and a limit below the live set only makes the collector run flat out: 14,000 files and 117 MiB of source took 283 s under 768 MiB against 254 s without (+11%), with no lower peak (1,818 MB against 1,414 MB, one run each). The cut is 64 MiB, between that and the 17.5 MiB that gained. An explicit limit is always applied.
const IndexDir = ".graphlume"
IndexDir is where GraphLume stores its registry inside a project.
const IndexFile = "index.db"
IndexFile is the SQLite registry filename.
Variables ¶
var ( Version = "dev" Commit = "none" BuildTime = "unknown" )
Build metadata, injected via -ldflags at release time. Spec §64.
Functions ¶
func UninstallCommitHook ¶
UninstallCommitHook removes the managed block from post-commit, post-merge, and post-checkout, leaving any other hook content exactly as it was. Reports whether anything was removed.
Types ¶
type Deeplink ¶
Deeplink represents a 1-click installation URI for an AI coding agent or editor.
func AgentDeeplinks ¶
AgentDeeplinks returns 1-click MCP install links for supported editors.
type ExitCodeError ¶
type ExitCodeError struct {
Code int
// Silent is set when the command already printed its report. The code is
// the message at that point, and an "error:" line beneath a rendered report
// reads as a malfunction rather than a verdict.
Silent bool
Err error
}
ExitCodeError is an error that carries the process exit code it wants.
It exists so a command whose exit code IS its output — `verify`, whose four dispositions a CI job branches on — can express that without calling os.Exit from inside RunE. A command that exits the process directly cannot be tested for the one behaviour that matters about it, and the codes would then be the only untested part of a gate whose entire job is to fail correctly.
func (*ExitCodeError) Error ¶
func (e *ExitCodeError) Error() string
func (*ExitCodeError) Unwrap ¶
func (e *ExitCodeError) Unwrap() error
type Global ¶
type Global struct {
JSON bool
Verbose bool
Quiet bool
Project string
// contains filtered or unexported fields
}
Global holds flags shared by every command.
type HookState ¶
type HookState struct {
Path string `json:"path"`
AuxiliaryPath string `json:"auxiliary_path,omitempty"`
// NeedsWiring is true when GraphLume wrote an auxiliary script beside a
// hook it would not edit (not a shell script) and that hook does not call
// it yet. Git never runs the auxiliary script by itself, so such a hook is
// not Installed.
NeedsWiring bool `json:"needs_wiring,omitempty"`
Installed bool `json:"installed"`
Appended bool `json:"appended,omitempty"`
AlreadyCurrent bool `json:"already_current,omitempty"`
}
HookState reports what an install actually did. Callers print it; the portal renders it.
func CommitHookStatus ¶
CommitHookStatus reports primary post-commit installation status.
func InstallCommitHook ¶
InstallCommitHook writes (or updates) the managed block in post-commit, post-merge (on git pull/merge), and post-checkout (on branch switch).
type HooksReport ¶
type HooksReport struct {
PostCommit HookState `json:"post_commit"`
PostMerge HookState `json:"post_merge"`
PostCheckout HookState `json:"post_checkout"`
}
HooksReport reports status across all managed hooks.
func AllHooksStatus ¶
func AllHooksStatus(root string) HooksReport
AllHooksStatus reports status across post-commit, post-merge, and post-checkout.
type IssueBundle ¶
type IssueBundle struct {
Timestamp string `json:"timestamp"`
GraphLumeVersion string `json:"graphlume_version"`
Commit string `json:"commit"`
BuildTime string `json:"build_time"`
GoVersion string `json:"go_version"`
OS string `json:"os"`
Arch string `json:"arch"`
NumCPU int `json:"num_cpu"`
Project string `json:"project"`
Checks []check `json:"doctor_checks"`
Status map[string]any `json:"index_status,omitempty"`
SubmitInfo SubmitDetails `json:"submit_info"`
}
IssueBundle represents a sanitized diagnostic bundle ready for bug reports.
type ScopeTypeAnalysis ¶
type ScopeTypeAnalysis struct {
Type string `json:"type"`
Files int64 `json:"files"`
FilesPercentage float64 `json:"files_percentage"`
Symbols int64 `json:"symbols"`
ResolutionScope string `json:"resolution_scope"`
}
ScopeTypeAnalysis breaks down files, symbols, and resolution provenance by architectural role.
type SubmitDetails ¶
type SubmitDetails struct {
GitHubIssuesURL string `json:"github_issues_url"`
SupportEmail string `json:"support_email"`
Instructions string `json:"instructions"`
}
SubmitDetails guides the user on where and how to submit their issue.
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
UI provides styled terminal output.
Source Files
¶
- accuracy.go
- accuracy_compare.go
- agentline.go
- agentserver.go
- agentsetup.go
- apidb.go
- arch.go
- autoindex.go
- bench.go
- bundle.go
- busfactor.go
- ci.go
- clean.go
- clients.go
- commands.go
- communities.go
- compact.go
- configdeps.go
- coverage.go
- diagram.go
- diagram_html.go
- diff.go
- diffmini.go
- docs.go
- editrefresh.go
- events.go
- explore.go
- export.go
- groups.go
- hooks.go
- impact_diff.go
- index.go
- index_artifact.go
- indexer_setup.go
- indexers.go
- indexlock.go
- infra.go
- init.go
- install.go
- install_links.go
- languages.go
- lessons.go
- licensereport.go
- memlimit.go
- mentions.go
- missed.go
- move.go
- move_build.go
- opendb.go
- pack.go
- parsesummary.go
- planchange.go
- policy.go
- pr_impact.go
- profile.go
- prune.go
- query.go
- rename.go
- report.go
- reports.go
- resolve.go
- resolve_gotypes.go
- resolve_indexers.go
- resolve_profile.go
- root.go
- runtime.go
- scip.go
- serve.go
- serve_estate.go
- serve_http.go
- serve_noindex.go
- serve_team.go
- sessionhook.go
- setup.go
- sqlquery.go
- stats.go
- stdioframing.go
- structure.go
- supplychain.go
- system.go
- system_contracts.go
- system_go.go
- system_index.go
- teamtokens.go
- thirdparty.go
- tool.go
- tour.go
- ui.go
- uninstall.go
- ux.go
- verify.go
- watch.go
- who.go
- workspace.go
- workspace_links.go
- workspace_sync.go