npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

likec4-excalidraw

v0.1.3

Published

Excalidraw-based visual editor for LikeC4 architecture projects

Readme

likec4-excalidraw

Excalidraw-based visual editor for LikeC4 architecture projects. MIT licensed.

npm install -g likec4-excalidraw
likec4-excalidraw ./architecture

or without a global install:

npx likec4-excalidraw ./architecture

The command starts a local web server and prints:

LikeC4 Excalidraw editor
Project: /home/user/project/architecture
Listening: http://localhost:4242

Opening that URL launches an Excalidraw canvas backed by the supplied LikeC4 project.

CLI

likec4-excalidraw [architecture-directory]

| Option | Description | | --- | --- | | --host <host> | Bind address. Default: 127.0.0.1 (localhost only unless you pass another host) | | --port <port> | Preferred port. Default: 4242. Falls back to a free port if busy | | --open | Open the editor in a browser | | --readonly | Disable scene writes and generated DSL export | | --help | Show help | | --version | Show version |

Default architecture directory is ..

MCP server

The editor exposes a project-aware Streamable HTTP MCP endpoint on the same network server:

http://127.0.0.1:4242/mcp

Configure an MCP client with that URL after starting likec4-excalidraw. Pass mcpToken when embedding startServer to require Authorization: Bearer <token>.

Available tools:

  • get_architecture, get_scene, and get_diagnostics
  • create_element, update_element, and delete_element
  • create_relationship and create_view
  • validate
  • get_canvas_screenshot for a whole-canvas PNG or a scene-coordinate area

Mutating tools update .likec4/excalidraw.json and the validated editor-owned excalidraw.generated.c4 source.

How it works

Excalidraw canvas
    ↓
semantic projection
    ↓
LikeC4 model
    ↓
validation / DSL export

Excalidraw is the editing surface. LikeC4 remains the semantic model and validator. The editor does not infer an architecture from arbitrary drawing appearance.

Once a shape is promoted to a LikeC4-managed object, identity lives in namespaced customData, not in position, label, or style.

Object states

Managed

Explicitly mapped to a LikeC4 element, relationship, or view. Identity is stored in customData.likec4.

Candidate

Looks like it could become a LikeC4 object (for example an arrow between two managed elements) but has not been promoted. Candidates never silently change the model. Use Convert to LikeC4 element / Convert to LikeC4 relationship.

Decoration

Normal Excalidraw content: notes, freedraw, screenshots, headings, icons. Decorations stay fully usable and are ignored during LikeC4 export.

Semantic vs visual containment

Moving a managed child outside its parent does not rewrite FQN or parent. The editor warns, then offers:

  • Move back inside
  • Change semantic parent
  • Ignore mismatch

Dropping a new candidate inside a managed container may suggest that parent. Silent semantic mutation does not happen.

Persistence

Scene state is stored next to the architecture project:

architecture/
  existing-model.c4
  .likec4/excalidraw.json
  excalidraw.generated.c4

.likec4/excalidraw.json is the Excalidraw presentation: geometry, decorations, unmanaged objects, and semantic references. Schema version is 1.

LikeC4 source files are not rewritten when you drag a shape. Semantic canvas edits are written to the editor-owned excalidraw.generated.c4 file.

Export and source ownership

Semantic canvas edits update excalidraw.generated.c4 live after validation. Existing project files are imported as context and are never destructively rewritten; the editor-owned file contains the merged architecture snapshot.

Export LikeC4 also validates and writes an explicit snapshot. An empty architecture directory is bootstrapped with actor, system, and service kinds plus a Landscape view.

customData.likec4 schema

All metadata is namespaced:

{
  "customData": {
    "likec4": {
      "version": 1,
      "role": "element",
      "fqn": "cloud.backend.api",
      "kind": "service"
    }
  }
}

Relationships:

{
  "customData": {
    "likec4": {
      "version": 1,
      "role": "relationship",
      "relationId": "rel_1",
      "source": "cloud.frontend",
      "target": "cloud.backend.api"
    }
  }
}

Views / frames:

{
  "customData": {
    "likec4": {
      "version": 1,
      "role": "view",
      "viewId": "backend"
    }
  }
}

role may also be candidate. Identity is never inferred from visible text.

Development

Requires Node 22+ and pnpm.

pnpm install
pnpm test
pnpm typecheck
pnpm lint
pnpm build
pnpm --filter likec4-excalidraw start -- ./fixture
pnpm publish:check
pnpm pack

The published package is likec4-excalidraw. Workspace libraries stay private; the CLI build bundles them and copies the app into packages/cli. Run pnpm build before pnpm pack or pnpm --filter likec4-excalidraw publish.

The fixture under fixture/ is a small LikeC4 project used by tests and local smoke runs.

For a larger walkthrough, use demo/:

pnpm --filter likec4-excalidraw start -- ./demo

Current limitations

  • Deployment model editing, dynamic views, and advanced predicate editing are deferred.
  • Export uses explicit view membership (include cloud.backend) rather than reconstructing include cloud.backend.**.
  • LikeC4 manual-layout round-trip is not written back. Excalidraw geometry is authoritative inside this app. Layouted coordinates are used only for the initial import when available.
  • Duplication is handled after the fact: copy/paste of a managed object becomes a candidate instead of a second identity. Use Add existing element to this view for another presentation of the same FQN.
  • The UI follows Excalidraw's own look rather than a separate design system.

Library notes

Current integrations (LikeC4 1.59.x, @excalidraw/excalidraw 0.18.x):

  • Load with LikeC4.fromWorkspace / fromSource
  • Query with computedModel(), layoutedModel(), getErrors()
  • Export prefers @likec4/core Builder + @likec4/generators when available, with a deterministic DSL serializer fallback
  • Manual LikeC4 layout snapshots exist but are not a stable write API here, so they are read-only via layoutedModel()