1. Sign up and create a private key
- Create an account at code.storage.
- Create a new Organization if needed (e.g.,
your-org) - Create a key on the organization’s Keys page.
- Store the private key and set these environment variables. Replace
your-orgwith your organization name:
2. Install the SDK
Install the SDK for your language:@pierre/sdk for TypeScript, pierre-sdk for Python, or the Go
module github.com/pierrecomputer/sdk/go.
3. Initialize the client
new Pierre() in TypeScript, Pierre() in Python, and pierre.NewClient() in Go read the same
environment variables:
PIERRE_ORG: your organization name.PIERRE_PRIVATE_KEY: your private key in PEM form. You can setPIERRE_PRIVATE_KEY_FILEto the path of the key file instead.PIERRE_TOKEN: a fixed token. When it is set, the client sends it in place of a token that it signs with your key.PIERRE_API_BASE_URLandPIERRE_GIT_HOST: other hosts in place ofhttps://api.{org}.code.storageand{org}.code.storage.
PIERRE_TOKEN
unset for this guide, because step 4 signs a token for a Git remote URL, and a fixed token cannot do
that. The Python examples use Pierre, the blocking client. AsyncPierre has the same methods for
asyncio code.
The code of steps 3 to 7 runs as one program, in page order. In TypeScript, put it in one ES module
file: set "type": "module" in your package.json, or use a .mts file. See
the SDK page for the client options.
4. Create a repository
Each repository belongs to your organization and has a unique name. Code Storage can generate a UUID, or you can supply a name such asteam/project-alpha. A new repository uses main as its
default branch, but it has no branch until its first commit. Step 5 creates main. A synced
repository takes the default branch of its upstream.
upstream. See
GitHub Sync and Generic Sync.
5. Create a commit
Write files and commit them torepo without a local clone.
6. Read repository data
Read files, list commits, and stream file content fromrepo.
7. Apply a diff
Commit a unified diff torepo without a local clone.