plinth-cli 1.0.0__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of plinth-cli might be problematic. Click here for more details.
- plinth_cli-1.0.2/PKG-INFO +242 -0
- plinth_cli-1.0.2/README.md +207 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/docs/plinth-complete-guide.md +19 -6
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/pyproject.toml +2 -2
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/__init__.py +1 -1
- plinth_cli-1.0.2/src/plinth/templates/base/.env.local +1 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/README.md.j2 +11 -1
- plinth_cli-1.0.0/PKG-INFO +0 -166
- plinth_cli-1.0.0/README.md +0 -131
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/docs/developer-guide.md +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/requirements.txt +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/__main__.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/cli.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/commands/__init__.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/commands/add.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/commands/doctor.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/commands/init.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/commands/list.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/commands/remove.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/config.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/exceptions.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/injector.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/logger.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/packages.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/state.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/.env.example +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/.gitignore +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/pyproject.toml.j2 +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/src/__init__.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/src/api/__init__.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/src/api/v1/__init__.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/src/api/v1/health.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/src/config.py.j2 +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/src/core/__init__.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/src/core/config.py.j2 +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/src/core/database.py.j2 +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/src/core/registry.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/src/main.py.j2 +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/src/models/__init__.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates/base/tests/__init__.py +0 -0
- {plinth_cli-1.0.0 → plinth_cli-1.0.2}/src/plinth/templates.py +0 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: plinth-cli
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: Scaffold FastAPI projects in seconds, add features as you grow
|
|
5
|
+
Project-URL: Homepage, https://github.com/cybertycoon/plinth
|
|
6
|
+
Project-URL: Documentation, https://github.com/cybertycoon/plinth/blob/main/docs
|
|
7
|
+
Project-URL: Repository, https://github.com/cybertycoon/plinth.git
|
|
8
|
+
Project-URL: Issues, https://github.com/cybertycoon/plinth/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/cybertycoon/plinth/blob/main/CHANGELOG.md
|
|
10
|
+
Author-email: Silas Okanlawon <okanlawonsilas@gmail.com>
|
|
11
|
+
License: MIT
|
|
12
|
+
Keywords: api,cli,fastapi,framework,generator,scaffolding,web
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Classifier: Typing :: Typed
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Requires-Dist: jinja2>=3.1.0
|
|
28
|
+
Requires-Dist: libcst>=1.0.0
|
|
29
|
+
Requires-Dist: pydantic-settings>=2.0.0
|
|
30
|
+
Requires-Dist: pydantic>=2.0.0
|
|
31
|
+
Requires-Dist: rich>=13.0.0
|
|
32
|
+
Requires-Dist: toml>=0.10.2
|
|
33
|
+
Requires-Dist: typer[all]>=0.12.0
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# 🪨 Plinth
|
|
37
|
+
|
|
38
|
+
> Stop building the "basement" of your FastAPI project.
|
|
39
|
+
|
|
40
|
+
## The Problem
|
|
41
|
+
|
|
42
|
+
Every new FastAPI project starts with the same 2-hour slog:
|
|
43
|
+
|
|
44
|
+
- Wiring up SQLAlchemy with async drivers
|
|
45
|
+
- Setting up config management
|
|
46
|
+
- Creating folder structures that won't become a mess
|
|
47
|
+
- Adding auth... then rewriting it when you change your mind
|
|
48
|
+
|
|
49
|
+
**Boilerplate burnout is real.**
|
|
50
|
+
|
|
51
|
+
## The Solution
|
|
52
|
+
|
|
53
|
+
Plinth scaffolds production-ready FastAPI projects in **2 seconds**, then lets you add features incrementally without breaking your code.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Start with exactly what you need
|
|
57
|
+
plinth init my-api --db postgres --auth jwt
|
|
58
|
+
|
|
59
|
+
# Change your mind later? No problem.
|
|
60
|
+
plinth add redis
|
|
61
|
+
plinth add auth-session
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Why Plinth?
|
|
65
|
+
|
|
66
|
+
| Without Plinth | With Plinth |
|
|
67
|
+
| --------------------------------------------- | ---------------------------------------------- |
|
|
68
|
+
| Copy-paste boilerplate from old projects | Generate clean, consistent structure instantly |
|
|
69
|
+
| Fear of adding features mid-project | Add/remove modules anytime safely |
|
|
70
|
+
| Hope your code injection doesn't break things | AST-aware code modifications (LibCST) |
|
|
71
|
+
| Spend hours on setup | Spend hours on **features** |
|
|
72
|
+
|
|
73
|
+
## Installation
|
|
74
|
+
|
|
75
|
+
### From PyPI
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pip install plinth-cli
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Install with uv (Faster)
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
uv tool install plinth-cli
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### From Source
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
git clone https://github.com/cybertycoon/plinth.git
|
|
91
|
+
cd plinth
|
|
92
|
+
pip install -r requirements.txt
|
|
93
|
+
pip install -e .
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Quick Start
|
|
97
|
+
|
|
98
|
+
### Create a Basic Project
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
plinth init my-app
|
|
102
|
+
cd my-app
|
|
103
|
+
uv run uvicorn src.main:app --reload
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Create with Database & Auth
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
plinth init my-api --db postgres --auth jwt --redis
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Add Features Later
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
cd my-api
|
|
116
|
+
|
|
117
|
+
# Add Redis caching
|
|
118
|
+
plinth add redis
|
|
119
|
+
|
|
120
|
+
# Add JWT authentication
|
|
121
|
+
plinth add auth-jwt
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Commands
|
|
125
|
+
|
|
126
|
+
### `plinth init <name>` — Create New Project
|
|
127
|
+
|
|
128
|
+
Scaffold a new FastAPI project with your chosen features.
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# Basic project
|
|
132
|
+
plinth init my-app
|
|
133
|
+
|
|
134
|
+
# With database and auth
|
|
135
|
+
plinth init my-api --db postgres --auth jwt
|
|
136
|
+
|
|
137
|
+
# Full stack
|
|
138
|
+
plinth init my-service --db postgres --redis --auth jwt
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Options:**
|
|
142
|
+
|
|
143
|
+
- `--db postgres|mysql|sqlite` — Add database support
|
|
144
|
+
- `--redis` — Add Redis caching
|
|
145
|
+
- `--auth jwt|session` — Add authentication
|
|
146
|
+
|
|
147
|
+
### `plinth add <module>` — Add Features Later
|
|
148
|
+
|
|
149
|
+
Add modules to an existing project without breaking your code.
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
cd my-api
|
|
153
|
+
|
|
154
|
+
# Add Redis for caching
|
|
155
|
+
plinth add redis
|
|
156
|
+
|
|
157
|
+
# Add JWT authentication
|
|
158
|
+
plinth add auth-jwt
|
|
159
|
+
|
|
160
|
+
# Add database (if not added during init)
|
|
161
|
+
plinth add postgres
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### `plinth remove <module>` — Remove Features
|
|
165
|
+
|
|
166
|
+
Cleanly remove a module and its code.
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
plinth remove redis
|
|
170
|
+
plinth remove auth-jwt
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### `plinth list` — See What's Available
|
|
174
|
+
|
|
175
|
+
Shows installed modules and available modules you can add.
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
plinth list
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### `plinth doctor` — Check Project Health
|
|
182
|
+
|
|
183
|
+
Diagnoses issues with your Plinth project.
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
plinth doctor
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Available Modules
|
|
190
|
+
|
|
191
|
+
- **postgres/mysql/sqlite** - Database with async drivers
|
|
192
|
+
- **redis** - Caching & sessions
|
|
193
|
+
- **auth-jwt** - JWT authentication
|
|
194
|
+
- **auth-session** - Session-based auth
|
|
195
|
+
|
|
196
|
+
## How It Works
|
|
197
|
+
|
|
198
|
+
Plinth doesn't just copy files—it **understands** your Python code using AST manipulation. When you run `plinth add redis`, it:
|
|
199
|
+
|
|
200
|
+
1. Injects Redis connection code into your main app
|
|
201
|
+
2. Updates `.env` with Redis URL
|
|
202
|
+
3. Adds dependencies to `pyproject.toml`
|
|
203
|
+
4. Registers routes without touching your custom code
|
|
204
|
+
|
|
205
|
+
Your project stays clean, typed, and maintainable.
|
|
206
|
+
|
|
207
|
+
## Project Structure
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
my-app/
|
|
211
|
+
├── src/
|
|
212
|
+
│ ├── __init__.py # Package initializer
|
|
213
|
+
│ ├── main.py # FastAPI entry
|
|
214
|
+
│ ├── api/
|
|
215
|
+
│ │ ├── __init__.py
|
|
216
|
+
│ │ └── v1/
|
|
217
|
+
│ │ ├── __init__.py
|
|
218
|
+
│ │ └── health.py
|
|
219
|
+
│ ├── core/
|
|
220
|
+
│ │ ├── __init__.py
|
|
221
|
+
│ │ ├── config.py # Pydantic settings
|
|
222
|
+
│ │ ├── database.py # Database connection (if DB selected)
|
|
223
|
+
│ │ └── registry.py # Auto-router registration
|
|
224
|
+
│ └── models/
|
|
225
|
+
│ └── __init__.py
|
|
226
|
+
├── tests/
|
|
227
|
+
│ └── __init__.py
|
|
228
|
+
├── .env.example # Environment template
|
|
229
|
+
├── .gitignore # Git ignore rules
|
|
230
|
+
├── .plinth.json # Tracks installed modules
|
|
231
|
+
├── pyproject.toml # Dependencies
|
|
232
|
+
└── README.md # Project readme
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Documentation
|
|
236
|
+
|
|
237
|
+
- [Complete User Guide](docs/plinth-complete-guide.md)
|
|
238
|
+
- [Developer Guide](docs/developer-guide.md)
|
|
239
|
+
|
|
240
|
+
## License
|
|
241
|
+
|
|
242
|
+
MIT License
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# 🪨 Plinth
|
|
2
|
+
|
|
3
|
+
> Stop building the "basement" of your FastAPI project.
|
|
4
|
+
|
|
5
|
+
## The Problem
|
|
6
|
+
|
|
7
|
+
Every new FastAPI project starts with the same 2-hour slog:
|
|
8
|
+
|
|
9
|
+
- Wiring up SQLAlchemy with async drivers
|
|
10
|
+
- Setting up config management
|
|
11
|
+
- Creating folder structures that won't become a mess
|
|
12
|
+
- Adding auth... then rewriting it when you change your mind
|
|
13
|
+
|
|
14
|
+
**Boilerplate burnout is real.**
|
|
15
|
+
|
|
16
|
+
## The Solution
|
|
17
|
+
|
|
18
|
+
Plinth scaffolds production-ready FastAPI projects in **2 seconds**, then lets you add features incrementally without breaking your code.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Start with exactly what you need
|
|
22
|
+
plinth init my-api --db postgres --auth jwt
|
|
23
|
+
|
|
24
|
+
# Change your mind later? No problem.
|
|
25
|
+
plinth add redis
|
|
26
|
+
plinth add auth-session
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Why Plinth?
|
|
30
|
+
|
|
31
|
+
| Without Plinth | With Plinth |
|
|
32
|
+
| --------------------------------------------- | ---------------------------------------------- |
|
|
33
|
+
| Copy-paste boilerplate from old projects | Generate clean, consistent structure instantly |
|
|
34
|
+
| Fear of adding features mid-project | Add/remove modules anytime safely |
|
|
35
|
+
| Hope your code injection doesn't break things | AST-aware code modifications (LibCST) |
|
|
36
|
+
| Spend hours on setup | Spend hours on **features** |
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
### From PyPI
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install plinth-cli
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Install with uv (Faster)
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uv tool install plinth-cli
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### From Source
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
git clone https://github.com/cybertycoon/plinth.git
|
|
56
|
+
cd plinth
|
|
57
|
+
pip install -r requirements.txt
|
|
58
|
+
pip install -e .
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Quick Start
|
|
62
|
+
|
|
63
|
+
### Create a Basic Project
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
plinth init my-app
|
|
67
|
+
cd my-app
|
|
68
|
+
uv run uvicorn src.main:app --reload
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Create with Database & Auth
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
plinth init my-api --db postgres --auth jwt --redis
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Add Features Later
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
cd my-api
|
|
81
|
+
|
|
82
|
+
# Add Redis caching
|
|
83
|
+
plinth add redis
|
|
84
|
+
|
|
85
|
+
# Add JWT authentication
|
|
86
|
+
plinth add auth-jwt
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Commands
|
|
90
|
+
|
|
91
|
+
### `plinth init <name>` — Create New Project
|
|
92
|
+
|
|
93
|
+
Scaffold a new FastAPI project with your chosen features.
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Basic project
|
|
97
|
+
plinth init my-app
|
|
98
|
+
|
|
99
|
+
# With database and auth
|
|
100
|
+
plinth init my-api --db postgres --auth jwt
|
|
101
|
+
|
|
102
|
+
# Full stack
|
|
103
|
+
plinth init my-service --db postgres --redis --auth jwt
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Options:**
|
|
107
|
+
|
|
108
|
+
- `--db postgres|mysql|sqlite` — Add database support
|
|
109
|
+
- `--redis` — Add Redis caching
|
|
110
|
+
- `--auth jwt|session` — Add authentication
|
|
111
|
+
|
|
112
|
+
### `plinth add <module>` — Add Features Later
|
|
113
|
+
|
|
114
|
+
Add modules to an existing project without breaking your code.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
cd my-api
|
|
118
|
+
|
|
119
|
+
# Add Redis for caching
|
|
120
|
+
plinth add redis
|
|
121
|
+
|
|
122
|
+
# Add JWT authentication
|
|
123
|
+
plinth add auth-jwt
|
|
124
|
+
|
|
125
|
+
# Add database (if not added during init)
|
|
126
|
+
plinth add postgres
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### `plinth remove <module>` — Remove Features
|
|
130
|
+
|
|
131
|
+
Cleanly remove a module and its code.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
plinth remove redis
|
|
135
|
+
plinth remove auth-jwt
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### `plinth list` — See What's Available
|
|
139
|
+
|
|
140
|
+
Shows installed modules and available modules you can add.
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
plinth list
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### `plinth doctor` — Check Project Health
|
|
147
|
+
|
|
148
|
+
Diagnoses issues with your Plinth project.
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
plinth doctor
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Available Modules
|
|
155
|
+
|
|
156
|
+
- **postgres/mysql/sqlite** - Database with async drivers
|
|
157
|
+
- **redis** - Caching & sessions
|
|
158
|
+
- **auth-jwt** - JWT authentication
|
|
159
|
+
- **auth-session** - Session-based auth
|
|
160
|
+
|
|
161
|
+
## How It Works
|
|
162
|
+
|
|
163
|
+
Plinth doesn't just copy files—it **understands** your Python code using AST manipulation. When you run `plinth add redis`, it:
|
|
164
|
+
|
|
165
|
+
1. Injects Redis connection code into your main app
|
|
166
|
+
2. Updates `.env` with Redis URL
|
|
167
|
+
3. Adds dependencies to `pyproject.toml`
|
|
168
|
+
4. Registers routes without touching your custom code
|
|
169
|
+
|
|
170
|
+
Your project stays clean, typed, and maintainable.
|
|
171
|
+
|
|
172
|
+
## Project Structure
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
my-app/
|
|
176
|
+
├── src/
|
|
177
|
+
│ ├── __init__.py # Package initializer
|
|
178
|
+
│ ├── main.py # FastAPI entry
|
|
179
|
+
│ ├── api/
|
|
180
|
+
│ │ ├── __init__.py
|
|
181
|
+
│ │ └── v1/
|
|
182
|
+
│ │ ├── __init__.py
|
|
183
|
+
│ │ └── health.py
|
|
184
|
+
│ ├── core/
|
|
185
|
+
│ │ ├── __init__.py
|
|
186
|
+
│ │ ├── config.py # Pydantic settings
|
|
187
|
+
│ │ ├── database.py # Database connection (if DB selected)
|
|
188
|
+
│ │ └── registry.py # Auto-router registration
|
|
189
|
+
│ └── models/
|
|
190
|
+
│ └── __init__.py
|
|
191
|
+
├── tests/
|
|
192
|
+
│ └── __init__.py
|
|
193
|
+
├── .env.example # Environment template
|
|
194
|
+
├── .gitignore # Git ignore rules
|
|
195
|
+
├── .plinth.json # Tracks installed modules
|
|
196
|
+
├── pyproject.toml # Dependencies
|
|
197
|
+
└── README.md # Project readme
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Documentation
|
|
201
|
+
|
|
202
|
+
- [Complete User Guide](docs/plinth-complete-guide.md)
|
|
203
|
+
- [Developer Guide](docs/developer-guide.md)
|
|
204
|
+
|
|
205
|
+
## License
|
|
206
|
+
|
|
207
|
+
MIT License
|
|
@@ -17,15 +17,17 @@ Plinth is a tool that creates FastAPI projects with the features you need. Inste
|
|
|
17
17
|
### Option 1: Install from PyPI (Recommended)
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
pip install plinth
|
|
20
|
+
pip install plinth-cli
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
### Option 2: Install with uv (Faster)
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
uv tool install plinth
|
|
26
|
+
uv tool install plinth-cli
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
> **Note:** The package is named `plinth-cli` on PyPI, but the command remains `plinth`.
|
|
30
|
+
|
|
29
31
|
### Verify Installation
|
|
30
32
|
|
|
31
33
|
```bash
|
|
@@ -143,15 +145,26 @@ After running `plinth init`, you get:
|
|
|
143
145
|
```
|
|
144
146
|
my-app/
|
|
145
147
|
├── src/
|
|
148
|
+
│ ├── __init__.py # Package initializer
|
|
146
149
|
│ ├── main.py # API entry point
|
|
150
|
+
│ ├── api/
|
|
151
|
+
│ │ ├── __init__.py
|
|
152
|
+
│ │ └── v1/
|
|
153
|
+
│ │ ├── __init__.py
|
|
154
|
+
│ │ └── health.py
|
|
147
155
|
│ ├── core/
|
|
148
|
-
│ │ ├──
|
|
156
|
+
│ │ ├── __init__.py
|
|
157
|
+
│ │ ├── config.py # Application settings
|
|
158
|
+
│ │ ├── database.py # Database connection (if DB selected)
|
|
149
159
|
│ │ └── registry.py # Route registration
|
|
150
|
-
│ └──
|
|
151
|
-
│ └──
|
|
152
|
-
|
|
160
|
+
│ └── models/
|
|
161
|
+
│ └── __init__.py
|
|
162
|
+
├── tests/
|
|
163
|
+
│ └── __init__.py
|
|
153
164
|
├── .env.example # Environment template
|
|
165
|
+
├── .gitignore # Git ignore rules
|
|
154
166
|
├── pyproject.toml # Dependencies
|
|
167
|
+
├── README.md # Project readme
|
|
155
168
|
└── .plinth.json # Plinth state
|
|
156
169
|
```
|
|
157
170
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "plinth-cli"
|
|
3
|
-
version = "1.0.
|
|
4
|
-
description = "
|
|
3
|
+
version = "1.0.2"
|
|
4
|
+
description = "Scaffold FastAPI projects in seconds, add features as you grow"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = {text = "MIT"}
|
|
7
7
|
requires-python = ">=3.10"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
PY_TOKEN=pypi-AgEIcHlwaS5vcmcCJDAzYjY5ZmI4LTE4YzUtNGRlZC1hOTVmLWRhNTQwYWIwMWRkNQACElsxLFsicGxpbnRoLWNsaSJdXQACLFsyLFsiZTc4YzMyMjUtZmY1My00NGYxLTgxZWMtODRjN2Q5ZDRiNDBiIl1dAAAGIAYnkejQ7ggiW28d2f5gyBlRmKvtUGxcduSqKY19-Ahl
|
|
@@ -19,17 +19,27 @@ The API will be available at `http://localhost:8000`.
|
|
|
19
19
|
```
|
|
20
20
|
{{ project_name }}/
|
|
21
21
|
├── src/
|
|
22
|
+
│ ├── __init__.py # Package initializer
|
|
22
23
|
│ ├── main.py # FastAPI application entry point
|
|
23
24
|
│ ├── core/
|
|
25
|
+
│ │ ├── __init__.py
|
|
24
26
|
│ │ ├── config.py # Application settings
|
|
27
|
+
│ │ ├── database.py # Database connection (if DB selected)
|
|
25
28
|
│ │ └── registry.py # Router registry
|
|
26
29
|
│ ├── api/
|
|
30
|
+
│ │ ├── __init__.py
|
|
27
31
|
│ │ └── v1/
|
|
32
|
+
│ │ ├── __init__.py
|
|
28
33
|
│ │ └── health.py # Health check endpoints
|
|
29
34
|
│ └── models/ # Database models
|
|
35
|
+
│ └── __init__.py
|
|
30
36
|
├── tests/ # Test suite
|
|
37
|
+
│ └── __init__.py
|
|
31
38
|
├── pyproject.toml # Project dependencies
|
|
32
|
-
|
|
39
|
+
├── .env.example # Environment template
|
|
40
|
+
├── .gitignore # Git ignore rules
|
|
41
|
+
├── .plinth.json # Plinth state
|
|
42
|
+
└── README.md # Project readme
|
|
33
43
|
```
|
|
34
44
|
|
|
35
45
|
## Configuration
|
plinth_cli-1.0.0/PKG-INFO
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: plinth-cli
|
|
3
|
-
Version: 1.0.0
|
|
4
|
-
Summary: A high-performance, developer-first CLI scaffolding tool for FastAPI
|
|
5
|
-
Project-URL: Homepage, https://github.com/cybertycoon/plinth
|
|
6
|
-
Project-URL: Documentation, https://github.com/cybertycoon/plinth/blob/main/docs
|
|
7
|
-
Project-URL: Repository, https://github.com/cybertycoon/plinth.git
|
|
8
|
-
Project-URL: Issues, https://github.com/cybertycoon/plinth/issues
|
|
9
|
-
Project-URL: Changelog, https://github.com/cybertycoon/plinth/blob/main/CHANGELOG.md
|
|
10
|
-
Author-email: Silas Okanlawon <okanlawonsilas@gmail.com>
|
|
11
|
-
License: MIT
|
|
12
|
-
Keywords: api,cli,fastapi,framework,generator,scaffolding,web
|
|
13
|
-
Classifier: Development Status :: 4 - Beta
|
|
14
|
-
Classifier: Environment :: Console
|
|
15
|
-
Classifier: Intended Audience :: Developers
|
|
16
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
-
Classifier: Operating System :: OS Independent
|
|
18
|
-
Classifier: Programming Language :: Python :: 3
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
-
Classifier: Topic :: Software Development :: Code Generators
|
|
24
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
-
Classifier: Typing :: Typed
|
|
26
|
-
Requires-Python: >=3.10
|
|
27
|
-
Requires-Dist: jinja2>=3.1.0
|
|
28
|
-
Requires-Dist: libcst>=1.0.0
|
|
29
|
-
Requires-Dist: pydantic-settings>=2.0.0
|
|
30
|
-
Requires-Dist: pydantic>=2.0.0
|
|
31
|
-
Requires-Dist: rich>=13.0.0
|
|
32
|
-
Requires-Dist: toml>=0.10.2
|
|
33
|
-
Requires-Dist: typer[all]>=0.12.0
|
|
34
|
-
Description-Content-Type: text/markdown
|
|
35
|
-
|
|
36
|
-
# 🪨 Plinth
|
|
37
|
-
|
|
38
|
-
> A high-performance, developer-first CLI scaffolding tool for FastAPI
|
|
39
|
-
|
|
40
|
-
## Overview
|
|
41
|
-
|
|
42
|
-
Plinth is a dynamic CLI scaffolding engine for FastAPI that provides a rock-solid foundation for modern web APIs. Unlike static boilerplates, Plinth generates code based on your specific needs and allows you to evolve your project over time.
|
|
43
|
-
|
|
44
|
-
## Features
|
|
45
|
-
|
|
46
|
-
- 🚀 **Fast Project Initialization** - Create a new FastAPI project in seconds
|
|
47
|
-
- 🔧 **Modular Architecture** - Add features (Auth, Redis, Database) as needed
|
|
48
|
-
- 📝 **Type-Safe** - Built with Pydantic and Typer
|
|
49
|
-
- 🎨 **Beautiful CLI** - Rich terminal output with progress bars
|
|
50
|
-
- 🔒 **Safe Code Injection** - LibCST ensures safe AST modifications
|
|
51
|
-
- 📦 **uv Integration** - Native support for fast Python package management
|
|
52
|
-
|
|
53
|
-
## Installation
|
|
54
|
-
|
|
55
|
-
### From Source
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
# Clone the repository
|
|
59
|
-
git clone <repository-url>
|
|
60
|
-
cd plinth
|
|
61
|
-
|
|
62
|
-
# Install dependencies
|
|
63
|
-
pip install -r requirements.txt
|
|
64
|
-
|
|
65
|
-
# Install in development mode
|
|
66
|
-
pip install -e .
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Using pip
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
pip install plinth
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Quick Start
|
|
76
|
-
|
|
77
|
-
### Create a Basic Project
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
plinth init my-app
|
|
81
|
-
cd my-app
|
|
82
|
-
uv run uvicorn src.main:app --reload
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Create with Database
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
plinth init my-api --db postgres --auth jwt --redis
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Add Features Later
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
cd my-api
|
|
95
|
-
|
|
96
|
-
# Add Redis caching
|
|
97
|
-
plinth add redis
|
|
98
|
-
|
|
99
|
-
# Add JWT authentication
|
|
100
|
-
plinth add auth-jwt
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Commands
|
|
104
|
-
|
|
105
|
-
| Command | Description |
|
|
106
|
-
| ------------------------ | ------------------------------------ |
|
|
107
|
-
| `plinth init <name>` | Initialize a new FastAPI project |
|
|
108
|
-
| `plinth add <module>` | Add a feature module |
|
|
109
|
-
| `plinth remove <module>` | Remove a feature module |
|
|
110
|
-
| `plinth list` | List installed and available modules |
|
|
111
|
-
| `plinth doctor` | Run diagnostics on the project |
|
|
112
|
-
|
|
113
|
-
## Available Modules
|
|
114
|
-
|
|
115
|
-
- **postgres** - PostgreSQL database with asyncpg driver
|
|
116
|
-
- **mysql** - MySQL database with aiomysql driver
|
|
117
|
-
- **sqlite** - SQLite database with aiosqlite driver
|
|
118
|
-
- **redis** - Redis caching and session storage
|
|
119
|
-
- **auth-jwt** - JWT-based authentication
|
|
120
|
-
- **auth-session** - Session-based authentication
|
|
121
|
-
|
|
122
|
-
## Project Structure
|
|
123
|
-
|
|
124
|
-
```
|
|
125
|
-
my-app/
|
|
126
|
-
├── .plinth.json # State tracking
|
|
127
|
-
├── pyproject.toml # Dependencies
|
|
128
|
-
├── src/
|
|
129
|
-
│ ├── main.py # FastAPI entry point
|
|
130
|
-
│ ├── core/
|
|
131
|
-
│ │ ├── config.py # Settings
|
|
132
|
-
│ │ └── registry.py # Router registry
|
|
133
|
-
│ └── api/
|
|
134
|
-
│ └── v1/
|
|
135
|
-
│ └── health.py
|
|
136
|
-
└── tests/
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## Development
|
|
140
|
-
|
|
141
|
-
### Running Tests
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
pytest
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### Code Quality
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
# Format code
|
|
151
|
-
ruff format .
|
|
152
|
-
|
|
153
|
-
# Lint code
|
|
154
|
-
ruff check .
|
|
155
|
-
|
|
156
|
-
# Type check
|
|
157
|
-
mypy src/
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## Documentation
|
|
161
|
-
|
|
162
|
-
See the [complete guide](docs/plinth-complete-guide.md) for detailed documentation.
|
|
163
|
-
|
|
164
|
-
## License
|
|
165
|
-
|
|
166
|
-
MIT License
|
plinth_cli-1.0.0/README.md
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
# 🪨 Plinth
|
|
2
|
-
|
|
3
|
-
> A high-performance, developer-first CLI scaffolding tool for FastAPI
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Plinth is a dynamic CLI scaffolding engine for FastAPI that provides a rock-solid foundation for modern web APIs. Unlike static boilerplates, Plinth generates code based on your specific needs and allows you to evolve your project over time.
|
|
8
|
-
|
|
9
|
-
## Features
|
|
10
|
-
|
|
11
|
-
- 🚀 **Fast Project Initialization** - Create a new FastAPI project in seconds
|
|
12
|
-
- 🔧 **Modular Architecture** - Add features (Auth, Redis, Database) as needed
|
|
13
|
-
- 📝 **Type-Safe** - Built with Pydantic and Typer
|
|
14
|
-
- 🎨 **Beautiful CLI** - Rich terminal output with progress bars
|
|
15
|
-
- 🔒 **Safe Code Injection** - LibCST ensures safe AST modifications
|
|
16
|
-
- 📦 **uv Integration** - Native support for fast Python package management
|
|
17
|
-
|
|
18
|
-
## Installation
|
|
19
|
-
|
|
20
|
-
### From Source
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
# Clone the repository
|
|
24
|
-
git clone <repository-url>
|
|
25
|
-
cd plinth
|
|
26
|
-
|
|
27
|
-
# Install dependencies
|
|
28
|
-
pip install -r requirements.txt
|
|
29
|
-
|
|
30
|
-
# Install in development mode
|
|
31
|
-
pip install -e .
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Using pip
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
pip install plinth
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Quick Start
|
|
41
|
-
|
|
42
|
-
### Create a Basic Project
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
plinth init my-app
|
|
46
|
-
cd my-app
|
|
47
|
-
uv run uvicorn src.main:app --reload
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Create with Database
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
plinth init my-api --db postgres --auth jwt --redis
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Add Features Later
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
cd my-api
|
|
60
|
-
|
|
61
|
-
# Add Redis caching
|
|
62
|
-
plinth add redis
|
|
63
|
-
|
|
64
|
-
# Add JWT authentication
|
|
65
|
-
plinth add auth-jwt
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Commands
|
|
69
|
-
|
|
70
|
-
| Command | Description |
|
|
71
|
-
| ------------------------ | ------------------------------------ |
|
|
72
|
-
| `plinth init <name>` | Initialize a new FastAPI project |
|
|
73
|
-
| `plinth add <module>` | Add a feature module |
|
|
74
|
-
| `plinth remove <module>` | Remove a feature module |
|
|
75
|
-
| `plinth list` | List installed and available modules |
|
|
76
|
-
| `plinth doctor` | Run diagnostics on the project |
|
|
77
|
-
|
|
78
|
-
## Available Modules
|
|
79
|
-
|
|
80
|
-
- **postgres** - PostgreSQL database with asyncpg driver
|
|
81
|
-
- **mysql** - MySQL database with aiomysql driver
|
|
82
|
-
- **sqlite** - SQLite database with aiosqlite driver
|
|
83
|
-
- **redis** - Redis caching and session storage
|
|
84
|
-
- **auth-jwt** - JWT-based authentication
|
|
85
|
-
- **auth-session** - Session-based authentication
|
|
86
|
-
|
|
87
|
-
## Project Structure
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
my-app/
|
|
91
|
-
├── .plinth.json # State tracking
|
|
92
|
-
├── pyproject.toml # Dependencies
|
|
93
|
-
├── src/
|
|
94
|
-
│ ├── main.py # FastAPI entry point
|
|
95
|
-
│ ├── core/
|
|
96
|
-
│ │ ├── config.py # Settings
|
|
97
|
-
│ │ └── registry.py # Router registry
|
|
98
|
-
│ └── api/
|
|
99
|
-
│ └── v1/
|
|
100
|
-
│ └── health.py
|
|
101
|
-
└── tests/
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## Development
|
|
105
|
-
|
|
106
|
-
### Running Tests
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
pytest
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Code Quality
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
# Format code
|
|
116
|
-
ruff format .
|
|
117
|
-
|
|
118
|
-
# Lint code
|
|
119
|
-
ruff check .
|
|
120
|
-
|
|
121
|
-
# Type check
|
|
122
|
-
mypy src/
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## Documentation
|
|
126
|
-
|
|
127
|
-
See the [complete guide](docs/plinth-complete-guide.md) for detailed documentation.
|
|
128
|
-
|
|
129
|
-
## License
|
|
130
|
-
|
|
131
|
-
MIT License
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|