Learn
Quick start
Create a Space, run an Agent Chat, inspect files, take a forkable Save checkpoint, and publish an App via Web or CLI.
This guide walks through one end-to-end Cohub workflow: sign in, create a Space, run a Chat that edits workspace files, take a Save checkpoint, and publish an App.
1. Sign in
- Web: Open cohub.live and sign in. Existing accounts return to recent work.
- CLI: Authenticate with Logto device authorization and verify your session:
cohub auth login
cohub auth whoami
2. Create a Space
- Web: Open
/spaces/new(New Space).- Enter a Name (required). Optionally set a Slug (1–80 lowercase ASCII letters, digits, hyphens, or underscores, starting and ending with a letter or digit) and Description.
- Under Bootstrap Source, keep Blank selected, or choose Git Repo (repository URL, optional branch/tag/commit ref, optional access token) or Save (a Save UUID to fork an independent Space).
- On a supported desktop device, Location lets you choose Cloud or This device with a local folder.
- Click Create Space. Sandbox provisioning and content bootstrap run independently, and Cohub opens the new Space.
- CLI:
cohub spaces create --name "demo-space" --json
cohub spaces ls
3. Run a Chat
- Web: In the new Space, start a Chat, select a model if needed, and give the Agent a concrete task in
/workspace, for example:
Create a minimal static site in index.html and explain the file layout.
- CLI: Send a prompt with the top-level
cohub promptcommand and wait for the reply:
cohub -s <space> prompt "Create a minimal static site in index.html and explain the file layout." --wait
Use --stream instead of --wait to stream assistant output, and --timeout 10m to cap the wait. <space> accepts a Space ID, a slug you own (such as home), or username/slug.
4. Inspect workspace files
- Web: Keep Chat and the files tree side by side to inspect generated or edited files, upload reference assets, and preview HTML output or a running port.
- CLI: Inspect files and uncommitted changes against the last checkpoint (omitting a path targets
/workspace):
cohub -s <space> spaces files ls
cohub -s <space> spaces files cat index.html
cohub -s <space> spaces files diff
5. Create a Save (checkpoint)
A Save records an immutable workspace snapshot (called a checkpoint in the CLI and API).
- Web:
- Open New save to reach Save workspace.
- Optionally expand Review changes to inspect pending workspace diffs.
- Enter an optional Description (leaving it empty falls back to the commit hash in lists) and click Save.
- Submitting redirects to the Save task run. Once created, open the Save detail view to inspect file stats and diffs (Compare against parent or another Save), use Copy ID, or click New space to open
/spaces/new?checkpointId=<id>and fork an independent Space from that snapshot.
- CLI:
cohub -s <space> spaces checkpoints create "Initial static site"
cohub -s <space> spaces checkpoints ls
cohub -s <space> spaces checkpoints diff <checkpointId>
cohub spaces create --name "demo-fork" --checkpoint <checkpointId>
6. Publish an App
Publish output from the Space as an App with an App slug:
| Target | CLI flag | Use when |
|---|---|---|
| File | --file <path> |
Single HTML page |
| Directory | --dir <path> |
Static site directory with index.html and assets |
| Port | --port <port> |
Live app listening on a Sandbox port |
- Web: Publish an HTML file, a static site directory, or a running port from the Space, pick an App slug, and open the published URL.
- CLI:
cohub -s <space> apps publish demo --file index.html --visibility public
cohub -s <space> apps publish site --dir dist --visibility public
cohub -s <space> apps publish app --port 5173 --visibility public
Pass --source workspace or --source local to pick the source explicitly (auto-detected from Runtime by default). --visibility accepts public or space.
Boundaries and common failures
- Saves do not restore a Space in place: You can inspect files, view diffs, and fork a Save into a new Space via New space (
/spaces/new?checkpointId=<id>) orcohub spaces create --checkpoint <id>, but you cannot roll back the current Space in place. - Concurrent Saves fail with HTTP 409 (
Save in progress.): Only one Save can run at a time in a Space. Wait for the active Save task run to finish before creating another. - CLI target-Space fallback: When
-s <space>,COHUB_SPACE_ID, and a directory Runtime binding are all unset,prompt,completion,decision,generate,apps, andpublicfall back to yourhomeSpace, while other Space commands (spaces files,spaces checkpoints,run) fail until you pass a target. Pass-s <space>explicitly to avoid modifyinghomeby accident. - Space slug constraints: Slug on
/spaces/newaccepts only 1–80 lowercase ASCII letters, digits, hyphens, and underscores, and must start and end with a letter or digit. - Local folder already bound on
This device: Choosing a folder linked to a currently running Space blocks Space creation until you open the linked Space or pick another folder. If the linked Space is not running, creating a new Space rebinds that folder. - Private Git repo tokens are one-time: On
/spaces/new, the optional access token under Git Repo is used for bootstrap and is not stored.