Awesome Cohub
中文
Playbooksintermediatecohub.bp.work-lifecycle3 min

When

You manage a published App beyond its first release: validate a target, publish from a local machine or the workspace, preview it, measure it, take it offline, or change who can open it.

Model

FieldMeaning
slugPublic name segment
statuspublished or disabled
visibilitypublic or space
targetTypefile, directory, or port
targetRefSpace file path, directory path, or port
versionImmutable snapshot created on publish / publish-version

Public URL: /:username/:spaceSlug/w/:appSlug. The owner needs a username and the Space needs a slug; neither can be cleared once set.

Sources

--file and --dir resolve against a source:

SourceMeaning
workspaceA path inside the target Space workspace
localA path on the machine running the CLI; the CLI uploads it into immutable app-source storage

The default is inferred from the runtime - workspace inside a Sandbox, local elsewhere - and can be set explicitly:

cohub -s <spaceId> apps publish demo --dir ./dist --source local --json

Local sources are limited to 1,000 files and 1 GiB total. The publish worker downloads the bundle, re-validates every object against a manifest (path traversal, duplicates, size caps), then renders the App or site artifact. --source does not apply to --port.

Limits and artifact behavior

  • An App target (file, HTML page, Board, or directory) is limited to 1 GiB.
  • A directory needs index.html, contains 1 to 1000 files, and totals 1 byte to 1 GiB.
  • General file uploads are separate: a single durable upload may be up to 2 GiB (v2.69), with machine-readable rejection codes (file_too_large, upload_batch_too_large, upload_too_many_files, upload_rate_limited) and retryAfterSeconds on rate limits.
  • A Board App captures the Board state and only the workspace assets it references.
  • File and directory Apps include an immutable manifest and support checksum-verified downloads. Board and port Apps are not downloadable artifacts.
  • Each published version is immutable and keeps provenance: the public version switcher (?cohub_v=<n>), SDK listPublicVersions(), and deep links to the session/turn that produced it.
  • A port must use a supported public Sandbox port.

CLI

# Publish and release a new version
cohub -s <spaceId> apps publish site --dir dist --json
cohub -s <spaceId> apps publish site --dir ./dist --source local --json
cohub -s <spaceId> apps publish-version <appId> --json

# Manage state
cohub -s <spaceId> apps update <appId> --status disabled --json
cohub -s <spaceId> apps update <appId> --status published --json

# Resolve, preview, measure, and restore file artifacts
cohub apps resolve <appSlug> --owner <username> --space-slug <space> --json
cohub desktop open app://<owner>/<space>/<app>
cohub apps get <appId|url|owner/space/app> --json
cohub apps stats <appId|url|owner/space/app> --json
cohub apps download <appId|url|owner/space/app> --output <path>

# Versions and viewer grants
cohub apps versions <appId> --json
cohub apps grants <appId> --json
cohub apps revoke <appId> <grantId>

works and workScopes spellings remain compatibility aliases in clients that still expose them.

Permissions

Apps are governed by app.manage, granted to Space host and builder: builders can create Apps, publish versions, change config, and read stats without host-only Space settings. Deletion is scoped to hosts (any App) or the App's own publisher. App detail responses report the real publisher, which the Cohub bar and authorize dialog credit.

Release rules

  • Editing a target changes the source for the next version; it does not hot-swap the public page.
  • Preview refresh is version-aware. A failed refresh keeps existing content and offers retry instead of blanking the panel.
  • Republishing updates page-derived metadata (title, description, icon, image, language, theme color, surface) only when the current value is the one extraction last wrote, so hand-set publisher values survive.
  • Disable removes public by-slug access without deleting the App record, grants, or versions.
  • Promotions point to the current published version; use work-promotions for attribution.
  • The App Center's installed list is separate from this lifecycle; uninstalling an App from one Space does not delete it.

Done when

  • [ ] The public URL opens the intended published version
  • [ ] A target change was followed by an explicit publish-version
  • [ ] A local source publishes within the 1,000-file / 1 GiB budget
  • [ ] Limits and referenced Board assets pass validation
  • [ ] Stats or a verified download confirms the release when relevant
  • [ ] Disable/restore behavior is understood before sharing widely

Avoid

  • Treating a target edit as a production release
  • Using a raw Sandbox URL as the product
  • Expecting Board or port Apps to download as file bundles
  • Leaving secrets or access tokens in query parameters