Skip to main content
Glama
getlien

Lien

Official
by getlien

Lien

/ljɛ̃/, French for "link"

A local code-health CLI: what's risky to change, and what your change just made worse. 100% local, 100% private.

Lien parses your working tree with Tree-sitter and answers four questions about a change — what is risky to touch, what crossed a complexity threshold, what deterministic signals fire on the diff, and where the hotspots are. There is no server, no database, and nothing to index: every command reads the files on disk when you run it. Point it at a repo and it works.

Full Documentation | Getting Started | How It Works


Features

  • Risk ranking - lien health ranks functions by complexity × fan-in ÷ test coverage

  • Pre-commit gate - lien delta fails only on NEW complexity threshold crossings, never pre-existing ones

  • Deterministic diff signals - lien review flags stale duplicated literals, removed exports, doc drift and more

  • Complexity analysis - Human-friendly metrics: test paths, mental load, time to understand

  • Nothing to set up - No index, no server, no config, no daemon. Install and run

  • 100% Local & Private - All analysis happens on your machine; no network calls

  • Fast - Whole-repo parse in seconds; lien delta in ~50 ms

  • Free Forever - No API costs, no subscriptions, no network calls at all

  • Ecosystem-Aware & Monorepo - Auto-detects 12 ecosystem presets; supports 15+ languages

Related MCP server: Context Bridge

Quick Start

# 1. Install
npm install -g @liendev/lien

# 2. Run it in any repo
lien health

That's the whole setup. No editor configuration, no indexing step, no wizard.

lien health              # what's risky to change here?
lien delta               # did my working tree cross a complexity threshold?
lien review --base main  # deterministic signals over my diff
lien complexity          # where are the hotspots?

Full installation guide

The four commands

Command

Answers

lien health

Which functions are risky to change? (complexity × fan-in ÷ test coverage)

lien delta

Did this change push a function over a threshold it was under before?

lien review

What deterministic signals fire on this diff?

lien complexity

Where is the tech debt?

lien delta is the one built to sit in a pre-commit hook or CI: it exits non-zero only for a function that crossed a threshold it was under at the base commit. Touching or improving a pre-existing violation never fails it.

Previous versions shipped an MCP server, a persisted SQLite index and FTS5 lexical search. All three have been removed, along with lien serve, lien index, and the search_code / get_files_context / get_dependents / list_functions / find_similar / get_complexity tools. An editor configured against lien serve will fail to start it. The structural questions Lien still answers, it answers by parsing on demand.

Complexity Metrics

Lien tracks code complexity with human-friendly outputs:

  • Test paths - Cyclomatic complexity as "needs ~X tests for full coverage"

  • Mental load - Cognitive complexity with nesting penalty

  • Time to understand - Halstead effort as readable duration (~2h 30m)

  • Estimated bugs - Halstead prediction (Effort^(2/3) / 3000)

Documentation

Supported Languages

TypeScript • JavaScript • Vue • Python • PHP • Liquid • Go • Rust • Java • C/C++ • Ruby • Swift • Kotlin • C# • Scala • Markdown • YAML

Ecosystem Presets: 12 ecosystem presets including Node.js, Python, PHP, Laravel, Ruby, Rails, Rust, JVM, Swift, .NET, Django, and Astro (auto-detected)

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.

Support

License

AGPL-3.0 © Alf Henderson

Lien is free forever for local use. The AGPL-3.0 license requires that anyone who distributes a modified version release its source under the same terms. For licensing questions, contact alf@lien.dev.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    A unified context layer that connects your local data — repositories, documents, remote machines, and notes — to LLM interfaces through the Model Context Protocol (MCP).
    3
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    A semantic code context server that connects your local repository to AI assistants via the Model Context Protocol, enabling dynamic codebase exploration without copy-pasting.
    5
    24 npm
    3
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Semantic codebase search + persistent working memory for AI code editors. Local, zero-config, MCP. No API key.
    8
    23
    2
    MIT