Registry / devops / puml2c4

puml2c4

JSON →
library0.2.0jsnpmunverified

puml2c4 is a PlantUML C4 to LikeC4 transpiler (v0.2.0, early stage, pre-1.0). It converts existing PlantUML C4 diagrams into the LikeC4 DSL format, enabling interactive visualizations with drill-down and auto-layout. Supports persons, systems, containers, components, boundaries, deployment nodes, and relationships with standard PlantUML C4 syntax. Unlike manual conversion, puml2c4 automates the migration of PlantUML-based architecture diagrams to LikeC4 without rewriting. Currently supports Node.js >=18 and is distributed as an npm package with TypeScript type declarations. Release cadence is irregular; users should expect breaking changes until 1.0.

npm install puml2c4
INSTALL
IMPORT
SIG · PUML2C4
P
puml2c4
devopsjavascriptv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

puml2c4
npx puml2c4 convert <input> -o <output>
import puml2c4 from 'puml2c4'
puml2c4 is a CLI tool, not a library. Use via npx or global install.

Converts a directory of PlantUML C4 files to LikeC4 format using npx.

mkdir -p diagrams out cat > diagrams/sample.puml << 'EOF' @startuml !include C4_Context.puml Person(user, "User", "A customer") System(app, "Application", "Main system") System_Ext(email, "Email Service") Rel(user, app, "Uses", "HTTPS") Rel(app, email, "Sends notifications", "SMTP") @enduml EOF npx -y puml2c4@0.2.0 convert diagrams/ -o out/context.c4
puml2c4 --version
Debug
Known issues
deprecatedv0.2.0 is pre-1.0; breaking changes may occur without major version bump.
fix
Pin version in CI scripts: 'npx puml2c4@0.2.0'
affects: 0.x
gotchaOutput directory must exist; tool does not create intermediate directories automatically.
fix
Use 'mkdir -p <dir>' before running convert.
affects: >=0.1.0
gotchaSome PlantUML C4 features like 'Lay_D' or 'Layout_LeftRight' are not supported.
fix
Manually adjust layout in LikeC4 after conversion.
affects: >=0.1.0
gotchaTool is meant for CLI use; there is no JavaScript API exported.
fix
Use child_process.exec() if integration needed, but not officially supported.
affects: >=0.1.0
Errors
Common errors & fixes
Error: ENOENT: no such file or directory, open '<path>/<file>.c4'
Output directory does not exist.
fix
Create the output directory before running: mkdir -p out/
Error: Unexpected token '}' ...
Input file contains unsupported PlantUML C4 syntax or syntax error.
fix
Simplify the diagram to only supported elements (see README). Remove unsupported macros like Lay_D.
Error: Cannot find module 'puml2c4'
Using import/require instead of CLI npx or global install.
fix
Use npx puml2c4 or npm install -g puml2c4 then puml2c4.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
puml2c4 — npm install puml2c4 · libregistry