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. 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: 'pierre@pierre.co' },
  })
  .addFileFromString('README.md', '# Getting Started\n')
  .addFileFromString('main.ts', 'console.log("Hello from Code Storage");')
  .send();

console.log(result.commitSha);
Authentication uses ES256 or 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 isolated from your default namespace
  • 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.