Metadata-Version: 2.4
Name: sum-cli
Version: 3.0.0
Summary: SUM Platform CLI: single control plane for site lifecycle management
Author: Mark Ashton
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/markashton480/sum-platform
Project-URL: Repository, https://github.com/markashton480/sum-platform
Project-URL: Issues, https://github.com/markashton480/sum-platform/issues
Project-URL: Documentation, https://github.com/markashton480/sum-platform/tree/main/docs/dev/cli.md
Keywords: sum,cli,django,wagtail
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1.7
Requires-Dist: pyyaml>=6.0
Provides-Extra: gitea
Requires-Dist: httpx>=0.27.0; extra == "gitea"
Dynamic: license-file

# SUM CLI (v3)

[![PyPI](https://img.shields.io/pypi/v/sum-cli.svg)](https://pypi.org/project/sum-cli/)

The SUM CLI is the single control plane for deploying and managing SUM Platform client sites.

## Install

```bash
pip install sum-cli
sum-platform --version
```

### With Gitea Support

If using Gitea instead of GitHub for repository hosting:

```bash
pip install sum-cli[gitea]
```

## Quick Usage

```bash
# Create a new production site (requires sudo)
sudo sum-platform init acme --theme theme_a

# Create site with custom content profile
sudo sum-platform init acme --content-path /path/to/profiles/acme

# Update a deployed site
sum-platform update acme

# Backup a site
sum-platform backup acme --include-media

# Promote staging to production
sum-platform promote acme --domain acme.example.com

# List available themes
sum-platform themes

# Validate a project setup
sum-platform check acme
```

## Commands

| Command | Description | Requires Sudo |
|---------|-------------|---------------|
| `init` | Create new site at `/srv/sum/<name>/` | Yes |
| `update` | Pull updates, migrate, restart | No (staging) |
| `backup` | Database and media backup | No |
| `promote` | Deploy staging site to production | No |
| `check` | Validate project setup | No |
| `themes` | List available themes | No |
| `run` | Start development server | No |

## Git Provider Support

The CLI supports both GitHub and Gitea for repository hosting. Configure your provider in `/etc/sum/config.yml`:

**GitHub (default):**
```yaml
agency:
  name: "Your Agency"
  git_provider: "github"
  github_org: "your-org"
```

**Gitea:**
```yaml
agency:
  name: "Your Agency"
  git_provider: "gitea"
  gitea_url: "https://gitea.example.com"
  gitea_org: "your-org"
  gitea_token_env: "GITEA_TOKEN"
```

For Gitea, set the `GITEA_TOKEN` environment variable with your API token.

## Development Install (monorepo)

```bash
pip install -e ./cli
```

## Configuration

System-wide configuration is read from `/etc/sum/config.yml`. See `config.yml.example` for the full schema.

## Documentation

The full User Guide is bundled with the package at `sum/docs/USER_GUIDE.md`.

For monorepo development:
- [User Guide](../docs/dev/cli/USER_GUIDE.md) - Full command reference
- [Developer Guide](../docs/dev/cli/DEVELOPER_GUIDE.md) - CLI architecture and contribution guide
