divide 0.12.0 · Application

The IDE for building code generators

divide is where you build, test and debug generators made with Div templates. It checks templates as you type, renders them with the real Div engine, and shows step by step how Div reached its output. In a terminal or in your browser.

Free software (GPL 3) · Supported on Linux and Windows · macOS is experimental

divide in under a minute. Each step is captioned in the video.

How a generator works

Model → Template → Code

A generator takes a model, runs it through templates, and writes the code you would otherwise type by hand. divide is built for the middle step: writing and checking the templates against your real data.

A specialised IDE

It speaks Div the way Div does

You can write the same templates in any editor. divide adds what a general editor does not know: each template's dialect, your project's Div setup, and the real engine.

  • Every Div construct highlighted, in the template's own dialect.
  • Errors before you render: unclosed loops, broken JSON, tags Div would leave as text.
  • Completion from your real data: {$ offers the keys of the template's data.
  • Ctrl+F9 renders with PHP and Div, unsaved edits included, side by side with the template.
divide: the project window, a Div template in the editor, and its rendered output side by side

Render trace

See how Div reached its output

Press F7 in a template and divide replays the render: every pass Div made, what it matched, what each condition decided, and which include it loaded.

  1. Each step of the render, in order, with what changed.
  2. The part of the template that step touched, highlighted.
  3. Conditions, loops and includes explained in plain words.

Flow Designer

Design the steps of a generator

A generator is often a sequence: load the model, validate it, generate, check. With Runner, that sequence is a Flow, and divide draws it as blocks and steps you can edit, check and simulate one step at a time.

  • Blocks, steps and the jumps between them, on one screen.
  • Problems found as you edit, before anything runs.
  • A simulation that pauses at each step and shows the context (Runner 0.3 or newer).
The Flow Designer: three blocks of steps side by side, the arrows of their jumps, and the details of the selected step

Run and debug

The PHP around your templates, too

Generators have PHP of their own. divide runs it and, with Xdebug installed, debugs it in the spirit of Turbo Pascal: breakpoints, stepping, watches and the call stack, in windows next to the code.

  • A PHP language server (phpactor or intelephense): hover, go to definition, completion.
  • PHP's built-in web server, for generators with an HTTP interface.
  • Git, Composer and Find in files without leaving the IDE.

Terminal or browser

The same divide, wherever you work

divide is keyboard first, in the spirit of the Borland IDEs. It runs in any terminal, over SSH and in tmux. With divide --web it serves the same IDE to a browser on your computer, and each tab is its own divide.

divide in a terminal with the phosphor amber theme: the project window and a template with git marks
divide . in a terminal, with one of its themes
divide in a web browser: the same menus, editor and status line as in the terminal
divide --web . in a browser on the same computer

AI coding agents

Agents check their work with the real engine

divide has an MCP server. An AI coding agent such as Claude Code, Codex or OpenCode gets the same checks, renders and render traces you see in the IDE, through the real Div engine.

divide complements agents, it does not replace them: an agent should not have to write large amounts of predictable code that a checked generator can produce.

The MCP server dialog in divide: running on 127.0.0.1, with the requests and the connected agent

Under the hood

Built to be trusted

Reproducible generation

The same template and data give the same output when everything else that takes effect is controlled too: the time, random values, the PHP functions a template calls. divide renders with the real engine, so what you check is what you get.

Built on TurboFrame

Its windows, menus, editor, search, Git windows and web mode come from TurboFrame, the Divengine framework for terminal applications. turbodoo shares it.

Linux and Windows

The supported platforms. Every change is tested on both, and divide is opened in a real browser from the installed command and from the packaged binary. macOS is experimental and not officially supported: it runs from source, with no packages.

Free software

GPL, version 3 or later. Built in public: issues, discussions and pull requests are welcome. Its help comes in English and Spanish.

Install

Ready to run, nothing else to install

For rendering, your project needs PHP 8 and Div (composer require divengine/div).

Windows

With Scoop, or the .msi installer from the latest release.

scoop install https://github.com/divengine/divide/releases/latest/download/divide.json

Linux

A .deb, .rpm, .apk or Arch package, an AppImage, or the binary alone.

sudo apt install ./divide_*_amd64.deb

From source

Python 3.11 or newer. This is also the way to try it on macOS, which is experimental and not officially supported.

pipx install git+https://github.com/divengine/divide.git