Skip to content

Commit b4eb306

Browse files
jcameronjeffclaude
andcommitted
feat: initial release — OpZero CLI, MCP server, and API client
Three-package monorepo for OpZero.sh: - `opzero` — rich TUI CLI with deploy, projects, deployments, domains, init, and 15+ commands - `@opzero/mcp` — stdio MCP server with 26 tools for AI assistant integration - `@opzero/core` — shared API client using JSON-RPC 2.0 over the OpZero MCP endpoint Includes CI/CD workflows, comprehensive docs, and MIT license. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 parents  commit b4eb306

44 files changed

Lines changed: 3566 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: oven-sh/setup-bun@v2
15+
with:
16+
bun-version: latest
17+
- run: bun install
18+
- run: bun run typecheck
19+
- run: bun run build
20+
- run: bun run test

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: oven-sh/setup-bun@v2
16+
with:
17+
bun-version: latest
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
registry-url: 'https://registry.npmjs.org'
22+
- run: bun install
23+
- run: bun run build
24+
- run: |
25+
cd packages/core && npm publish --provenance --access public
26+
cd ../cli && npm publish --provenance --access public
27+
cd ../mcp && npm publish --provenance --access public
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
dist/
3+
*.tsbuildinfo
4+
.env
5+
.env.local
6+
.DS_Store
7+
bun.lockb

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 OpZero
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
<div align="center">
2+
3+
# OpZero CLI
4+
5+
**Deploy websites from your terminal. Powered by [opzero.sh](https://opzero.sh)**
6+
7+
[![npm version](https://img.shields.io/npm/v/opzero.svg)](https://www.npmjs.com/package/opzero)
8+
[![npm downloads](https://img.shields.io/npm/dm/opzero.svg)](https://www.npmjs.com/package/opzero)
9+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
10+
11+
Deploy HTML, React components, and full websites to Cloudflare Pages, Netlify, or Vercel — in seconds.
12+
13+
[Get Started](#quick-start) · [Commands](#commands) · [MCP Server](#mcp-server) · [API Client](#api-client)
14+
15+
</div>
16+
17+
---
18+
19+
## Quick Start
20+
21+
### Install
22+
23+
```bash
24+
# Install globally
25+
npm install -g opzero
26+
27+
# Or use directly with npx
28+
npx opzero deploy ./my-site --name my-project
29+
```
30+
31+
### Authenticate
32+
33+
```bash
34+
opzero login
35+
```
36+
37+
Get your API key from [opzero.sh/dashboard/api-keys](https://opzero.sh/dashboard/api-keys).
38+
39+
### Deploy
40+
41+
```bash
42+
# Deploy a directory
43+
opzero deploy ./my-site --name my-project
44+
45+
# Deploy a React component
46+
opzero deploy --artifact ./App.tsx --name my-app
47+
48+
# Deploy markdown as a styled page
49+
opzero deploy --markdown ./README.md --name docs
50+
51+
# Deploy with OpZero theme
52+
opzero deploy --themed ./content.html --name landing
53+
```
54+
55+
That's it. Your site is live.
56+
57+
## Commands
58+
59+
### Authentication
60+
| Command | Description |
61+
|---------|-------------|
62+
| `opzero login` | Authenticate (API key or browser OAuth) |
63+
| `opzero logout` | Clear stored credentials |
64+
| `opzero whoami` | Show current user and plan info |
65+
66+
### Deploying
67+
| Command | Description |
68+
|---------|-------------|
69+
| `opzero deploy [dir]` | Deploy a directory |
70+
| `opzero deploy --artifact <file>` | Deploy a React component |
71+
| `opzero deploy --markdown <file>` | Deploy markdown as a page |
72+
| `opzero deploy --themed <file>` | Deploy with OpZero brand theme |
73+
74+
### Projects
75+
| Command | Description |
76+
|---------|-------------|
77+
| `opzero projects` | List all projects |
78+
| `opzero projects create <name>` | Create a new project |
79+
| `opzero projects delete <name>` | Delete a project |
80+
| `opzero projects archive <name>` | Archive a project |
81+
| `opzero projects cleanup` | Find stale/duplicate projects |
82+
83+
### Deployments
84+
| Command | Description |
85+
|---------|-------------|
86+
| `opzero deployments [project]` | List deployment history |
87+
| `opzero rollback <deployment-id>` | Rollback to a previous version |
88+
| `opzero redeploy <project>` | Redeploy latest version |
89+
| `opzero logs <id>` | View build logs |
90+
91+
### Other
92+
| Command | Description |
93+
|---------|-------------|
94+
| `opzero domains set <project> <domain>` | Set custom domain |
95+
| `opzero init [dir]` | Scaffold from template |
96+
| `opzero templates` | List available templates |
97+
| `opzero status` | Platform status and usage |
98+
| `opzero open <project>` | Open project in browser |
99+
| `opzero mcp` | Start MCP server for AI tools |
100+
101+
### Global Flags
102+
- `--help, -h` — Show help
103+
- `--version, -v` — Show version
104+
- `--json` — Output as JSON
105+
- `--target <provider>` — cloudflare, netlify, or vercel
106+
107+
## MCP Server
108+
109+
The OpZero MCP server lets AI assistants (Claude Code, Cursor, Windsurf, etc.) deploy websites directly.
110+
111+
### Setup for Claude Code
112+
113+
Add to your MCP settings:
114+
115+
```json
116+
{
117+
"mcpServers": {
118+
"opzero": {
119+
"command": "opzero",
120+
"args": ["mcp"]
121+
}
122+
}
123+
}
124+
```
125+
126+
Or use the standalone package:
127+
128+
```json
129+
{
130+
"mcpServers": {
131+
"opzero": {
132+
"command": "npx",
133+
"args": ["@opzero/mcp"]
134+
}
135+
}
136+
}
137+
```
138+
139+
### Available Tools (26)
140+
141+
**Deploy:** `quick_deploy`, `deploy_website`, `deploy_artifact`, `deploy_themed`, `deploy_markdown`, `update_deployment`
142+
143+
**Projects:** `list_projects`, `create_project`, `project_delete`, `project_archive`, `project_cleanup`
144+
145+
**Deployments:** `get_deployment`, `list_deployments`, `redeploy`, `rollback_deployment`, `get_build_logs`, `delete_deployment`
146+
147+
**Templates & Domains:** `get_template`, `set_custom_domain`
148+
149+
**System:** `help`, `ask_agent`, `get_system_status`
150+
151+
**Local-only:** `deploy_local_dir`, `init_project`, `open_project`, `whoami`
152+
153+
## API Client
154+
155+
Use `@opzero/core` to build your own integrations:
156+
157+
```bash
158+
npm install @opzero/core
159+
```
160+
161+
```typescript
162+
import { OpZeroClient } from '@opzero/core'
163+
164+
const client = new OpZeroClient({ apiKey: 'your-api-key' })
165+
166+
// Deploy a website
167+
const result = await client.deploy({
168+
name: 'my-site',
169+
files: {
170+
'index.html': '<h1>Hello World</h1>',
171+
},
172+
})
173+
174+
console.log(`Live at: ${result.url}`)
175+
```
176+
177+
## Packages
178+
179+
| Package | npm | Description |
180+
|---------|-----|-------------|
181+
| [`opzero`](packages/cli) | [![npm](https://img.shields.io/npm/v/opzero.svg)](https://www.npmjs.com/package/opzero) | CLI tool |
182+
| [`@opzero/mcp`](packages/mcp) | [![npm](https://img.shields.io/npm/v/@opzero/mcp.svg)](https://www.npmjs.com/package/@opzero/mcp) | MCP server for AI tools |
183+
| [`@opzero/core`](packages/core) | [![npm](https://img.shields.io/npm/v/@opzero/core.svg)](https://www.npmjs.com/package/@opzero/core) | API client library |
184+
185+
## Development
186+
187+
```bash
188+
# Clone the repo
189+
git clone https://github.com/opzero-sh/cli.git
190+
cd cli
191+
192+
# Install dependencies
193+
bun install
194+
195+
# Build all packages
196+
bun run build
197+
198+
# Run the CLI locally
199+
bun run packages/cli/src/index.tsx
200+
```
201+
202+
## License
203+
204+
MIT — see [LICENSE](LICENSE)
205+
206+
---
207+
208+
<div align="center">
209+
210+
Built with [Bun](https://bun.sh) · Powered by [OpZero.sh](https://opzero.sh)
211+
212+
</div>

0 commit comments

Comments
 (0)