Skip to main content
Code Storage is a managed Git infrastructure layer that provides repository creation, commits, branching, and merge operations through SDK and HTTP interfaces. Using distributed quorum-based storage with NVMe cache, Code Storage handles billions of repositories while keeping active data fast and inactive data in low-cost object storage. Repositories transition automatically between warm storage (accessed in the last 7 days) and cold storage based on usage patterns. This architecture delivers sub-second read/write latency for active repositories while storing inactive data at $0.05/GB/month. Warm queries average p50=120ms for initial access and p50=8ms when cached. The system achieves 60x faster clone performance than S3/R2-based Git solutions. Code Storage is focused on programmatic Git workflows for AI agents, codegen platforms, and build systems. While it exposes standard Git primitives (branches, commits, refs), it extends them with automation-focused features like ephemeral branches and direct file writes. See Quickstart to create your first repository.

Setup

import { GitStorage } from '@pierre/storage';

const store = new GitStorage({
  name: 'your-org',
  key: env.privateKey,
});

const repo = await store.createRepo({ id: 'new-workspace' });

const result = await repo
  .createCommit({
    targetBranch: 'main',
    commitMessage: 'Get Started with Code Storage',
    author: { name: 'Pierre', email: '[email protected]' },
  })
  .addFileFromString('README.md', '# Getting Started\n')
  .addFileFromString('main.ts', 'console.log("Hello from Code Storage");')
  .send();

console.log(result.commitSha);
Authentication uses RS256 JWT tokens signed with your private key. See Authentication for key generation and token minting.

What Code Storage provides

Every repository is backed by real Git storage with standard semantics:
  • Branches and refs – create, delete, and list branches; fast-forward and force-push operations
  • Commits – write files, read tree state, traverse commit history
  • Git protocol – clone, push, and fetch over HTTPS using standard Git clients
  • Webhooks – subscribe to push events for CI integration
  • GitHub sync – bidirectional sync with GitHub repositories
Extended features for automation:
  • Ephemeral branches – temporary branches that auto-delete after inactivity
  • Direct writes – create commits without local Git operations
  • Warm/cold tiering – automatic cost optimization based on access patterns

Where to go next

  • Getting Started – Create your first repository and commit
  • Core Concepts – Repositories, authentication, and permissions
  • Guides – Using Git commands, ephemeral branches, webhooks, and integrations
  • Reference – Complete SDK and HTTP API documentation
For technical details on architecture, consistency guarantees, and performance tradeoffs, see the HTTP API Overview.