This guide explains how to try out git-cms without any risk to your local Git setup or existing repositories.
# One-time setup
git clone https://github.com/flyingrobots/git-cms.git
cd git-cms
npm run setup
# Then use any of these:
npm run demo # Automated demo
npm run quickstart # Interactive menu
npm run dev # Start serverEverything runs in Docker. Your host system is safe.
Only this repository is required:
~/git/
└── git-cms/ ← This repository
cd ~/git # Or wherever you want to keep these
# Clone git-cms
git clone https://github.com/flyingrobots/git-cms.git
cd git-cms
# Run setup (checks Docker prerequisites)
npm run setupWhat npm run setup does:
- Checks Docker is installed and running
- Verifies Docker Compose is available
- Confirms the npm-package dependency model (no sibling repo required)
After setup, your structure will be:
~/git/
└── git-cms/ ← You are here
- macOS: Docker Desktop
- Linux: Docker Engine
- Windows: Docker Desktop
Verify Docker is working:
docker --version
docker compose version✅ Your host Git repositories - Never touched ✅ Your Git global config - Never modified ✅ Your filesystem - Only the git-cms directory is mounted (read-only for git operations) ✅ Your Git history - Tests run in isolated containers
- Separate Filesystem: The container has its own isolated filesystem
- Separate Git Config: Container sets its own
user.nameanduser.email - Temporary Repos: Tests create repos in
/tmpinside the container - Easy Cleanup:
docker compose down -vdestroys everything
cd git-cms
./scripts/quickstart.shWhat it does:
- Checks Docker prerequisites
- Provides a menu with options:
- Start the HTTP server
- Run tests
- Open a shell
- View logs
- Clean up
Safe because: Everything runs in Docker containers that are destroyed after use.
cd git-cms
./scripts/demo.shWhat it does:
- Creates a demo article
- Shows how Git stores the data
- Demonstrates publishing
- Shows version history
- Explains the "empty tree" trick
Safe because: Runs entirely in a Docker container with a temporary Git repo.
cd git-cms
npm run dev
# OR
docker compose up appOpen your browser to: http://localhost:4638
What it does:
- Starts Node.js HTTP server in Docker
- Serves the admin UI
- Creates a Git repo inside the container at
/app/.git
Safe because:
- Repository is inside the container, not on your host
- Stopping the container (
Ctrl+Cordocker compose down) stops all Git operations - No risk to your local repositories
To clean up:
docker compose down -v # Removes container and volumescd git-cms
docker compose run --rm app sh
# Now you're in the container
node bin/git-cms.js draft hello-world "My First Post"
node bin/git-cms.js list
node bin/git-cms.js publish hello-world
# Explore what Git sees
git log --all --oneline --graph
git for-each-ref refs/_blog/
exitSafe because: You're running commands inside the container, which has its own isolated Git environment.
cd git-cms
npm test
# OR
./test/run-docker.sh
# OR
docker compose run --rm testWhat it does:
- Runs Vitest integration tests
- Creates temporary Git repos in
/tmp - Tests CRUD operations, encryption, API endpoints
- Cleans up after completion
Safe because: All tests run in an isolated Docker container with temporary repos.
If you understand what git-cms does and want host CLI access:
# From source (recommended until npm publish is complete):
cd git-cms
npm link
# After publish, global install will work:
# npm install -g git-cms# Create a fresh repo for testing
mkdir ~/git-cms-playground
cd ~/git-cms-playground
git init
# Configure
git config user.name "Your Name"
git config user.email "you@example.com"
# Now safe to use
echo "# Test" | git cms draft test-post "Test Post"NEVER run git cms commands in:
- Your active project repositories
- Repositories with uncommitted work
- Any repository you care about until you understand what's happening
Reality: If you use Docker (as recommended), git-cms never touches your host Git installation. It runs in a container with its own Git binary, config, and repositories.
Reality: Tests run in Docker containers with temporary directories. When the container stops, everything is cleaned up automatically.
Reality: The CLI checks what directory you're in. If you're in a repo with important files, you'll notice. Plus, git-cms operates in the refs/_blog/* namespace, separate from your normal branches.
IF you run npm run test:local (bypassing Docker), tests WILL create temporary repos in your /tmp directory. While these are deleted after, there's a non-zero risk if tests fail mid-execution.
Solution: Always use npm test which automatically uses Docker.
# Stop containers
cd git-cms
docker compose down
# Remove containers AND volumes (fresh start)
docker compose down -v
# Remove images (if you want to reclaim disk space)
docker rmi $(docker images | grep git-cms | awk '{print $3}')npm uninstall -g git-cms
# OR
cd git-cms && npm unlinkCause: npm dependencies were not installed correctly, or lockfile integrity regressed.
Solution:
# Validate lockfile/package integrity
npm run check:deps
# Reinstall dependencies cleanly (host)
rm -rf node_modules
npm ci
# If you're troubleshooting inside Docker, reinstall there too:
# docker compose run --rm app sh -c "npm ci"
# Last resort (only when lockfile/base image changed): rebuild images
docker compose build --no-cacheSolution: Either stop the process using that port, or change the port in docker-compose.yml:
ports:
- "5000:4638" # Maps localhost:5000 → container:4638Solution: Start Docker Desktop (macOS/Windows) or start the Docker service (Linux):
# Linux
sudo systemctl start dockerCause: Docker doesn't have permission to bind volumes.
Solution:
- On macOS/Windows: Check Docker Desktop → Settings → Resources → File Sharing
- On Linux: Ensure your user is in the
dockergroup
Once you're comfortable with the basics:
-
Read the Architecture Decision Record:
docs/ADR.md- Comprehensive technical documentation
- Design decisions and tradeoffs
- Full system architecture
-
Explore the Code:
src/lib/CmsService.js- See how the Lego Blocks are composed
- Understand the domain orchestration
- Study the Git plumbing operations
-
Set Up Stargate Gateway:
./scripts/bootstrap-stargate.sh- Enforces fast-forward only
- Verifies GPG signatures
- Mirrors to public repositories
-
Experiment with Encryption: See
docs/GETTING_STARTED.md- Client-side AES-256-GCM encryption
- OS keychain integration
- Row-level access control
Git CMS is a learning project and thought experiment. It's designed to teach you:
- How Git's plumbing actually works
- Content-addressable storage patterns
- Building unconventional systems from first principles
Use it to learn, experiment, and explore. Don't use it in production unless you really understand what you're getting into.
Have fun! 🎉