Skip to content
Β 
Β 

Latest commit

Β 

History

961 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Baker 🍞

Meet Baker! Baker sets up development environments from one configuration file (baker.yml), so everyone in a group ends up with the same setup β€” and can verify and clean up their environment afterwards.

See a running demo below:

Install from source

git clone https://github.com/chbrown13/Baker
cd Baker
npm install
npm link

Using Baker

Baker uses a configuration file (baker.yml) in the root directory of you project. Below is an example of a baker.yml file. By running baker bake Baker installs the toolchain, places prepared configuration into projects, verifies the result, and can revert your system after completing activities. It can be run against your own machine, a Docker container, or a remote host via SSH using the same config for Linux, macOS, and Windows.

---
name: baker-test
local: {}
tools:
  - maven
packages:
  - jq
commands:
  serve: npm install && node index.js

local: configures the machine you are sitting at. Use local: {} for the current directory, or give a path to place the environment somewhere else.

You can also point to a git repository with a baker.yml file, and Baker will do the rest:

$ baker bake your-org/configs

If you already have Docker installed, the docker: key provisions a container on your local Docker daemon. Baker connects to /var/run/docker.sock (or DOCKER_HOST), so the same bakelets run inside a plain container.

name: dev-box
docker: node:18       # or: docker: {} for ubuntu:latest, or an object with image/ports
lang:
  - python3
tools:
  - jupyter
start: jupyter notebook --no-browser

Run baker bake, then baker ssh opens a shell inside the container and baker destroy removes it. If name: is omitted, the container name is derived from the current directory. Ansible-backed bakelets (lang, tools, services, …) use ansible_connection=docker and require Ansible on the host.

Baker can also run bakelets directly on your host machine without a VM or container β€” ideal for workstation setup or CI environments.

name: dev-env
local: {}
lang:
  - nodejs9
  - python3
tools:
  - jupyter
start: jupyter notebook --no-browser

The local key accepts a path string (e.g. local: ~/my-project) to set the working directory, or local: {} to use the current directory. Bakelets run directly on your host β€” no VM, no container, no Ansible control VM needed.

Setting up a Java environment with MySQL can be done easily.

name: onboard
remote:
  ip: 192.168.8.8
  user: ubuntu
  private_key: ~/.ssh/id_rsa
vars:
  - mysql_password:
      prompt: Type your password for mysql server
tools:
  - maven
services:
  - mysql:
      version: 8
      service_conf: env/templates/mysql.cfg
      client_conf: env/templates/my.cnf
lang:
  - java8
config:
  - template: 
      src: env/templates/hibernate-template.cfg.xml 
      dest: /Onboarding/CoffeeMaker/src/main/resources/hibernate.cfg.xml
commands:
  serve: cd CoffeeMaker && mvn spring-boot:run
  debug: cd CoffeeMaker && mvnDebug spring-boot:run
  test: cd CoffeeMaker && mvn test

Placing files into an existing project

config: - files: puts files and directories at chosen paths, composing a shared base with a per-unit overlay. It works in every mode, needs no Ansible and no sudo, and converges: with prune: true a re-bake removes what the previous bake placed and this one does not, while never touching a file Baker did not place.

name: unit-1
local: .
config:
  - files:
      - src: ../../base/        # shared layer
        dest: .
      - src: ./overlay/         # unit-specific; wins on any shared path
        dest: .
      - src: ./gitignore.block  # merged between markers, not overwritten
        dest: .gitignore
        append: true
    run:
      - npm --prefix .tooling install
    prune: true

Files Baker places are Baker-owned: a re-bake replaces edits to them, and removing an entry from the config deletes the file. See docs/bakelets.md.

Agentic coding tools

Baker can install agentic coding CLIs into whatever environment it provisions (host, container, or box) as tools: bakelets. Currently claude-code and opencode are supported.

name: dev-env
local: {}
tools:
  - claude-code                              # curl install (default)
  - opencode:
      install: npm                           # "curl" (default) or "npm"
      repo: https://github.com/org/oc-config # optional: clone agents/skills config into the config dir

Installs are idempotent β€” re-baking an environment that already has the tool is a no-op. When a config repo: is given, Baker clones it on the first bake and fast-forwards it (git pull --ff-only) on subsequent bakes. Use the url:dest string form or the object form (repo: { repo: <url>, dest: <path> }) to control where it lands.

Flexible baker.yml sources

baker bake [source] accepts a single positional argument that covers most of the ways you might point at a config:

baker bake                              # ./baker.yml in the current directory
baker bake ./path/to/dir                # a directory containing baker.yml
baker bake owner/repo                   # clone a GitHub repo with a top-level baker.yml
baker bake owner/repo:units/one         # clone a repo and use the baker.yml in units/one
baker bake https://.../tree/...         # tree URL, gist, snippet, or raw file URL

bake always resolves to a directory containing a literal baker.yml. An address ending in .yml is rejected, because that form belongs to baker check. Clones and fetches go to ~/.baker/cache/, never your working directory.

Local paths always win over GitHub shorthand, so a real ./owner/repo directory is used as-is. The explicit --local, --repo, --file, and --box flags still work as overrides.

Verifying an environment

baker check verifies that an environment ended up configured correctly by delegating to opunit.

baker check                              # runs test/opunit.yml on this machine
baker check owner/repo:profile.yml       # runs a profile from the repository's default branch
baker check owner/repo@unit-1:profile.yml  # runs a profile from the branch or tag unit-1

Baker pins the profile to a commit before fetching it, so a profile you just pushed takes effect immediately, and each run prints the commit it checked against.

Requires opunit 0.9.4 or newer, installed globally: npm install -g ottomatica/opunit.

About

πŸ‘¨β€πŸ³πŸž Quick and easy baking of computing environments.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages