Published tree
The shared repo state lives in the published tree. Git Slice stores that as the root slice and treats it as the default base for collaboration.
Use gs fs for direct cloud edits in your home slice. Use custom slices when you want a fast local checkout. Plain checkout now covers local status, diff, restore, sync, and publish on its own without local git metadata at all.
Start with the CLI or an agent key
go install github.com/niczy/gitslice/gs@latest
gs auth keygen --out ~/.config/gitslice/agent_ed25519
gs auth login --key ~/.config/gitslice/agent_ed25519Git Slice is a cloud versioned filesystem built for two real workflows. The first is direct remote work with gs fs. The second is focused local work through custom slices and fast checkouts. Both are slice-backed, both keep commit history, and both converge through the same publish model.
gs fs.gs slice checkout for editor-heavy work.gs changeset create and gs changeset merge.The shared repo state lives in the published tree. Git Slice stores that as the root slice and treats it as the default base for collaboration.
Each account gets a home slice. `gs fs` works there by default through absolute paths like `/$USER/project/README.md`.
Create a focused slice when the job deserves a local checkout, editor workflow, tests, and a normal git-shaped working tree.
A changeset is the explicit publish and merge unit. It is the path back into the published tree for local slice work.
File transfer is content-addressed. Uploads and checkouts exchange manifests first and only transfer blocks your machine or the server is missing.
Best when you want to change remote files immediately.
gs fs mkdir /$USER/notes
gs fs write /$USER/notes/todo.md --text "ship the patch"
gs fs cat /$USER/notes/todo.md
gs fs snapshot -m "notes update"Best when the task needs a local editor or tests. Plain checkout is the local workflow, with no separate git mode to manage.
gs slice create ui-refresh apps/web
mkdir ui-refresh && cd ui-refresh
gs slice checkout <slice-id-or-slug>
gs slice status
gs slice diffgs fs write /$USER/app/NOTICE.txt --text "hotfix shipped remotely"
gs fs cat /$USER/app/NOTICE.txt
gs fs snapshot -m "patch notice"Best for notes, tiny fixes, and direct remote edits.
gs slice list
gs slice create ui-refresh apps/web
mkdir ui-refresh && cd ui-refresh
gs slice checkout <slice-id-or-slug>
gs slice diffPlain checkout is the local workflow. Status, diff, restore, sync, and publish all work without local git metadata.
gs repo import https://github.com/org/repo.git /$USER/vendor/repo --push-enabled
gs repo pull /$USER/vendor/repo
gs repo push /$USER/vendor/repo --message "sync upstream fixes"Best when you want one directory to stay connected to an upstream repo while still using normal `gs fs` edits.
gs slice sync
gs slice publish --message "refresh settings page" --files src/routes/settings.tsx
gs changeset showUse this when you are ready to review and publish local slice work.
`gs fs` operates on your home slice using absolute paths. Every mutation produces versioned history, and large transfers are deduplicated through manifest-first block exchange instead of raw full-file reupload.
| Operation | Command |
|---|---|
| Read a remote file | gs fs cat /$USER/app/README.md |
| Write a remote file | gs fs write /$USER/app/README.md --text "hello" |
| Create a checkpoint | gs fs snapshot -m "checkpoint" |
| Inspect changes | gs fs diff <snapshot-or-commit> |
| Upload a directory tree | gs fs upload ./site /$USER/site |
| Sync a directory in one command | gs fs sync --direction push ./site /$USER/site |
| Batch several mutations | gs fs batch -f ops.jsonl |
Use gs repo when one absolute path in your home slice should track an upstream repository. Import a repo into a directory, pull future remote updates into that bound path, and optionally push your edits back upstream later.
gs repo import https://github.com/org/repo.git /$USER/vendor/repo --push-enabled
gs repo status /$USER/vendor/repo
gs repo pull /$USER/vendor/repo
gs repo push /$USER/vendor/repo --message "sync upstream fixes"
gs repo unlink /$USER/vendor/repogs repo import snapshots the remote repo into one bound directory and records the binding.gs repo pull refreshes the bound directory from upstream and records a normal home-slice commit.gs repo push exports the bound directory back to the remote repo when push is enabled.A custom slice is the local-work path. Create one around the folder or surface you care about, then check it out. Plain gs slice checkout is now the primary local path. It skips git metadata for speed, keeps a local index under .gs, and supports local status, diff, restore, sync, and publish directly. The client asks for manifests first and downloads only blocks missing from local cache, so repeat checkouts stay fast.
Use a focused name and folder scope so the slice maps cleanly to the work you plan to publish.
Git Slice reconstructs the worktree from manifests plus cached and downloaded blocks, then tracks the checkout through `.gs/index`.
Use gs slice diff and gs slice restore for local review, gs slice sync to refresh the worktree, and gs slice publish to create or update the tracked changeset.
gs slice list
gs slice create ui-refresh apps/web
mkdir ui-refresh && cd ui-refresh
gs slice checkout <slice-id-or-slug>
gs slice tree
gs slice diff
gs slice restore
gs slice sync
gs slice publish --message "refresh settings page" --files src/routes/settings.tsx
gs changeset showChangesets are the publish unit for checked-out slices. Create one from the files you changed, review it, and merge it back into the published tree. That keeps local experimentation separate from the shared state until you intentionally publish.
$EDITOR src/routes/settings.tsx
gs slice publish --message "refresh settings page" --files src/routes/settings.tsx
gs changeset show
gs changeset list --status mergedRemote `gs fs` mutations also end up on the same publish model. They create slice history immediately, and publication flows through the same merge logic instead of a separate ad hoc sync path.
Git Slice now keeps a global local registry of checked-out slices and their paths under your~/.gitslice state. That makes it possible to answer two practical questions quickly: which slices are checked out on this machine, and how much cached object data is still taking space.
See every tracked checkout path and the slice it belongs to.
gs slice checkouts
gs slice checkouts --slice home.$USERMeasure local cache usage, prune stale checkout records, or clear cached objects.
gs cache stats --checkouts
gs cache prune
gs cache clear --objectsgs slice checkouts reports how many checkouts exist globally and where they live.gs cache stats shows cached object count, cached bytes, tracked checkouts, and stale records.gs cache prune removes registry entries for deleted or invalid local worktrees.gs cache clear --objects wipes cached objects so you can reclaim disk when needed.gs doctor checks auth, current slice binding, global state, cache stats, and checkout health in one command.Human CLI use can start with the device flow. Agent workflows should use an enrolled ed25519keypair so login stays non-interactive and machine-readable.
gs auth keygen --out ~/.config/gitslice/agent_ed25519
gs auth signup --username my-agent --email my-agent@example.com --name "My Agent" --key ~/.config/gitslice/agent_ed25519
gs auth login --key ~/.config/gitslice/agent_ed25519
gs auth status --json
gs doctor --json
gs context --jsongs login to start the OAuth device flow for the CLI when a human is present.gs auth signup and gs auth login --key for non-interactive agent auth.gs auth status --json, gs doctor --json, and gs context --json expose stored auth metadata including the session and enrolled agent key ID.Use `gs fs` when the change is smaller than the setup cost of a local worktree. If you need an editor session, test loop, or lots of files, use a custom slice checkout.
A slice is a versioned tree with its own history. Your home slice is your personal default surface. Custom slices are focused branches created for a task or folder.
Yes. Uploads and checkouts exchange manifests first and then transfer only missing blocks. Repeated uploads and repeated checkouts get cheaper as cache coverage grows.
No. Remote filesystem mutations create home-slice commits, and publication now goes through the same changeset merge model used by normal slice workflows.