# Plan: Rename Public CLI Package to `clewso`

## Context

The PyPI package name `clew` is taken. We're renaming the **public-facing CLI package** to `clewso` and setting up a mirror repository at `clewnet/clewso`. The internal engine packages (`clew-core`, `clew-ingestion`, etc.) and source module names (`clew`) remain unchanged — only the public distribution name and CLI command change.

---

## Phase 1: Rename the CLI command and package distribution

### 1.1 Root `pyproject.toml`
- Change `name = "clew-engine"` → `name = "clewso"`
- Change CLI entry point: `clew = "clew.cli:app"` → `clewso = "clew.cli:app"`
- Update `[project.urls]` to point to `https://github.com/clewnet/clewso`

### 1.2 CLI app name in source
- `src/clew/cli.py`: Change `typer.Typer(name="clew", ...)` → `typer.Typer(name="clewso", ...)`
- `src/clew/__init__.py`: Update docstring from "Clew Engine CLI" to "Clewso CLI" (or similar)
- Grep for any user-facing strings that say `clew` as a command name (help text, error messages) and update to `clewso`

### 1.3 Go hook binary
- `cmd/clew-hook/`: Keep as-is (internal tool, not public-facing) OR rename to `clewso-hook` if it's distributed publicly
- `go.mod`: Update module path if renaming

---

## Phase 2: Update installation & distribution artifacts

### 2.1 `install.sh`
- Change `REPO="matchdav/clew-engine"` → `REPO="clewnet/clewso"`
- Update binary name pattern: `clew-${OS}-${ARCH}` → `clewso-${OS}-${ARCH}`
- Update any fallback URLs (e.g., `clewengine.dev`)

### 2.2 `Dockerfile`
- Update `LABEL org.opencontainers.image.source` → `https://github.com/clewnet/clewso`
- Update description label
- Update entrypoint: `clew` → `clewso`

### 2.3 `docker-compose.yml`
- Container names `clew-engine-*` → `clewso-*` (optional, cosmetic)
- Network name `clew-network` → `clewso-network` (optional, cosmetic)

---

## Phase 3: Update CI/CD workflows

### 3.1 `.github/workflows/release.yml`
- Update binary artifact names: `clew-${{ matrix.os }}-...` → `clewso-${{ matrix.os }}-...`
- Update PyPI publishing to publish `clewso` package
- Update Docker image tags if applicable

### 3.2 `.github/workflows/ci.yml`
- Update any references to the CLI command name
- Repository references stay internal until mirror is set up

### 3.3 Other workflows
- `clew-pr-analysis.yml`, `clew-ci-index.yml`: Rename workflow files if desired
- `publish-core.yml`, `publish-ingestion.yml`: These publish internal packages — no change needed

---

## Phase 4: Update documentation

### 4.1 `README.md`
- Update title/branding
- Change installation command: `pipx install clew-engine` → `pipx install clewso`
- Change git clone URL → `https://github.com/clewnet/clewso.git`
- Update all CLI usage examples: `clew review` → `clewso review`, etc.
- Update badge URLs

### 4.2 Other docs
- `INFRASTRUCTURE.md`, `ROADMAP.md`, `CHANGELOG.md`: Update references
- Package-level READMEs in `packages/*/README.md`: Update if they reference the CLI command

---

## Phase 5: Mirror repository setup at `clewnet/clewso`

### 5.1 Create the mirror repo
- Create `clewnet/clewso` on GitHub
- Set up as a mirror/fork of `matchdav/clew-engine`

### 5.2 Configure git remotes
- Add `clewso` as a remote in the development repo
- Set up push mirroring (GitHub Actions or manual)

### 5.3 Release pipeline
- Configure `clewnet/clewso` to publish to PyPI as `clewso`
- Configure GitHub Releases for binary distribution
- Configure Docker image publishing under `ghcr.io/clewnet/clewso`

---

## Phase 6: Environment & configuration

### 6.1 `.env.example`
- Update `CLEW_PLATFORM_URL` if the platform URL changes
- Any env vars prefixed with `CLEW_` can stay (internal naming) unless user-facing

### 6.2 `Makefile`
- Update targets that reference the CLI binary name
- Update any repo URL references

### 6.3 `scripts/install_hooks.sh`
- Update references to "Clew" in user-facing messages

---

## Out of Scope (no changes needed)

- **Python module names**: `clew`, `clew_core`, `clew_ingestion` — these are internal import names and don't need to change
- **Internal package names**: `clew-core`, `clew-ingestion`, `clew-api`, `clew-mcp` — these are internal/private packages
- **Database/service names**: Neo4j, Qdrant, Redis configs are deployment-specific
- **API endpoints**: `/v1/*` routes are not affected

---

## Execution Order

1. **Phase 1** first (core rename)
2. **Phase 2** (distribution)
3. **Phase 3** (CI/CD)
4. **Phase 4** (docs)
5. **Phase 5** (mirror repo — requires GitHub admin access, done outside code)
6. **Phase 6** (cleanup)

All code changes (Phases 1-4, 6) can be done in a single PR. Phase 5 is infrastructure work done on GitHub.
