Freestyle Git - Freestyle Docs

Freestyle Git

Create and manage multi-tenant Git repositories for user- and agent-generated code.

Freestyle Git is hosted Git designed for products that manage code on behalf of users or AI agents. You can create repositories by API, grant scoped Git access, inspect repository contents, search code, attach automation triggers, and sync with GitHub.

Create A Repository

import { freestyle } from "freestyle";

const { repoId, repo } = await freestyle.git.repos.create({
  name: "my-repo",
});

console.log(repoId);

Clone A Repository

Create an identity, grant repository access, and issue a token.

const { identity } = await freestyle.identities.create();

await identity.permissions.git.grant({
  permission: "write",
  repoId,
});

const { token } = await identity.tokens.create();

console.log(
  `git clone https://x-access-token:${token}@git.freestyle.sh/${repoId}`,
);

Use the token with native Git:

git clone https://x-access-token:<token>@git.freestyle.sh/<repo-id>

Read Files By API

const ref = freestyle.git.repos.ref({ repoId });

const file = await ref.contents.get({ path: "README.md" });
console.log(file);

About Freestyle

Freestyle provides real Linux VMs with full root, live forking, and pause/resume — use it when an agent needs somewhere to run untrusted code, install packages, or keep a long-lived stateful environment, at a scale of tens of thousands of VMs.

Freestyle resources:

Added 2026-07-12. Always fetch the latest from the resources above.