@arkforge/share-cli

v1.0.3

Published

CLI to publish TSX artifacts as public shareable links

Readme

share-cli

Publish TSX/React artifacts as public shareable links — your own self-hosted Claude Publish.

Overview

share-cli is a monorepo containing:

  • src/ — Cloudflare Worker that serves as the backend API and renderer
  • cli/ — Bun-powered CLI to publish TSX files from your terminal

Requirements

  • Bun v1.0+
  • A Cloudflare account with Workers and KV enabled

Worker Setup (Self-Hosting)

1. Clone and install

git clone https://github.com/arkforge/share-cli
cd share-cli
bun install

2. Create a KV namespace

bun run kv:create

Copy the resulting KV namespace ID into wrangler.toml.

3. Set secrets via Wrangler

# API key used by the CLI to authenticate uploads
bunx wrangler secret put API_KEY

# Admin credentials for the /apps management UI
bunx wrangler secret put APPS_USER
bunx wrangler secret put APPS_PASS

4. Deploy

bun run deploy

CLI Installation

From npm (recommended)

bun add -g @arkforge/share-cli
# or
npm install -g @arkforge/share-cli

From source

bun run install:cli

CLI Usage

Configure

share config --url https://share.yourdomain.com --key your-api-key

Publish a file

share my-presentation.tsx
share dashboard.tsx --title "Q4 Dashboard"

Preview locally with hot-reload

share preview dashboard.tsx

Preview and auto-publish on every save

share preview dashboard.tsx --publish

Update a published snippet

share update my-dashboard-ab12cd34 dashboard.tsx
share update my-dashboard-ab12cd34 --title "New Title"

List published snippets

share list

Environment Variables (Worker)

| Variable | Required | Description | |--------------|----------|------------------------------------------| | API_KEY | Yes | Secret key used by the CLI to authenticate | | APPS_USER | Yes | Username for the /apps admin UI | | APPS_PASS | Yes | Password for the /apps admin UI |

Set these via bunx wrangler secret put <VAR> — never commit them to the repo.


Scripts

| Command | Description | |----------------------|------------------------------------------| | bun run dev | Start local Wrangler dev server | | bun run deploy | Deploy worker to Cloudflare | | bun run typecheck | Run TypeScript type checking | | bun run install:cli| Install the share CLI globally via Bun |


License

MIT