Freestyle Git - Git Filesystems for AI Agents

Git Filesystems for AI Agents

The best way to handle an agent's filesystem: real Git repos with branches, diffs, rollback, and review.

The agent filesystem should be Git

Freestyle Git is a multi-tenant, API-first Git platform for agent filesystems. Agents get normal files; your product gets commits, branches, diffs, rollback, review, and automation.

Git as an API for agent filesystems

Provision filesystem state, manage access, and commit agent changes from your backend in seconds.

Create repositories

Provision a repository for each project in one API call.

freestyle.git.repos.create()

Import existing code

Bring in code from Git URLs, tarballs, or raw files.

import: { ... }

Grant repo access

Assign read, write, and merge permissions per identity.

permissions.git.grant()

Issue scoped tokens

Mint tokens for secure clone and push operations.

identity.tokens.create()

Clone and start shipping

Clone with your issued token and push immediately.

git clone https://x-access-token:${token}@git.freestyle.sh/${repoId}
import { freestyle } from "freestyle";

// Create an empty repository
const { repo: emptyRepo, repoId } = await freestyle.git.repos.create();

// Or fork from an existing source
const { repo: forkedRepo } = await freestyle.git.repos.create({
  source: { url: "https://github.com/user/repo.git" }
});

// Or import files directly (no git history)
const { repo: importedRepo } = await freestyle.git.repos.create({
  import: {
    type: "git",
    url: "https://github.com/user/repo.git",
    commitMessage: "Initial import"
  }
});

// Create an identity with write access
const { identity } = await freestyle.identities.create();
await identity.permissions.git.grant({
  repoId,
  permission: "write"
});

// Generate a token for cloning
const { token } = await identity.tokens.create();
console.log(`git clone https://x-access-token:${token}@git.freestyle.sh/${repoId}`);

Operate on the filesystem through Git

Explore repos, file contents, diffs, and raw Git objects.

Repositories in seconds

Create repos, branch per task, and automate on push.

Fork from GitHub

const { repo } = await freestyle.git.repos.create({
  source: {
    url: "https://github.com/user/repo.git"
  }
})

Branch per task

repo.branches.create("feature-auth")

Deploy on push

repo.triggers.create({
  trigger: {
    event: "push",
    branches: ["main"]
  },
  action: { ... }
})

Read agent filesystems serverlessly

Inspect files, compare branches, and export archives — no checkout needed.

Read any file

repo.contents.get({
  path: "src/index.ts",
  rev: "main"
})

Compare branches

repo.compare({
  base: "main",
  head: "feature"
})

Download as archive

repo.contents.downloadTarball({ rev: "main" })

Create a commit

const { commit } = await repo.commits.create({
  message: "Add new feature",
  branch: "main",
  files: [
    { path: "README.md", content: "# My Project" },
    { path: "src/index.ts", content: "console.log('Hello!');" }
  ],
  author: { name: "John Doe", email: "john@example.com" }
})

Plumbing-level access

Traverse trees, read blobs, and inspect commits by SHA.

Walk a tree

repo.git.trees.get({ sha: "a1b2c3" })

Read a blob

repo.git.blobs.get({ hash: "d4e5f6" })

Inspect a commit

repo.git.commits.get({ hash: "f7a8b9" })

Batteries included

Integrates with the workflows around your agent filesystem.

Granular Webhooks

Configure granular webhooks per repo. Filter by branch, path, or event type.

git pushci.internal/webhook✓hooks.slack.com/trigger✓freestyle deploy✓

Sync with GitHub

Bidirectional sync between Freestyle and GitHub repos.

Clone into VMs

Clone a Freestyle Git repo into a VM so agents can work with normal files, branches, and commits.

$ git push freestyle main

Frequently Asked Questions

Why use Git for an agent filesystem?

Can agents still use normal filesystem tools?

How is Freestyle Git different from GitHub for agents?

Start building with Freestyle Git

Create your first repository in seconds. No credit card required.