Skip to content

Commit aabc99d

Browse files
committed
refactor(cli): rename sm console script to smpy
Renames the framework's CLI binary from `sm` to `smpy` to free the short name and avoid collisions with other globally-installed `sm` tools (e.g. `.NET` `sm`). - Entry point: `framework/cli/pyproject.toml` `sm` → `smpy` (kept the `simple-module` alias). - All docstrings, comments, READMEs, Makefile targets, generated- file headers, host UI strings, locale entries, skill packs, and documentation (guides, references, release notes, historical plans + specs) updated to reference `smpy`. - Stale `sm-users` / `sm-settings` script references (removed during the earlier standalone-CLI migration) rewritten to the current `smpy users` / `smpy settings` plugin form in user- facing docs and module docstrings. - Followup from /simplify review: Landing and Doctor pages no longer claim `smpy install / migrate / dev / doctor` — those are `make` targets, not subcommands.
1 parent b92cd26 commit aabc99d

77 files changed

Lines changed: 398 additions & 395 deletions

File tree

Some content is hidden

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

‎.github/workflows/pr.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
node-version: ${{ env.NODE_VERSION }}
9797
cache: "npm"
9898
# Need uv too — pages.ts imports ./modules.generated, which is
99-
# produced by `sm gen-pages` from the installed Python modules.
99+
# produced by `smpy gen-pages` from the installed Python modules.
100100
- uses: astral-sh/setup-uv@v8.0.0
101101
with:
102102
enable-cache: true

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Initial public release. All 12 Python packages publish to PyPI and all 3 JS pack
3131

3232
### Added
3333

34-
- `sm new <app>` CLI generator (shipped via the `simple_module_cli` PyPI distribution) scaffolding a working app with `users + dashboard + permissions` pre-wired.
34+
- `smpy new <app>` CLI generator (shipped via the `simple_module_cli` PyPI distribution) scaffolding a working app with `users + dashboard + permissions` pre-wired.
3535
- PyPI Trusted Publishing workflow (`.github/workflows/release.yml`) for zero-secret releases.
3636
- npm Trusted Publishing for all three JS packages.
3737

‎Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ dev-ui:
2525

2626
# Regenerate host/client_app/modules.{manifest.json,generated.ts,generated.css} from installed modules.
2727
gen-pages:
28-
uv run --project host sm host gen-pages --host-dir=host/client_app
28+
uv run --project host smpy host gen-pages --host-dir=host/client_app
2929

3030
# Install JS deps declared by installed modules into host/client_app/node_modules.
3131
# Wheel-installed modules need this; in-repo workspace modules do not.
3232
sync-module-deps:
33-
uv run --project host sm host sync-js-deps --host-client-app=host/client_app
33+
uv run --project host smpy host sync-js-deps --host-client-app=host/client_app
3434

3535
# Build
3636
build:

‎README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A modular-monolith framework for Python. Each feature lives in its own self-cont
1515
If you want to **build an app on simple_module**, not hack on the framework itself:
1616

1717
```bash
18-
uvx --from simple_module_cli sm new my-app
18+
uvx --from simple_module_cli smpy new my-app
1919
cd my-app
2020
make dev
2121
```
@@ -45,7 +45,7 @@ make migrate
4545
make dev
4646
```
4747

48-
Hit `http://localhost:8000` — you land on the public page. `/users/login` is the email+password login, `/dashboard/` is the authenticated home, and `/dashboard/doctor` is the admin-only "sm doctor" panel (static checks, migrations, dev server, modules).
48+
Hit `http://localhost:8000` — you land on the public page. `/users/login` is the email+password login, `/dashboard/` is the authenticated home, and `/dashboard/doctor` is the admin-only "smpy doctor" panel (static checks, migrations, dev server, modules).
4949

5050
## Create a new module
5151

@@ -121,7 +121,7 @@ Power users can still override the following bootstrap knobs via env if needed:
121121
All module-level settings — users, SMTP, Celery broker, file storage backend, etc. — live in the admin UI. After upgrading an existing deployment, run once:
122122

123123
```bash
124-
uv run sm settings import-from-env
124+
uv run smpy settings import-from-env
125125
```
126126

127127
to seed DB overrides from the current `SM_*` environment.
@@ -163,7 +163,7 @@ The 300-line file cap (enforced by CI) usually pushes you to factor row-level co
163163
Either use the CLI:
164164

165165
```bash
166-
uv run sm users create-admin --email admin@example.com --password changeme
166+
uv run smpy users create-admin --email admin@example.com --password changeme
167167
```
168168

169169
Or let the app bootstrap it automatically on first boot by setting env vars **before** running `make migrate && make dev`:

‎docs/database/migrations.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ uv run alembic downgrade orders@base # back to the state before the orders m
4646

4747
## First migration of a new module
4848

49-
When you scaffold a module with `sm create-module`, the *first* autogenerate revision produces a file that needs this marker added by hand:
49+
When you scaffold a module with `smpy create-module`, the *first* autogenerate revision produces a file that needs this marker added by hand:
5050

5151
```python
5252
# migrations/versions/XXXX_add_orders_tables.py
@@ -108,7 +108,7 @@ If `invoices` has an FK to `orders.order.id`:
108108

109109
- Alembic will emit `ADD CONSTRAINT` in the invoices table's migration.
110110
- The migration that creates `invoices_invoice` must come **after** the one that creates `orders_order` in linear history.
111-
- `sm create-module` + `uv run alembic revision --autogenerate` handle this naturally as long as `depends_on` is correct in `ModuleMeta`.
111+
- `smpy create-module` + `uv run alembic revision --autogenerate` handle this naturally as long as `depends_on` is correct in `ModuleMeta`.
112112

113113
On Postgres, cross-schema FKs work natively (`orders.order.id ← invoices.invoice.order_id`).
114114

‎docs/e2e-testing.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ make dev # FastAPI on :8000 + Vite on :5050
2929
Create the first admin user (needed for e2e auth):
3030

3131
```bash
32-
uv run sm-users create-admin --email admin@example.com --password admin
32+
uv run smpy users create-admin --email admin@example.com --password admin
3333
```
3434

3535
Or set `SM_USERS_BOOTSTRAP_EMAIL` / `SM_USERS_BOOTSTRAP_PASSWORD` in `.env`
@@ -48,7 +48,7 @@ When you write e2e tests, read these environment variables (all optional):
4848
| Variable | Default | Notes |
4949
| -------------- | ------------------------- | ------------------------------------------------------------ |
5050
| `E2E_BASE_URL` | `http://localhost:8000` | Where the FastAPI host is listening. |
51-
| `E2E_USERNAME` | `admin@example.com` | Email of the admin user created via `sm-users create-admin`. |
51+
| `E2E_USERNAME` | `admin@example.com` | Email of the admin user created via `smpy users create-admin`. |
5252
| `E2E_PASSWORD` | `admin` | Password of the above admin user. |
5353
| `SM_USERS_VERIFICATION_TOKEN_SECRET` | `dev-verify-token-secret-change-me` | Must match the running server's value so locally-minted invite tokens are accepted. |
5454

‎docs/framework-conventions.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ modules/<name>/
2020
└── pages/ # *.tsx — auto-discovered by Vite
2121
```
2222

23-
Scaffold a fresh module with `sm create-module <name> --dest modules/<name>` — it generates all of the above. Then run `uv add ./modules/<name>` to register it on your app.
23+
Scaffold a fresh module with `smpy create-module <name> --dest modules/<name>` — it generates all of the above. Then run `uv add ./modules/<name>` to register it on your app.
2424

2525
## ModuleMeta
2626

@@ -296,7 +296,7 @@ class OrdersModule(ModuleBase):
296296
return {"orders": Path(str(importlib.resources.files(__package__) / "locales"))}
297297
```
298298

299-
`sm create-module` scaffolds this method and a matching `locales/en.json` automatically.
299+
`smpy create-module` scaffolds this method and a matching `locales/en.json` automatically.
300300

301301
### Key naming
302302

‎docs/framework/i18n.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class OrdersModule(ModuleBase):
2626
}
2727
```
2828

29-
The key (`"orders"`) is the **namespace** — it prefixes every key in the files. `sm create-module` scaffolds this method and a starter `en.json` automatically.
29+
The key (`"orders"`) is the **namespace** — it prefixes every key in the files. `smpy create-module` scaffolds this method and a starter `en.json` automatically.
3030

3131
## Key naming
3232

‎docs/framework/settings.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Values are keyed by `<namespace>.<key>`. Conventional namespace is the module na
133133
Existing deployments that used env vars for module settings should run once:
134134

135135
```bash
136-
uv run sm-settings import-from-env
136+
uv run smpy settings import-from-env
137137
```
138138

139139
This reads the current environment, looks up keys the settings service knows about, and writes overrides into the DB. Idempotent — skips keys that already have a DB override. After running, you can remove those env vars from deployment config.

‎docs/guide/configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Prefix `SM_BG_TASKS_*`. The defaults in `docker-compose.yml` already set these s
7575
After upgrading from an older deployment, import existing `SM_*` values into the DB settings store once:
7676

7777
```bash
78-
uv run sm-settings import-from-env
78+
uv run smpy settings import-from-env
7979
```
8080

8181
This is idempotent — it only seeds keys that don't have a DB override yet.

0 commit comments

Comments
 (0)