# AI use cases for Enroute (enroute-sh/enroute)

Repo: [enroute-sh/enroute](https://github.com/enroute-sh/enroute) | Use cases: 4 | Page: https://dedupedai.com/use-cases/enroute-sh-enroute/

Enroute is an early, open source, programmable Git server written in Rust that stores repositories in object storage such as S3 and exposes hooks and a gRPC API.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Run a local Git server and push a repo to it: https://dedupedai.com/use-cases/enroute-sh-enroute/run-local-git-server/
- Build a code-hosting app on Enroute with a coding agent: https://dedupedai.com/use-cases/enroute-sh-enroute/build-code-hosting-app-with-agent/
- Block force pushes to main with a pre-receive hook: https://dedupedai.com/use-cases/enroute-sh-enroute/block-force-pushes-to-main/
- Trigger a deploy or mirror after each successful push: https://dedupedai.com/use-cases/enroute-sh-enroute/trigger-deploy-after-push/

## How to run a local Git server and push a repo to it with Enroute

Repo: [enroute-sh/enroute](https://github.com/enroute-sh/enroute) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Start a single Enroute node on your machine and push a repository to it in minutes.

**Who it is for:** A developer who wants a private Git server for testing or prototyping, with no external database to set up.

**The problem:** Setting up a Git server with access control and storage usually takes a lot of configuration before the first push works.

**The outcome:** A running local Enroute node that holds a repository created by your first push.

### Steps

1. Run `curl -fsSL https://enroute.sh/install | sh` to install Enroute.
2. Run `enroute dev` in one terminal and leave it running.
3. In another terminal, from your project folder, run `git push http://127.0.0.1:8080/hello.git main`.
4. Run `enroute repo list` to confirm the repository was created.

### Prompt to paste into your agent

```text
Using the enroute-sh/enroute README, install enroute, start `enroute dev`, and push the <project-dir> main branch to http://127.0.0.1:8080/<repo-name>.git. Report the output of `enroute repo list`. Verify that <repo-name> appears in that list.
```

### Caveat

Enroute is early and has no backwards compatibility between 0.x releases, so a storage format change may require a clean slate and a re-push.

Risk, remote script: The install step pipes a script from Enroute.sh directly into sh, so read the script or verify it before running it.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/enroute-sh-enroute/run-local-git-server/

## How to build a code-hosting app on Enroute with a coding agent with Enroute

Repo: [enroute-sh/enroute](https://github.com/enroute-sh/enroute) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Give a coding agent the Enroute skills and have it build a small code-viewing app chapter by chapter.

**Who it is for:** A developer who wants to build a custom code-hosting or code-review app and would rather delegate the scaffolding to a coding agent.

**The problem:** Starting a custom Git-based application means learning the Git protocol, the hooks and the API before anything shows on a page.

**The outcome:** A local project where an app shows code and diffs from repositories hosted on Enroute.

### Steps

1. Run `npx skills add enroute-sh/enroute` in your project folder.
2. Start a local node with `enroute dev` if one is not already running. (inferred, check the README)
3. Ask your coding agent to follow docs/build/README.md from the enroute-sh/enroute repository, one chapter at a time.
4. Push a test repository with `git push http://127.0.0.1:8080/hello.git main` and open the app to check that code and diffs appear. (inferred, check the README)

### Prompt to paste into your agent

```text
Run `npx skills add enroute-sh/enroute` in <project-dir>, then follow docs/build/README.md from the enroute-sh/enroute repository to build a code-hosting app. Expected output: a local app that shows code and diffs from a repository pushed to http://127.0.0.1:8080. Verify by pushing a test branch and confirming it appears in the app.
```

### Caveat

The README describes the build guide as a chapter-by-chapter path, but it does not promise a finished product, so expect to write the app code yourself.

Risk, remote script: The npx command installs skills from the enroute-sh/enroute repository into your coding agent, so review what the agent will run.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/enroute-sh-enroute/build-code-hosting-app-with-agent/

## How to block force pushes to main with a pre-receive hook with Enroute

Repo: [enroute-sh/enroute](https://github.com/enroute-sh/enroute) | Difficulty: Advanced | Time: 60 minutes | Basis: From the README

Write a pre-receive hook that rejects ref updates which would overwrite main.

**Who it is for:** A team lead who hosts code on Enroute and needs to stop anyone from rewriting the main branch.

**The problem:** Force pushes to main can erase commits, and most Git setups do not stop them without extra tooling.

**The outcome:** A pre-receive hook that refuses non-fast-forward updates to main and lets other branches through.

### Steps

1. Read the pre-receive section in docs/reference/hooks.md to see the payload of each call.
2. Write a pre-receive handler in your app that rejects updates to refs/heads/main that are not fast-forward.
3. Enable the pre-receive hook in your deployment using the hook setup described in docs/README.md. (inferred, check the README)
4. Force push a test branch to main with `git push --force http://127.0.0.1:8080/hello.git main` and confirm the push is rejected. (inferred, check the README)

### Prompt to paste into your agent

```text
In the enroute-sh/enroute repository, read docs/reference/hooks.md and write a pre-receive hook in <app-dir> that rejects non-fast-forward updates to main. Expected output: a hook handler that returns a rejection for those updates. Verify by force pushing a test commit to main and confirming it is rejected.
```

### Caveat

The README does not show the exact configuration to enable a hook, so check docs/operate/ and docs/reference/hooks.md before relying on this step.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/enroute-sh-enroute/block-force-pushes-to-main/

## How to trigger a deploy or mirror after each successful push with Enroute

Repo: [enroute-sh/enroute](https://github.com/enroute-sh/enroute) | Difficulty: Advanced | Time: 60 minutes | Basis: From the README

Use a post-receive hook to start CI, deploy code or mirror a repo after a push lands.

**Who it is for:** A developer who wants every successful push to kick off a build, a deploy or a copy to another repository.

**The problem:** Wiring Git pushes to CI or deployment often means polling or extra services that have to be kept in sync.

**The outcome:** A post-receive handler that runs your chosen action each time a push succeeds.

### Steps

1. Read the post-receive section in docs/reference/hooks.md for the payload it receives.
2. Write a post-receive handler in your app that starts your CI run, deploy script or mirror job.
3. Enable the post-receive hook following the setup in docs/README.md. (inferred, check the README)
4. Push a commit with `git push http://127.0.0.1:8080/hello.git main` and check that your action ran. (inferred, check the README)

### Prompt to paste into your agent

```text
In the enroute-sh/enroute repository, read docs/reference/hooks.md and write a post-receive handler in <app-dir> that starts a deploy script for <repo-name>. Expected output: the handler runs after a successful push. Verify by pushing a commit to main and checking the deploy script log.
```

### Caveat

The README lists post-receive as a hook for running CI, deploys or mirroring, but it does not describe the deploy or mirror tooling, so you supply that yourself.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/enroute-sh-enroute/trigger-deploy-after-push/
