Grain / Works with / Grain for Codex

Works with

Grain for Codex

Codex works with Grain as the coding agent you already use. Download the desktop app, run grain setup --codex and grain init, let Codex build in the connected folder, then push, checkpoint and share the output at a lasting URL.

Updated 2026-09-04Facts verified 2026-09-04By the Grain team
# Download the desktop app from rungrain.com, then:
grain setup --codex
cd path/to/project
grain init
# Ask Codex to build the artifact in this folder.
grain push
grain checkpoint -m "first Codex artifact"
grain share --public
# https://<slug>.share.rungrain.com

What the agent does, what Grain does

ResponsibilityCodexGrain
CreationReads instructions and changes the projectDoes not create code or choose a model
WorkspaceOperates in the folder you give itLinks that folder to a workspace that can remain published
PublishingCan invoke connected tools or leave commands for youPushes files, records checkpoints and creates shares
AddressCan verify the output during its workProvides the share URL for other people
Application piecesWrites the page and application behaviorCan provide Postgres, login and scheduled jobs for an app artifact
ReviewResponds to your instructionsCollects reader comments that the agent can read and act on
PortabilityWorks against files in the projectLets you fetch artifact files with grain pull

Setup

  1. Download and open the desktop app from rungrain.com. Complete the early-access and sign-in flow before connecting a project folder.
  2. Run grain setup --codex in a terminal. It signs you in through your browser and installs the Grain plugin, which gives Codex the MCP tools in every project. Then change into the folder where Codex will work. Starting from the actual project directory avoids linking a parent folder that contains unrelated files.
  3. Run grain init to link the folder to a workspace. It updates .codex/config.toml only when the project already has one; in a new project it writes .mcp.json, which Codex does not read. The plugin from the previous step is what connects Codex, so check it with codex plugin list if Codex does not see the server.
  4. Open Codex on the same folder. State the artifact, intended audience, required source material and acceptance checks in the prompt. Also state whether it is a static page or an app that needs Postgres, login or a scheduled job.
  5. Let Codex use the MCP connection for supported workspace actions, or run the CLI commands yourself. Grain exposes agent tools for creating, opening, pushing, pulling, checkpointing, sharing, releasing, checking out, listing, executing and upgrading workspaces.

First artifact

  1. Give Codex a usable prompt: Build a small internal rota tool for this team. Include a weekly view, an owner for each shift, a change log and a short operator note. Use Postgres for rota entries, require login, and do not add a scheduled job. The pieces are explicit, so the agent does not have to guess the product boundary.
  2. Ask Codex to inspect its output, run the relevant project checks and identify any values that should come from secrets rather than source files. Remove sample credentials and local-only paths before publishing.
  3. Run grain push when the folder contains the reviewable result. Record that state with grain checkpoint -m "first Codex artifact". A named checkpoint makes the publishing sequence legible without claiming that source control has been replaced.
  4. Choose the audience. Run grain share --public for an open link or grain share --password <pw> for a password-protected link. Use invited-person sharing for a named audience.
  5. Open the returned https://<slug>.share.rungrain.com URL as the intended reader. Verify access, core interactions and database behavior. If the artifact has a scheduled job, check its visible result instead of assuming that a local run proves the schedule.
  6. Put the URL in the ticket, pull request or team note where people already work. Their comments can become the next Codex instructions, while the workspace and address stay the same across revisions.

What you pay

You keep the OpenAI plan you already use for Codex. Grain does not sell or mark up model tokens. The Grain free tier requires no card and includes unlimited published artifacts, ten sleeping sandboxes, one always-on workspace, the desktop app, CLI and open source code under AGPL-3.0. Pro costs $65 per user per month for more always-on workspaces, team seats, shared spaces and custom domains. Enterprise is offered by contact for the customer's cloud, SSO, audit and policy controls and direct support. The relevant cost question is whether you need paid workspace capabilities, not whether Grain changes the Codex bill.

Limits and known gaps

  • Grain supplies no model and no coding agent. Codex remains responsible for code changes, and you remain responsible for reviewing them.
  • Grain is not an editor. Continue using the development and review tools that fit your repository.
  • The plugin installs into your Codex user configuration. If organization policy manages Codex plugins or .codex/config.toml, review the change first.
  • Publishing does not turn an internal prototype into a production service with a CI pipeline. Grain points production services with those requirements to general deployment platforms. Keep repository review, tests and operational ownership in their existing systems.
  • Public, password-protected and invited-person shares have different exposure. Select the boundary deliberately and test it outside your own session.
  • The desktop app runs on macOS, Windows and Linux. Without the desktop app, add the hosted MCP server instead. It can find, create and edit HTML artifacts and run commands in app workspaces, but it cannot create share links.

Frequently asked questions

Does Grain include Codex usage?

No. You bring your existing agent plan. Grain does not sell or mark up Codex tokens.

Where does Grain put the Codex MCP config?

grain setup --codex installs the Grain plugin into Codex for every project. grain init also updates a project .codex/config.toml when one already exists.

What is the shortest path from Codex to a URL?

Initialize the folder, let Codex write the artifact, then run push, checkpoint and share. The public share returns a https://<slug>.share.rungrain.com URL.

Can a Codex-built tool use Postgres and login?

Yes. Full app artifacts can have Postgres, logins and scheduled jobs. Use only the pieces the tool actually needs.

Can I export what Codex built?

Yes. Artifacts remain files, and grain pull fetches them from the workspace.

Can I use Grain alongside ChatGPT Space?

Yes. Use Space for pages your team writes inside ChatGPT, and Grain when Codex builds a page or app that needs its own URL, a database or readers outside ChatGPT. See Grain vs ChatGPT Space.

Give the next Codex result an address

Download the free desktop app, connect one project and publish a reviewable artifact.

Download Grain

Free forever. No card. Bring your own agent.

Sources · facts verified 2026-09-04