Skip to content

Commit bd8dbd6

Browse files
committed
[DOCS, FIX] fix cli input mismatch error
1 parent bdc3324 commit bd8dbd6

14 files changed

Lines changed: 74 additions & 52 deletions

docs/en/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ Add a new route endpoint to your FastAPI project with:
363363
<div class="termy">
364364

365365
```console
366-
$ fastkit addroute my-awesome-project user
366+
$ fastkit addroute user my-awesome-project
367367
Adding New Route
368368
┌──────────────────┬──────────────────────────────────────────┐
369369
│ Project │ my-awesome-project │

docs/en/tutorial/first-project.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ Let's add the main resources for our blog API:
114114
<div class="termy">
115115

116116
```console
117-
$ fastkit addroute blog-api users
117+
$ fastkit addroute users blog-api
118118
✨ Successfully added new route 'users' to project 'blog-api'
119119

120-
$ fastkit addroute blog-api posts
120+
$ fastkit addroute posts blog-api
121121
✨ Successfully added new route 'posts' to project 'blog-api'
122122

123-
$ fastkit addroute blog-api comments
123+
$ fastkit addroute comments blog-api
124124
✨ Successfully added new route 'comments' to project 'blog-api'
125125
```
126126

docs/en/tutorial/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ Let's add a new API route to practice what you've learned:
342342
<div class="termy">
343343

344344
```console
345-
$ fastkit addroute my-first-api users
345+
$ fastkit addroute users my-first-api
346346
Adding New Route
347347
┌──────────────────┬──────────────────────────────────────────┐
348348
│ Project │ my-first-api │

docs/en/user-guide/adding-routes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ FastAPI-fastkit's `addroute` command makes it easy to add new routes:
1111
<div class="termy">
1212

1313
```console
14-
$ fastkit addroute my-awesome-api users
14+
$ fastkit addroute users my-awesome-api
1515
Adding New Route
1616
┌──────────────────┬──────────────────────────────────────────┐
1717
│ Project │ my-awesome-api │
@@ -383,10 +383,10 @@ You can add multiple routes to build a complete API:
383383
<div class="termy">
384384

385385
```console
386-
# Add more resource routes
387-
$ fastkit addroute my-awesome-api products
388-
$ fastkit addroute my-awesome-api orders
389-
$ fastkit addroute my-awesome-api categories
386+
# Add more resource routes (route name first, project dir second)
387+
$ fastkit addroute products my-awesome-api
388+
$ fastkit addroute orders my-awesome-api
389+
$ fastkit addroute categories my-awesome-api
390390

391391
# Each creates the full CRUD structure
392392
```

docs/en/user-guide/cli-reference.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ Add a new API route to an existing FastAPI project.
158158
#### Syntax
159159

160160
```console
161-
$ fastkit addroute PROJECT_NAME ROUTE_NAME [OPTIONS]
161+
$ fastkit addroute ROUTE_NAME [PROJECT_DIR] [OPTIONS]
162162
```
163163

164164
#### Arguments
165165

166166
| Argument | Description | Required |
167167
|----------|-------------|----------|
168-
| `PROJECT_NAME` | Name of the existing project | Yes |
169168
| `ROUTE_NAME` | Name of the new route (plural recommended) | Yes |
169+
| `PROJECT_DIR` | Project directory under your workspace (defaults to `.`, the current directory) | No |
170170

171171
#### Options
172172

@@ -179,7 +179,8 @@ $ fastkit addroute PROJECT_NAME ROUTE_NAME [OPTIONS]
179179
<div class="termy">
180180

181181
```console
182-
$ fastkit addroute my-api users
182+
$ cd my-api
183+
$ fastkit addroute users
183184
Adding New Route
184185
┌──────────────────┬──────────────────────────────────────────┐
185186
│ Project │ my-api │
@@ -194,6 +195,16 @@ Do you want to add route 'users' to project 'my-api'? [Y/n]: y
194195

195196
</div>
196197

198+
You can also target a project under your workspace by name without `cd`-ing into it:
199+
200+
<div class="termy">
201+
202+
```console
203+
$ fastkit addroute users my-api
204+
```
205+
206+
</div>
207+
197208
#### Generated Files
198209

199210
Creates these files in the project:
@@ -456,10 +467,10 @@ $ fastkit runserver
456467
<div class="termy">
457468

458469
```console
459-
# Add multiple routes
460-
$ fastkit addroute my-api users
461-
$ fastkit addroute my-api products
462-
$ fastkit addroute my-api orders
470+
# Add multiple routes (project name as second positional arg = workspace project)
471+
$ fastkit addroute users my-api
472+
$ fastkit addroute products my-api
473+
$ fastkit addroute orders my-api
463474

464475
# Test the API
465476
$ fastkit runserver
@@ -631,7 +642,7 @@ y
631642
EOF
632643

633644
cd "$service-service"
634-
fastkit addroute "$service-service" "$service"
645+
fastkit addroute "$service"
635646
cd ..
636647
done
637648
```

docs/en/user-guide/quick-start.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Let's add a new API route to your project:
153153
<div class="termy">
154154

155155
```console
156-
$ fastkit addroute my-first-app users
156+
$ fastkit addroute users my-first-app
157157
Adding New Route
158158
┌──────────────────┬──────────────────────────────────────────┐
159159
│ Project │ my-first-app │
@@ -358,9 +358,9 @@ $ fastkit list-templates
358358
# Create a project from a template
359359
$ fastkit startdemo
360360

361-
# Add more routes
362-
$ fastkit addroute my-first-app products
363-
$ fastkit addroute my-first-app orders
361+
# Add more routes (route name first, project dir second)
362+
$ fastkit addroute products my-first-app
363+
$ fastkit addroute orders my-first-app
364364
```
365365

366366
</div>

docs/en/user-guide/using-templates.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,9 @@ After creating a project from a template, you can customize it:
381381
<div class="termy">
382382

383383
```console
384-
$ fastkit addroute my-blog-api posts
385-
$ fastkit addroute my-blog-api users
386-
$ fastkit addroute my-blog-api comments
384+
$ fastkit addroute posts my-blog-api
385+
$ fastkit addroute users my-blog-api
386+
$ fastkit addroute comments my-blog-api
387387
```
388388

389389
</div>
@@ -492,7 +492,7 @@ $ fastkit runserver
492492
$ python -m pytest
493493

494494
# Add new features
495-
$ fastkit addroute your-project new-resource
495+
$ fastkit addroute new-resource your-project
496496
```
497497

498498
</div>

docs/ko/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ Installing dependencies...
360360
<div class="termy">
361361

362362
```console
363-
$ fastkit addroute my-awesome-project user
363+
$ fastkit addroute user my-awesome-project
364364
Adding New Route
365365
┌──────────────────┬──────────────────────────────────────────┐
366366
│ Project │ my-awesome-project │

docs/ko/tutorial/first-project.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ $ source .venv/bin/activate
114114
<div class="termy">
115115

116116
```console
117-
$ fastkit addroute blog-api users
117+
$ fastkit addroute users blog-api
118118
✨ Successfully added new route 'users' to project 'blog-api'
119119

120-
$ fastkit addroute blog-api posts
120+
$ fastkit addroute posts blog-api
121121
✨ Successfully added new route 'posts' to project 'blog-api'
122122

123-
$ fastkit addroute blog-api comments
123+
$ fastkit addroute comments blog-api
124124
✨ Successfully added new route 'comments' to project 'blog-api'
125125
```
126126

docs/ko/tutorial/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def create_item(item: ItemCreate):
342342
<div class="termy">
343343

344344
```console
345-
$ fastkit addroute my-first-api users
345+
$ fastkit addroute users my-first-api
346346
Adding New Route
347347
┌──────────────────┬──────────────────────────────────────────┐
348348
│ Project │ my-first-api │

0 commit comments

Comments
 (0)