# SiteSpawn AiCMS CLI Version 0.3.95

> Command-line tool for interacting with SiteSpawn-powered websites.

## Download

| Platform | Download |
|----------|----------|
| Linux (amd64) | [sitespawn-linux-amd64](https://sitespawn.ai/downloads/sitespawn-linux-amd64) |
| Linux (arm64 / Raspberry Pi) | [sitespawn-linux-arm64](https://sitespawn.ai/downloads/sitespawn-linux-arm64) |
| macOS (Intel) | [sitespawn-darwin-amd64](https://sitespawn.ai/downloads/sitespawn-darwin-amd64) |
| macOS (Apple Silicon) | [sitespawn-darwin-arm64](https://sitespawn.ai/downloads/sitespawn-darwin-arm64) |
| Windows | [sitespawn-windows-amd64.exe](https://sitespawn.ai/downloads/sitespawn-windows-amd64.exe) |

### Quick install (Linux/macOS)

```bash
curl -fsSL https://sitespawn.ai/downloads/sitespawn-linux-amd64 -o sitespawn && chmod +x sitespawn && sudo mv sitespawn /usr/local/bin/
```

## Setup

Create a config file at ~/.sitespawn (TOML format) with your site profiles:

`toml
active = "mysite"

[site.mysite]
domain = "example.com"
token = "your-api-token"
`

Each `[site.XX]` block defines a short code. Get API tokens from your site dashboard.

## Commands

### Site Management
- sitespawn set <code> — Switch active site
- sitespawn status — Show active site and auth status
- sitespawn show — List all configured sites
- sitespawn auth login — Authenticate with your site
- sitespawn auth whoami — Show current user

### Content — Blog Posts
- sitespawn post list — List all blog posts
- sitespawn post create --title "Title" --file ./post.md — Create post from file
- sitespawn post download <slug> — Download post markdown (default: <slug>.md)
- sitespawn post download <slug> /tmp/post.md — Download to specific path
- sitespawn post upload <slug> ./post.md — Upload edited content back to server
- sitespawn post delete <slug> — Delete post
- sitespawn post publish <slug> — Publish a draft post
- sitespawn post draft <slug> — Unpublish a post
- sitespawn post set-cover <slug> <media_id> — Set cover image

### Content — Pages
- sitespawn page list — List all pages
- sitespawn page create --title "Title" --file ./page.md — Create page from file
- sitespawn page download <slug> — Download page markdown (default: <slug>.md)
- sitespawn page download <slug> /tmp/page.md — Download to specific path
- sitespawn page upload <slug> ./page.md — Upload edited content back to server
- sitespawn page delete <slug> — Delete page
- sitespawn page publish <slug> — Publish a draft page
- sitespawn page draft <slug> — Unpublish a page
- sitespawn page set-cover <slug> <media_id> — Set cover image

### Shop (public)
- sitespawn shop list — Browse products
- sitespawn shop view <sku> — Product details
- sitespawn shop bundles — List bundles
- sitespawn shop view-bundle <sku> — Bundle details

### Cart & Checkout
- sitespawn cart view — View shopping cart
- sitespawn cart add <sku> — Add product to cart (--qty 2, --bundle)
- sitespawn cart update <id> <qty> — Update quantity
- sitespawn cart remove <id> — Remove item
- sitespawn cart coupon <code> — Apply coupon
- sitespawn cart remove-coupon — Remove coupon
- sitespawn checkout order — Place order (--first-name, --last-name, --address, --city, --postal, --country)
- sitespawn checkout shipping — Calculate shipping

### Orders
- sitespawn orders list — List your orders
- sitespawn orders view <id> — View order details with tracking

### Profile
- sitespawn profile view — View profile and addresses
- sitespawn profile edit — Edit profile interactively
- sitespawn profile addresses — List saved addresses
- sitespawn profile avatar <file> — Upload avatar
- sitespawn profile delete-avatar — Remove avatar

### Support Tickets
- sitespawn my-tickets list — List your tickets
- sitespawn my-tickets view <id> — View ticket with replies
- sitespawn my-tickets create <subject> <message> — Create ticket
- sitespawn my-tickets reply <id> <message> — Reply to ticket

### Reviews
- sitespawn review list <sku> — List reviews for a product
- sitespawn review reviewable — Products you can review
- sitespawn review create <sku> <rating> <title> <content> — Submit review

### Forum
- sitespawn forum categories — List forum categories
- sitespawn forum topics <category> — Browse topics (--sort latest|popular|unanswered)
- sitespawn forum view <id> — View topic with replies
- sitespawn forum create <cat_id> <title> <body> — Create topic
- sitespawn forum reply <topic_id> <body> — Reply (--quote <reply_id>)
- sitespawn forum vote <topic_id> <value> — Upvote (1) or downvote (-1)
- sitespawn forum solved <topic_id> — Mark as solved

### Menu Management
- sitespawn menu list — Show current menu tree (--menu main|footer)
- sitespawn menu add-page <slug> — Add a published page to the menu (--menu, --under <id>, --after <id>)
- sitespawn menu add <title> <url> — Add a custom link (--menu, --under <id>, --after <id>, --external)
- sitespawn menu remove <id> — Remove a menu item by ID (--menu main|footer)

### Translations [admin]
Copy content to a new locale and auto-translate via translate.sitespawn.ai (if translate_key is set in ~/.sitespawn). Pass the locale as a positional argument — no separate "translate" verb.
- sitespawn post <slug> <locale> — Copy + auto-translate a post (e.g. sitespawn post home de)
- sitespawn page <slug> <locale> — Copy + auto-translate a page (e.g. sitespawn page privacy ja)
- sitespawn faq <id> <language> — Copy + auto-translate a FAQ entry (e.g. sitespawn faq 5 fr)
- sitespawn menu <name> <locale> — Copy + auto-translate a menu (e.g. sitespawn menu footer de)
- sitespawn form <id> <locale> — Copy + auto-translate a form (e.g. sitespawn form 3 es)

Add translate_key to ~/.sitespawn to enable auto-translation. Without it, a draft copy is created with source-language content pre-filled.
Supported locales: en, de, fr, es, pt, ja, zh, yue, hi, ar, ru

### Analytics [admin]
- sitespawn analytics views — Page view analytics with ASCII graphs (--start, --end, --granularity hour|day|week|month)
- sitespawn analytics sales — Sales analytics with revenue charts (--start, --end, --granularity, --product <sku>)
- sitespawn analytics community — Community analytics: forum, tickets, reviews (--start, --end, --granularity)

## Global Flags

- --site <code-or-domain> (-s) — Override active site for this command
- --json — Output raw JSON
