A workspace is like a working directory that lives on the Oxen server. You canDocumentation Index
Fetch the complete documentation index at: https://docs.oxen.ai/llms.txt
Use this file to discover all available pages before exploring further.
add, rm, and modify files in a workspace and then commit those changes in bulk, without ever cloning the repository to your local machine.
Under the hood, every workspace is pinned to a specific commit on a branch. All staged changes are computed relative to that commit. Staged changes survive server restarts, but they are not part of the repositoryβs commit history until you commit the workspace, so they can be deleted without leaving a trace.
Why use a workspace?
Reach for a workspace when you want to:- Edit a repository thatβs too large to clone. Stage changes to a 100GB+ repo without copying it to your machine.
- Bulk-import data without keeping a local copy.
oxen workspace adduploads directly to the server, so you donβt pay the disk cost of writing every file into a local.oxenstore first. - Batch many changes into a single commit. Add, remove, and modify dozens of files server-side, then land them as one atomic commit.
- Let multiple clients contribute to one staged commit. A named workspace can be written to by several processes or users before anyone commits β useful for workflows like labeling UIs, ingestion services, or agents producing training data.
- Keep a long-lived staging area across multiple commits. Named workspaces persist after commit and fast-forward to the new commit, so the same workspace can be reused over and over.
add β commit β push flow, you donβt need a workspace β see the Version Control guide instead.
Quick start
Add to an existing repo without cloning it
Imagine a repository with 1 million images. Instead of cloning the data, init an empty local repo, point it at the remote, and write directly to a workspace.Bulk-import data into a fresh repo
oxen workspace add never writes data to your local machine β files stream directly to the remote. This avoids the disk and time cost of add β commit β push, which would otherwise copy every file into a local .oxen store first.
How it works
Every workspace references a specific commit, the same way a branch does. All your staged operations are recorded as a diff against that base commit. When you commit a workspace:- Oxen applies your staged diff on top of the workspaceβs base commit to produce a new commit.
- That new commit is added to a target branch on the remote (see Committing changes for how the target is chosen).
- If the target branch has advanced past the workspaceβs base commit, Oxen attempts to merge. Conflicts cause the commit to fail and youβll need to resolve them before retrying.
Creating a workspace
A workspace is created against a remote repository, and optionally against a specific branch.main) is used.
Named vs. unnamed workspaces
Every workspace has an auto-generated id. You can optionally also give it a human-readable name.| Unnamed workspace | Named workspace | |
|---|---|---|
| Lifetime after commit | Deleted | Persists, fast-forwarded to the new commit |
| Best for | One-shot imports, throwaway staging | Long-lived staging, multi-commit or multi-client workflows |
Identifying a workspace in CLI commands
Most workspace commands need to know which workspace youβre targeting. You can reference a workspace by either its id or its name:--workspace-id <id>(short:-w) β reference by the auto-generated id returned fromoxen workspace create.--workspace-name <name>(short:-n) β reference by the name you set with--nameat create time.
Listing workspaces
List the workspaces on a remote withoxen workspace list.
Adding files
oxen workspace add streams a fileβs contents directly to the server and stages it on the workspace.
Unstaging a file
To remove a file youβve staged on the workspace (without touching the base repo), unstage it withoxen workspace rm --staged.
CLI
Deleting a file from the base repo
Committing changes
Commit a workspace to land its staged changes as a new commit on the remote.- An unnamed workspace is deleted.
- A named workspace is fast-forwarded to point at the new commit, so you can keep using it.