Build from source (Go 1.26+ required):
git clone https://github.com/dlorenc/docstore
cd docstore
make build-ds
# Produces bin/ds with the default server URL compiled inThe build bakes in the default remote URL (https://docstore.dev) via -ldflags. You can override it at build time:
DEFAULT_REMOTE=https://your-server.example.com make build-dsCopy bin/ds somewhere on your $PATH.
To run a local server, you need PostgreSQL. The easiest path is:
# Start Postgres (any method — docker, homebrew, etc.)
export DATABASE_URL="postgres://localhost/docstore?sslmode=disable"
# Run migrations and start the server with dev auth bypass (local dev only)
go run ./cmd/docstore --dev-identity you@example.com
# Or with env vars instead of flags:
DEV_IDENTITY=you@example.com DATABASE_URL=... go run ./cmd/docstoreWith --dev-identity set, the server skips OAuth JWT validation and treats every request as that identity. This is for local development only — do not set this flag in production. Production uses direct Google OAuth at https://docstore.dev.
The server listens on port 8080 by default (PORT env var overrides it).
mkdir my-project && cd my-project
ds init http://localhost:8080 --author alice@example.com --repo myorg/myrepoThis creates a .docstore/ directory with config.json (remote URL, repo path, author) and state.json (current branch, head sequence, file hashes).
If you compiled ds with the default remote URL, the URL argument is optional:
ds init --repo myorg/myrepods checkout -b feature/helloecho "Hello, DocStore!" > hello.txt
ds status # shows hello.txt as new
ds commit -m "add hello.txt"ds commit uploads all changed files to the server in one atomic operation.
ds log # list commits on the current branch
ds diff # show files changed vs mainds mergeMerge is a server-side operation. If active policies require reviews or CI checks, ds merge will fail with the policy reason until the requirements are satisfied.
ds checkout main
ds pullds pull downloads the current tree from the server and writes files to disk, replacing your local copies.
| File | Purpose |
|---|---|
.docstore/config.json |
Remote URL, repo path (owner/name), default author |
.docstore/state.json |
Active branch, head sequence number, per-file content hashes |
State is used to compute ds status without a round-trip to the server. It is updated by ds pull, ds commit, and ds checkout.