Grain / Docs / Publish your first artifact

Docs

Publish your first artifact

Your first Grain artifact goes from a local folder to a lasting share URL in five commands. Sign in, initialize the folder, push its files, record a checkpoint and choose a sharing mode.

Updated 2026-09-04By the Grain team

Before you start

Download the Mac app from rungrain.com. Put the page or app you want to publish in its own folder. A static first artifact can be as small as an index.html file.

The complete first publish

grain login
cd path/to/artifact
grain init
grain push
grain checkpoint -m "first publish"
grain share --public
  1. grain login hands sign-in to the Mac app and stores revocable CLI authentication. It prints the path where the token was saved. Unknown login option: <option> means the command received an unsupported argument.
  2. grain init creates and links a workspace for the current folder. It writes or updates .mcp.json for Claude Code, .codex/config.toml for Codex and .cursor/mcp.json for Cursor when those recognized files exist; when none exists it creates .mcp.json. For the static example in this guide, output begins Created static workspace <id>; uploading managed content. An app-runtime workspace instead prints that it linked the folder to the new workspace. Common failures include Not a directory: <path> and Template must be one of: html, empty, nextjs, react-vite. A separate access error explains that no organization permits workspace creation and directs the reader to an organization owner.
  3. grain push uploads completed file changes. Expected output is pushed <n> path(s). If the remote copy changed first, it reports The remote workspace changed since this folder was last synchronized. and tells you to pull, review and push again.
  4. grain checkpoint -m "first publish" records the checkout tree as a durable history revision. Expected output is checkpointed revision #<n> or checkout already matches the latest revision. A missing message produces Missing checkpoint message. Usage: grain checkpoint [-m <message>] [--dry-run].
  5. grain share --public creates or reuses a public share. Expected output includes Share: https://<slug>.share.rungrain.com and a canonical workspace URL. A bad option produces Unknown share option: <option>.

Command options used in this guide

grain login
grain init [path] [--organization <id>] [--name <name>] [--template <template>] [--folder <path>] [--keep-failed] [--no-open] [--no-agent-config] [--dry-run]
grain push [--force] [--no-reload] [--dry-run]
grain checkpoint [-m <message>] [--dry-run]
grain share [--public | --password <pw>] [--path <path>] [--name <name>] [--no-reuse] [--dry-run]
CommandFlagsWhen to use them
loginNoneSign in before creating or sharing a workspace.
init--organization, --name, --template, --folder, --keep-failed, --no-open, --no-agent-config, --dry-runSelect ownership and template, place the workspace in a folder, preserve a failed workspace, suppress opening or agent config, or preview the operation.
push--force, --no-reload, --dry-runIntentionally overwrite remote drift, avoid refreshing an open workspace, or preview changed paths.
checkpoint-m, --dry-runAdd a message or preview whether a revision would be created.
share--public, --password, --path, --name, --no-reuse, --dry-runChoose access, select a site path and name, require a new share, or preview the mutation.

Use a password instead

grain share --password <pw>

Public shares are reachable by anyone with the link. A password share requires the password. Invite-only sharing is the third available mode when access should be limited to named people.

What persists

The published artifact remains available after the terminal session ends and the laptop closes. Artifact files live in the workspace. Apps can also use Postgres, logins and scheduled jobs. Every artifact remains files you can export.

Frequently asked questions

What URL does my first Grain artifact get?

A public share uses the form https://<slug>.share.rungrain.com. The share command also returns a canonical workspace URL.

Do I need to deploy after pushing?

No separate deploy step is part of this flow. Push the files, checkpoint the state and create the share.

Can I keep the first artifact private?

Yes. Use password-protected sharing or invite named people instead of creating a public link.

What files does initialization add?

It writes recognized agent configuration in .mcp.json, .codex/config.toml or .cursor/mcp.json. Use --no-agent-config to skip that wiring.

Publish the first useful result

Download the Mac app, connect the folder and turn the artifact into a share URL.

Free forever. No card. Bring your own agent.

Sources · facts verified 2026-09-04