Cohub
中文Start a Space

How to publish a running app from an AI sandbox as a live link

To publish a running app from an AI sandbox in Cohub, run one CLI command, or use the Publish dialog, to point an App at the port your dev server listens on; static output can go out as a folder or a single HTML file instead.

Who
Anyone who had an AI agent build a game, demo or tool and now needs other people to open it.
When
The preview works in your Space and the next message would be "here's a screenshot".
Why
Cohub publishes the Space's file, folder or running port as an App with its own URL and versions, so people get the working thing.
The Whale Shrine, a published Cohub App whose summon form asks for a payment to unlock each echo
Source: cohub.live/tzwm/cohub/w/whale-shrine

When an agent finishes a working demo, tool, or small game inside your Cohub Space, you can publish it straight from that Space as an App with its own URL and version history instead of sending screenshots. Before running cohub apps publish, answer one question: does the visitor need the process itself, or only the built files?

Port, folder or one file

Your choice comes down to whether the app needs live server code at request time:

  • Port: choose this when visitors talk to a running backend—an API, a websocket game server, or server-side rendering.
  • Folder: choose this when the project compiles to static assets such as a single-page app, a documentation site, or a multi-page static export.
  • Single file: choose this when the whole result fits in one self-contained HTML file, such as a standalone chart or mini-game.

Whenever the project can build to static files, publish static output rather than a port so the link keeps working even after the Space's sandbox idles down.

Publishing a port

A port App routes visitors directly to the process listening inside the Space's ai agent sandbox. Because cohub is already installed in that sandbox, the same agent that wrote the server can publish it when you ask in Chat (for example, to publish the dev server on port 5173 as an App named game):

cohub -s <space> apps publish game --port 5173

Because a port App serves a live process, the link works only while that process stays running. Match the Space's idle and auto-destroy policy to how long the server needs to stay reachable.

Publishing a folder

For multi-file static sites, build the project first and publish the output directory. You can publish from the CLI or open the More actions menu on a folder in the Files panel and select Publish:

The Publish app dialog opened on the folder atlas/site: public URL /northwind/northwind-atlas/w/atlas, App slug atlas, source directory, access and what the App can do

The Northwind Atlas site shown below is published as a directory App from /workspace with one command:

cohub -s <space> apps publish atlas --dir atlas/site --source workspace

Its map view, station list, and individual station pages live together in atlas/site, and publishing freezes that version so visitors load the published files under the Cohub top bar even while the sandbox sleeps.

The published App at its public URL: the Cohub bar on top shows the Space, the App title Field atlas and the publisher; below it, the Northwind Atlas map page with 12 stations and October highlights

If your published app includes a 3D scene, see pixijs 3d model for how a shared PixiJS renderer compares with a separate 3D viewer.

Publishing a single file

When an agent outputs one self-contained HTML page—a chart, calculator, or single-file game—you do not need a build directory or a running dev server. Open More actions on that file in the Files panel and click Publish, or publish that single file through cohub apps publish.

Like a directory App, a single-file App serves the published version directly without keeping a sandbox process alive.

Before sharing the URL, open it in a signed-out browser window to confirm that visitors see the live App as expected and that relative assets load cleanly. If the App is only meant for teammates inside the Space, pass --visibility space when publishing from the CLI, and remember you can disable an App at any time.

Reference in the docs

This page: Whether an app your agent built should go out as a port, a folder or a single file.

  • Apps: publish steps, target limits, versions and custom domains
  • Files & Sandbox: ports, previews and sandbox hibernation

FAQ

Does a port App stay up when the sandbox sleeps?

A port App serves the process running in the Space's sandbox. Set the Space's auto-destroy policy to fit how long the server must stay reachable, or publish static output as a directory App.

Can I publish privately?

Yes. The CLI accepts --visibility space, which limits the App to the Space, and Apps can be disabled at any time.

Sources

Published · Updated