Skip to main content
Use the Code Storage SDK to create your first repository. Choose the TypeScript, Python, or Go example in each step. Later steps reuse the storage and repo values from the earlier steps. First create an API key and store it. See Authentication & Security. You need your organization identifier and the PIERRE_PRIVATE_KEY value from that step.

1. Install the SDK

2. Initialize the client

Replace your-org with your organization identifier. The client reads the private key from PIERRE_PRIVATE_KEY.

3. Create a repository

Each repository belongs to your organization and has a unique ID. Code Storage can generate a UUID, or you can supply an ID such as team/project-alpha. A new repository uses main as its default branch.
To sync with GitLab, Bitbucket, or another HTTPS host, pass a base repository. See GitHub Sync and Generic Sync.

4. Create a commit

Write files and commit them to repo without a local clone.

5. Read repository data

Read files, list commits, and stream file content from repo.

6. Apply a diff

Commit a unified diff to repo without a local clone.

Next steps

  • Git Operations: Use clone, fetch, push, and pull.
  • Ref Policies: Limit the refs that a token can update.
  • SDK Reference: Find methods for repositories, branches, commits, files, tags, and notes.
  • HTTP API: Use Code Storage without an SDK.