Build your first workspace
Look at the workspace that comes with your instance, then write, install, publish and archive one of your own. A workspace is a JSON file.
By the end of this tutorial you will have inspected the workspace that
came with your instance, written your own core.workspace.v1 document,
installed it, published it and archived it. A workspace is a single JSON
file, and installing one is a single command. There is no build step.
Allow about 10 minutes.
Prerequisites
spl serverunning locally. See the Quickstart if it isn't yet.- An identity set up with
spl init. See First run. splinstalled (spl version).
1. Look at the workspace you already have
Every instance comes with a Tasks workspace installed. List what yours serves:
spl workspace listSLUG TITLE LIFECYCLE HASH
tasks Tasks published 3f9a1c…Print its full body:
spl workspace show tasksYou will see a core.workspace.v1 record: a meta block, a
capabilities block, a regions map and a lifecycle field. That is
the entire workspace. Read the
Workspaces concept for what each part does.
2. Write your own
Create my-workspace.json:
{
"kind": "core.workspace.v1",
"schema_version": "2.0.0",
"meta": {
"slug": "my-workspace",
"title": "My Workspace",
"icon": "layout-dashboard",
"rail": true,
"shell": "workspace",
"capabilities": {
"emit": [],
"navigate": "none"
}
},
"regions": {
"header": { "srp": "0.7", "root": {} },
"body": { "srp": "0.7", "root": {} }
},
"lifecycle": "draft"
}This is a complete, valid workspace. The regions are empty for now:
each region's root is where the actual UI goes. Filling a region with
tables, forms and text is the job of a projection document, covered
in Projections and
Authoring a workspace. This
tutorial covers only the workspace document itself.
Note capabilities: an empty emit and navigate: "none" make this a
read-only surface. A workspace can only do what its capabilities block
declares, and that block cannot change without writing a new version of the workspace.
3. Install it
spl workspace install ./my-workspace.json✓ Installed workspace "my-workspace" (draft)
record: 8c2d4e…install checked the document, then saved it as a record in
your workspace catalog. If the file is malformed (a
missing meta.slug, or a region that is not a { srp, root } pair), the
install is refused and nothing is saved.
Confirm it landed:
spl workspace listYour workspace does not show up. It is a draft, and list shows
only published workspaces. Drafts are installed but not listed, which is what you want while you work on it.
4. Publish it
Edit my-workspace.json and change lifecycle to "published", then
save it again under the same slug:
spl workspace update my-workspace ./my-workspace.jsonNow spl workspace list shows it. update added a new record. Records never change, so the draft version still exists; the
catalog shows the latest record for each slug.
5. Archive it
When a workspace has served its purpose:
spl workspace archive my-workspaceThis saves the workspace again with lifecycle: "archived". It drops out
of spl workspace list, but every version is kept.
Archiving hides a workspace and does not erase it. To bring it back, update it
with lifecycle set to published again.
What you did
You inspected the starter workspace, wrote a core.workspace.v1
document, and moved it through its whole lifecycle (draft, published,
archived) using only records. No rebuild, plugin or restart.
Next steps
- Authoring a workspace: fill the
regionswith real UI. - Projections: the document format the regions are written in.
- Installing & managing workspaces: every workspace command.
- Workspaces: the concept in depth.
The Studio in five minutes
Open your workspace in the browser and use all three shapes. Read a ledger, complete a sentence to share a thread, preview it as a guest and read the address you can hand to someone.
Add a Teammate
Invite a teammate with a link, let them join in the browser, and remove their access with one command when they leave.