# Publish to the registry

import { Steps } from "@astrojs/starlight/components"
import Prereqs from "@docs/Prereqs.astro"
import UiWalkthrough from "@docs/UiWalkthrough.astro"
import ClientTabs from "@docs/ClientTabs.astro"

Publishing makes a resource visible on the Ren registry. Once published, anyone in your organization (or the public, depending on scope) can discover and reference it. Publishing is one-way. You can deprecate a resource, but you cannot unpublish it.

<Prereqs>
  - A Ren account with a resource (agent, skill, or MCP) you want to publish - [The CLI
  installed](/docs/developers/cli/), or a personal access token for the API and TypeScript calls
</Prereqs>

## How publishing works

When you publish, Ren:

1. Creates a publisher for your organization if one doesn't already exist.
2. Sets the resource's `publisherId`, making it discoverable on the registry.
3. Auto-publishes any dependent resources that aren't yet published (e.g. an agent's skills and MCPs).

Published resources move from **private** scope to **org** or **public** scope. See [Scopes](/docs/deep-dives/concepts/sharing/scopes/) for details.

## In the UI

<UiWalkthrough>{/* TODO(demo): screen recording: publishing an agent from the dashboard, ~8s loop */}</UiWalkthrough>

<Steps>

1. Open the resource (agent, skill, or MCP) you want to publish.

2. Click **Publish to registry**.

3. Confirm. The resource is now visible on the registry.

</Steps>

## Programmatically

<ClientTabs clients={["cli", "api", "typescript"]}>

<Fragment slot="cli">
  **Publish an agent**

```bash
ren agents publish agt_abc123
```

**Publish a skill**

```bash
ren skills publish skl_abc123
```

**Publish an MCP**

```bash
ren mcps publish mcp_abc123
```

</Fragment>

<Fragment slot="api">
  **Publish an agent**

```bash
curl -X POST "https://api.renai.build/api/agents/agt_abc123/publish" \
  -H "Authorization: Bearer $REN_PAT_TOKEN"
```

**Publish a skill**

```bash
curl -X POST "https://api.renai.build/api/skills/skl_abc123/publish" \
  -H "Authorization: Bearer $REN_PAT_TOKEN"
```

**Publish an MCP**

```bash
curl -X POST "https://api.renai.build/api/mcps/mcp_abc123/publish" \
  -H "Authorization: Bearer $REN_PAT_TOKEN"
```

</Fragment>

<Fragment slot="typescript">
  ```ts
  import { createRenClient, pat } from "@renai-labs/sdk"

const client = createRenClient({
baseUrl: "https://api.renai.build",
auth: pat(process.env.REN_PAT_TOKEN!),
})

await client.agent.publish({ path: { id: "agt_abc123" } })
await client.skill.publish({ path: { id: "skl_abc123" } })
await client.mcp.publish({ path: { id: "mcp_abc123" } })

```
</Fragment>

</ClientTabs>

Publishing is permanent. There is no unpublish. To stop showing a resource, use **Deprecate** instead, which marks it as deprecated on the registry while keeping it functional for existing references.
```