---
title: 'forge 2026.10.2: forge as a library, with views as diagram-scene scenes'
url: https://www.grahambrooks.com/post/forge-2026-10-2-library/
date: 2026-10-14T06:11:38-06:00
author: Graham Brooks
description: forge v2026.10.2 can be used as a Rust library that parses a .forge model and lays its views out as diagram-scene scenes, so a host application can draw them natively. The rest of the release is dependency updates.
tags:
- diagrams
- rust
- architecture
- developer-tools
- Continuous Delivery
---

# forge 2026.10.2: forge as a library, with views as diagram-scene scenes

*forge v2026.10.2 is mostly one change: the parser and layout code can now be used as a library, without the command line attached. Everything else in the release is dependency upkeep.*

**forge** is a modeling DSL and toolchain for software architecture. You describe structure, processes, deployment and data in a single `.forge` file, and the `forge` binary renders SVG diagrams, generates documentation sites, lints the architecture and exposes the model to AI agents over MCP. It's one statically linked Rust binary, with no JVM, Node or Python. It's for anyone who wants their architecture diagrams to come from text that lives in the repository, not from a drawing tool. I wrote about how it fits with its sibling tools in [A Rust-Native Architecture Toolchain](https://www.grahambrooks.com/post/rust-native-architecture-toolchain/), and the previous release, a JetBrains preview plugin and models on stdin, is in [forge 2026.9.8](https://www.grahambrooks.com/post/forge-2026-9-8-jetbrains-preview/).

This release is 14 commits and 21 files changed, 964 lines added and 82 removed. One commit, "forge as a library: views as diagram-scene scenes; stable layouts", accounts for 910 of those added lines across 13 files. The other 13 are one small Makefile target, the release bump for v2026.10.1 and eleven dependency updates.

## forge as a library

Until now, if you wanted forge's layout you ran the `forge` binary and got an SVG. Now the `forge_dsl` crate exposes the pieces directly. You parse a model, resolving its `!include` files, list the views it defines, and ask for any view as a scene:

```rust
let model = forge_dsl::parse_file("architecture.forge")?;
for view in forge_dsl::views(&model) {
    let scene = forge_dsl::scene(&model, &view.key, &measure);
}
```

A scene is a [`diagram-scene`](https://github.com/grahambrooks/diagram-scene) value: a laid-out diagram as plain data. That's the library from my [diagram-scene post](https://www.grahambrooks.com/post/diagram-scene-first-release/). The point of handing back data rather than pixels is that the host decides how it looks. It draws the scene in its own theme and its own fonts, which is why `scene` takes a `measure` argument that should measure the font the text will be drawn in. The README says the emx editor previews `.forge` files this way. `views` returns views in declaration order and leaves out composite views, the grids of other views, because their cells are views already.

The library doesn't drag the command line in with it. Without the default `cli` feature, none of the CLI's dependencies are compiled. That means clap, the LSP server, the file watcher, the git and code-analysis crates and the SVG rasterizer. The dependency line from the README:

```toml
forge-dsl = { git = "https://github.com/grahambrooks/forge", default-features = false }
```

The commit title also says "stable layouts". That's a fix: the layouts iterated the model's element map, whose order is random per run, so the same model came out differently each time. They now place elements in declaration order, so a model draws the same view on every run, and the library goes through the same layout code the CLI uses.

If you only use the `forge` command, you won't notice this change. It matters if you're building something that wants to show a forge model inside its own window.

## Upkeep

The rest is the kind of thing you shouldn't have to think about. The Rust Docker tag moves to 1.99. The Rust crates `tokio` (1.53.2), `toml` (1.1.8), `serde_json` (1.0.154) and `symgraph` (v2026.10.1) are bumped, along with the Kotlin plugin version for the JetBrains plugin (2.4.21), Gradle (9.8.1) and a handful of GitHub Actions. There's also a new `make watch-ci` target, which waits for every CI run on HEAD after a push and fails if any of them fails. It's a contributor convenience and doesn't touch the binary.

## Install or upgrade

The README gives four ways to install. With Homebrew:

```bash
brew tap grahambrooks/forge https://github.com/grahambrooks/forge
brew install grahambrooks/forge/forge
```

The formula lives in the forge repo rather than a separate tap, so the tap URL is required. With cargo, the crate is published as `forge-dsl` and installs a `forge` binary:

```bash
cargo install --locked forge-dsl
```

Each release also publishes tarballs on [GitHub Releases](https://github.com/grahambrooks/forge/releases) for Linux (x86_64 and aarch64) and macOS (Apple Silicon). Intel Macs have no prebuilt binary, so build from source there. To try unreleased changes from `main`:

```bash
cargo install --git https://github.com/grahambrooks/forge forge-dsl --locked
```

The README doesn't describe a separate upgrade command. The Homebrew formula was updated to v2026.10.2 on 13 October, so `brew upgrade` picks it up. crates.io is behind: the newest forge-dsl there is 2026.10.1, so `cargo install` doesn't get this release; use Homebrew, a release tarball or the git install above.
