What is CodeBaker?
CodeBaker is a code generator for JetBrains IDEs whose templates are ordinary files in your own project. Pick a template from the menu, fill in a short form, review every file, and CodeBaker writes them. It works for any language or text format.
Current version: 0.9 beta, for IntelliJ Platform IDEs from 2023.2 to 2026.2 (IntelliJ IDEA, PhpStorm, WebStorm, PyCharm, GoLand, RubyMine, CLion, Rider and DataGrip).
A minute with a bundled sample template: generate a Task page with its script, open it in the browser and add a record, then generate the same for User.
A template is a folder of at least two files: the main configuration file, and one or more files to generate. Here is the smallest one:
https://codebaker.dev/examples/welcome-page.zipNeeds the CodeBaker plugin and an open project. Another IDE, or the button does nothing? Copy the link, then in the IDE right-click any folder → New → Generate from Template → Install Template from URL… and paste it. You always get a confirmation dialog before anything is installed.
{
// The folder name when the template is installed under .CodeBaker/
id: "welcome-page",
name: "Welcome Page",
// Each variable becomes a field in the dialog, with this as its default value.
vars: {
title: "Welcome",
description: "This page was generated from a template.",
},
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ title }}</title>
</head>
<body>
<h1>{{ title }}</h1>
<p>{{ description }}</p>
</body>
</html>
- title
- Welcome
- description
- This page was generated from a template.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Welcome</title>
</head>
<body>
<h1>Welcome</h1>
<p>This page was generated from a template.</p>
</body>
</html>
index.html is the page, with {{ title }} and {{ description }} where the text should change. codebaker.config.json5 is the main configuration file of the template: its name is the label in the menu, and its vars are the fields of the dialog, each with a default value.
The folder lives in your project as .CodeBaker/welcome-page/. When you pick it, the dialog asks for title and description, and CodeBaker writes index.html into the folder you right-clicked, with your values in place. You can try this one: download it or install it into your IDE with the buttons under the example.
To make your own fields, hold a list, or compute a value from another one, see Values and Variables.
What you get
- Templates that are real files. A template is a folder of code files in their own language (
.php,.ts,.html, ...), kept in the.CodeBaker/folder of your project and committed with your code. The dynamic parts are written so that your IDE can still read the file. See Why Templates Are Plain Files. - A review before anything is written. The preview shows every file. For a file that already exists it shows the current file, what CodeBaker would write and an editable final version side by side. The whole generation is one undoable command. See the Generation Workflow.
- Changes inside files that already exist. Insert one block into a file, replace a block, add an entry to a JSON list, or write a file only the first time. The rest of the file stays as it was. See Advanced Templates.
- Whole folders from one form. One form can produce a controller, its test and its view, each in its own folder, and a loop can repeat a file or a whole folder for every item of a list.
When it fits
Use CodeBaker for files and folders that repeat with small variations and that you want to keep consistent and reviewable in Git: models and controllers, components with their tests, migrations, configuration. For a short snippet typed into one file, the IDE's own live templates are lighter.
CodeBaker is not an AI code generator. It writes exactly what the template says, the same way every time, and you see all of it before anything is written.
Where to go next
If you want to use templates that someone else made:
- Getting Started: install the plugin and generate your first files from the bundled samples.
- Installing Templates: add a template from a link or a file.
If you want to write your own:
- Your First Template: write a small template yourself.
- Values and Variables: where the fields of the dialog come from, what JSON is, and how a value is computed.
- All Features: everything CodeBaker does, each with a link.
Please report what you find at info@codebaker.dev.