1. Setup
You need three things to work in Archlang:
- The CLI, for validating and formatting files.
- An editor with the language server attached, for completion and diagnostics.
- A viewer to see the diagrams your files render to.
This chapter installs all three. If you already have them, skim and continue to Chapter 2.
The CLI
npm install -g @archlang/cliThat gives you archlang on your path. Four subcommands:
archlang info path/to/package # summarize a packagearchlang validate path/to/package # validate; exits non-zero on errorsarchlang check path/to/package # validate + run derived checksarchlang format path/to/file.arch # canonical formatting (mints stable IDs)archlang validate accepts --watch to re-run on every file change. archlang format accepts --check (exit non-zero if anything would change) and --diff (print what would change without writing).
You’ll use format constantly — it mints the stable IDs introduced in Chapter 13, so most files in this book are written without IDs and gain them on first save.
Editor
Two editors are supported as first-class clients of the Archlang language server:
- VS Code — install the Archlang extension from the marketplace.
- JetBrains (IDEA, WebStorm, GoLand, …) — install the Archlang plugin from the JetBrains plugin marketplace.
Both give you completion of kind names, hover documentation, go-to-definition for cross-module references, validation diagnostics, and inline diagram preview.
If your editor isn’t on that list, the LSP can be attached manually — see Tools → LSP.
Viewer
The web viewer renders any package or single file. Two ways to reach it:
- The hosted viewer at
archlang.dev/demo— paste files in, see the diagram. - The embedded viewer — drop
<archlang-viewer>into any HTML page (see Tools → Embed Viewer).
The editor extensions ship an inline preview pane that re-renders on every save, so for local work that’s usually the right tool.
Verify
Create an empty directory, drop in a single file hello.arch:
service Hello { team: Demo command Greet}Run:
archlang validate .If you see no output and the command exits cleanly, you’re set. If you see STDLIB_NOT_FOUND or a missing-kind error, the toolchain doesn’t know what service is yet — your package needs a manifest. We’ll add one in the next chapter.
What’s next
Chapter 2: Your First Architecture → — build a small system, render it, change it, watch it update.