Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_Store
*.log
.env
**/venv/
**/__pycache__/
**/node_modules/
**/out/
*.pyc
.pytest_cache/
38 changes: 38 additions & 0 deletions PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Creer — Final Plan

v0.1 delivered the foundation: FastAPI planner/generator + VS Code command that writes a generated repo into the workspace (optional git init).

## v0.2 — done

1. **Preview before writing** — plan preview markdown + confirm before generate/write (`creer.previewBeforeWrite`).
2. **GitHub repo creation** — `POST /github/create-repo` + extension remote add/push.
3. **Curated templates** — `GET /templates` + template-anchored `/plan` & `/generate`.
4. **Overwrite protection** — per-file conflict detection with overwrite / skip / cancel.
5. **Chat command `/creer`** — `creer.createRepoFromChat` + `@creer` chat participant.

## v0.3 — done

1. **Streaming generation** — `POST /generate/stream` (SSE) + extension progress UI.
2. **Local / offline backends** — `OPENAI_BASE_URL`, `CREER_OFFLINE`.
3. **Open-source bake-ins** — LICENSE / README / CI via `bakeins.py`.
4. **Hardening** — `GIT_ASKPASS` + SecretStorage for GitHub tokens.

## v0.4 — done

1. **Cancellation** — `job_id` on stream + `POST /generate/cancel`; extension AbortSignal + cancellable progress.
2. **Selectable bake-ins** — license (`mit` / `apache-2.0` / `none`) and CI presets (`auto` / `python` / `node` / `none`); `GET /bakeins`.
3. **Quality gates** — telemetry-free tree checks (`quality` on generate/done; `POST /quality`).

## v0.5 (optional next)

- Diff preview of generated file contents before write
- Multi-root workspace targeting
- Template packs as installable JSON/YAML

## Non-goals

- Multi-agent orchestration
- Memory graphs
- Overengineered plugin frameworks

Stay power-focused: idea → plan → files → workspace.
111 changes: 111 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Creer

AI-powered repo scaffolding inside your workspace.

**Current version: 0.5.0**

## Architecture

```
creer/
├── backend/ # Python FastAPI AI engine (+ packs/)
└── extension/ # VS Code extension
```

## Prerequisites

- Python 3.10+
- Node.js 18+
- OpenAI API key **or** `OPENAI_BASE_URL` **or** `CREER_OFFLINE=1` (with template/pack)
- VS Code / Cursor

## Backend (v0.5)

```bash
cd backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn main:app --reload --port 8000
```

### Environment

| Variable | Description |
|---|---|
| `OPENAI_API_KEY` | OpenAI API key |
| `OPENAI_BASE_URL` | OpenAI-compatible base URL (Ollama, etc.) |
| `CREER_MODEL` | Model name (default `gpt-4o-mini`) |
| `CREER_OFFLINE` | Template/pack-only stubs |
| `CREER_PACKS_DIR` | Extra packs directory (overrides same ids) |

### Endpoints

| Method | Path | Description |
|---|---|---|
| `GET` | `/health` | Version `0.5.0`, packs_count |
| `GET` | `/templates` | Built-in templates |
| `GET` | `/packs` | Installable JSON/YAML packs |
| `GET` | `/packs/{id}` | Single pack |
| `GET` | `/bakeins` | License/CI options |
| `POST` | `/plan` | Plan (`template_id` **or** `pack_id`) |
| `POST` | `/generate` | Generate + bake-ins + quality |
| `POST` | `/generate/stream` | SSE progress (`job_id`) |
| `POST` | `/generate/cancel` | Cancel job |
| `POST` | `/quality` | Dry-run gates |
| `POST` | `/github/create-repo` | Create GitHub repo |

### Packs

Drop `.json` / `.yaml` files into `backend/packs/` (or `CREER_PACKS_DIR`):

```json
{
"id": "fastapi-crud",
"name": "FastAPI CRUD",
"description": "CRUD API starter",
"stack": "FastAPI + Uvicorn",
"version": "1.0.0",
"files": ["main.py", "requirements.txt", "README.md"]
}
```

Shipped examples: `fastapi-crud`, `express-ts`, `python-lib`.

## Extension (v0.5)

```bash
cd extension && npm install && npm run compile
```

Flow: idea → template/pack → bake-ins → plan preview → generate (cancellable) → **content diff preview** → write → optional git/GitHub.

Multi-root: QuickPick workspace folder (or `creer.defaultWorkspaceFolder`).

### Commands

| Command | Title |
|---|---|
| `creer.createRepo` | Creer: Create New Repo |
| `creer.createRepoFromChat` | Creer: Create from Chat Prompt |
| `creer.setGitHubToken` | Creer: Set GitHub Token |
| `creer.clearGitHubToken` | Creer: Clear GitHub Token |

### Settings

| Setting | Default | Description |
|---|---|---|
| `creer.backendUrl` | `http://localhost:8000` | Backend URL |
| `creer.contentPreview` | `true` | Diff/content preview before write |
| `creer.defaultWorkspaceFolder` | `""` | Multi-root folder name/path hint |
| `creer.previewBeforeWrite` | `true` | Plan tree confirm before generate |
| `creer.useStreaming` | `true` | SSE progress |
| `creer.promptBakeins` | `true` | QuickPick license/CI |
| `creer.license` / `creer.ciPreset` | `mit` / `auto` | Defaults when not prompting |
| `creer.initGit` | `true` | git init + commit |
| `creer.createGitHubRepo` | `false` | Create remote |
| `creer.githubPrivate` | `true` | Private repos |

## License

MIT
17 changes: 17 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# OpenAI API key (required unless CREER_OFFLINE=1 or using a local server that ignores it)
OPENAI_API_KEY=sk-your-key-here

# Optional OpenAI-compatible base URL for local/offline backends (Ollama, LM Studio, vLLM, etc.)
# Example: http://127.0.0.1:11434/v1
OPENAI_BASE_URL=

# Model name (OpenAI or local-compatible)
CREER_MODEL=gpt-4o-mini

# Template-only / stub generation — never calls the LLM
# Set to 1, true, or yes to enable
CREER_OFFLINE=

# Optional extra packs directory (JSON/YAML). Merged with backend/packs;
# user packs override built-in packs on the same id.
# CREER_PACKS_DIR=/path/to/my-packs
6 changes: 6 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.env
venv/
__pycache__/
*.pyc
.pytest_cache/
.mypy_cache/
1 change: 1 addition & 0 deletions backend/app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Creer backend package."""
Loading