# Tentmaker documentation

> Install Tentmaker on Linux, macOS or Windows, set its memory budget, pool machines over Tailscale, run GitHub Actions jobs or Forgejo, Gitea and GitLab checks, and uninstall.

Project site: https://dbaney.com/tentmaker/

## Install

You need Linux with systemd and cgroup v2, macOS on Apple silicon, or Windows, on amd64 or arm64. Container steps on Linux need Podman. Put Tailscale on every machine that should join a pool.

On Linux or macOS:

```sh
curl -fsSL https://raw.githubusercontent.com/baney75/tentmaker/main/scripts/install.sh | sh
sudo tentmaker setup
```

On Windows, in PowerShell opened as Administrator:

```powershell
irm https://raw.githubusercontent.com/baney75/tentmaker/main/scripts/install.ps1 | iex
tentmaker setup
```

Each installer downloads the release for your CPU, checks its sha256 against the release's `SHA256SUMS`, and refuses to install if they differ. Add `-s -- --channel dev` after `sh` for the dev build, which is rebuilt on every change to `main`.

## Set up

On a terminal, setup asks for a device name, an everyday memory budget, a boost budget for when the machine is plugged in, what to do on battery, which repos to serve, and how to reach your forge. It tries `gh auth token` first, so a signed-in GitHub CLI needs nothing more. Every question shows its default, and Enter takes it. Then setup installs the sandbox for your OS and the system service and runs `tentmaker doctor`.

Every question has a flag, so a script or a coding agent can run it with no questions:

```sh
sudo tentmaker setup --yes --memory 4GiB --boost-memory 12GiB --repo owner/name
```

Running setup again is safe. It keeps what you set unless a flag changes it.

## Run GitHub Actions jobs

Point a job at your machines with labels:

```yaml
runs-on: [self-hosted, tentmaker, linux]    # or macOS, or Windows
```

Tentmaker registers a runner for one job at a time and deletes it when the job ends. The token it uses must be an admin of the repo, because registering runners needs the Administration permission. `tentmaker migrate` shows what it would change in a checkout's workflows, and `tentmaker migrate --write` makes the edits. It leaves alone jobs that deploy, publish, sign, use an environment or read secrets.

Tentmaker never runs a job from a fork. To send fork pull requests to GitHub's own runners instead, use:

```yaml
runs-on: ${{ github.event.pull_request.head.repo.fork && 'ubuntu-latest' || fromJSON('["self-hosted","tentmaker","linux"]') }}
```

## Run Forgejo, Gitea and GitLab checks

These forges use checks mode. Tentmaker reads the workflow files at a commit, runs the jobs it understands in its own sandbox, and posts a commit status named `tentmaker/<job name>`.

```sh
sudo tentmaker connect forgejo --url https://codeberg.org --token-stdin
sudo tentmaker repo add you/app --forge forgejo --mode checks
```

Gitea uses `--forge forgejo` too. For GitLab, use `connect gitlab` and `--forge gitlab`. Checks mode runs pushes to the default branch and pull requests from the authors you list, and understands `run` steps, `actions/checkout`, matrices and the common setup actions, which use tools already installed on the machine. It skips any job it can't run faithfully, and `tentmaker logs` says why.

## The budget

Each machine has an everyday profile, a quarter of its memory and CPUs by default, and a boost profile, half of each, used while it is plugged in. On battery it takes no new jobs below 40% and stops running jobs below 15%. The everyday profile is reserved for CI. A process you list, such as a game or a video call, or load past a limit you set drops boost back to everyday, and everyday keeps running. CI pauses when free disk or memory runs low.

```sh
tentmaker budget                                         # the current profile and why
sudo tentmaker budget set --memory 4GiB --boost-memory 12GiB
sudo tentmaker schedule add --name nights --days daily --from 22:00 --to 07:00 --profile boost
sudo tentmaker pause --for 2h video call
sudo tentmaker resume
```

## Pool your machines

Machines on the same tailnet, owned by the same tailnet user, with the same pool name find each other and share jobs. From a machine that already runs Tentmaker:

```sh
tentmaker devices add desktop
tentmaker pool
```

`devices add` sets up the other machine over Tailscale SSH, so that machine must allow Tailscale SSH for you and run `sudo` without a password. For a Windows machine it prints the PowerShell line to run there instead. You can also run the installer on each machine yourself.

## Let an agent set it up

Every command takes `--json` and `--yes`, never prompts without a terminal, and exits with a stable code. Give your agent the setup skill:

```text
Read https://raw.githubusercontent.com/baney75/tentmaker/main/skills/tentmaker/SKILL.md
and follow it to set up Tentmaker on this machine for my repo OWNER/NAME.
Ask me before you touch a public repo or give any device a forge token.
```

Tentmaker also serves an MCP server: `claude mcp add tentmaker -- tentmaker mcp`.

## Updates

There are two channels, stable and dev. With automatic updates on, the default, a machine checks every 6 hours and updates only between jobs. It verifies the download, swaps in the new binary, and rolls back if the service is not healthy within 60 seconds.

```sh
sudo tentmaker update --check
sudo tentmaker update
sudo tentmaker rollback
```

## Uninstall

```sh
sudo tentmaker uninstall           # remove the service and the sandboxes
sudo tentmaker uninstall --purge   # also delete config, secrets, state, cache and logs
```

On Windows, run `tentmaker uninstall` in an Administrator PowerShell. Change your workflows' `runs-on` back first, or their jobs will wait for a runner that never comes.
