Inspired by Make and Bazel · Made for humans
Bob is a build system, a task runner as well as tooling for Git Multi-repos, all bundled into a single binary.
With bob, you can:
- Build your programs efficiently, as Bob tracks build inputs and caches compiled outputs, providing fast incremental builds.
- Run local development environments, whether they are simple binaries, docker-compose files, or a mix of both.
- Multi-Repo Tooling Easily manage multi-repo setups, with bulk Git operations.
Download the latest release from GitHub.
If you already have Go 1.16 or later installed, the short version is:
go install github.com/benchkram/bob@latest
For shell autocompletion (bash and zsh supported) add source <(bob completion)
to your .bashrc
/.zshrc
.
Bobs generates its internal build graph from tasks described in a bob.yaml
file (we usually refer to it as "bobfile").
The basic components of a build task are:
- input: Whenever an input changes, the task's commands need to be re-executed [default: *]
- cmd: Commands to be executed
- target: File(s) or directories that are created when the commands are run and can be reused in other tasks.
Example of a bob.yaml
file:
build:
build:
input: ./main.go
cmd: go build -o ./app
target: ./app
Multiline sh
and bash
commands are entirely possible, and are powered by mvdan/sh.
Take a look into the server-db example for a step-by-step tutorial.
Our goal is to create a world-class local development experience by integrating seamlessly with the build-system and
enabling you to start right after cloning a repository. Let the build-system create binaries and docker images, then
execute & control them from one terminal using bob run
. No more back-and-forth tab switching.
Ideally, those are the only two commands necessary to get started when joining a new project that uses Bob:
git clone
bob run
Individual steps for web server development are likely similar to this:
- Code generation using an IDL, like openapi or protobuf
- Compile a server binary
- Run a database in docker
- Run the server
Those build/run tasks can be described in a bob.yaml file. This allows bob run
to launch and give you control to a
local development environment.
An in-depth example is available here.
Bob enables a natural feeling git workflow for Git multi-repo setups without relying on Git Submodules.
To do this, Bob uses the concept of a "workspace" to track other git repositories. Inside a workspace you can use the usual every day git-operations through bob with visually enhanced output for the multi-repo cases.
Here is an example of bob git status
in a workspace:
Highlighted directories indicate child Git repositories and therefore bob git add
and bob git commit
will only
operate on the repository a file belongs to allowing to create repository overlapping commits all together.
Take a look into the bob git README for the current status.
To set up a new bob workspace you first have to initialize it:
bob workspace init
This creates a .bob.workspace file and initializes a new git repository in the current directory.
Adding repositories to the workspace:
bob workspace add [email protected]:benchkram/bob.git
bob clone # calls git clone for missing repos
Cloning an existing workspace from a remote git repository:
bob clone [email protected]:benchkram/bob.git
Full documentation of Bob is available at bob.build
A list of Bob's top dependencies:
- charmbracelet/bubbletea - Used in Bob's Terminal User Interface
- docker/compose - Enables us to run docker-compose files the same way
docker compose
does - sh - Parsing/execution of shell commands