codz-cli 0.0.0-stage → 0.1.2
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.
- package/BETA.md +91 -0
- package/LICENSE +21 -0
- package/README.md +525 -2
- package/assets/gradle-wrapper/README.txt +2 -0
- package/assets/gradle-wrapper/gradle-wrapper.jar +0 -0
- package/assets/gradle-wrapper/gradlew +251 -0
- package/assets/gradle-wrapper/gradlew.bat +94 -0
- package/bin/codz.js +33 -0
- package/dist/adapters/android.js +321 -0
- package/dist/adapters/androidSetup.js +277 -0
- package/dist/adapters/common.js +114 -0
- package/dist/adapters/dartGen.js +83 -0
- package/dist/adapters/flutter.js +291 -0
- package/dist/adapters/flutterGen.js +204 -0
- package/dist/adapters/flutterScan.js +312 -0
- package/dist/adapters/flutterSetup.js +252 -0
- package/dist/adapters/flutterStyles.js +130 -0
- package/dist/adapters/generic.js +20 -0
- package/dist/adapters/getx.js +423 -0
- package/dist/adapters/index.js +28 -0
- package/dist/adapters/ios.js +440 -0
- package/dist/adapters/kotlinGen.js +110 -0
- package/dist/adapters/models.js +116 -0
- package/dist/adapters/nextjs.js +243 -0
- package/dist/adapters/nextjsGen.js +285 -0
- package/dist/adapters/nextjsScan.js +364 -0
- package/dist/adapters/nextjsSetup.js +119 -0
- package/dist/adapters/react.js +89 -0
- package/dist/adapters/reactNative.js +109 -0
- package/dist/adapters/reactNativeSetup.js +236 -0
- package/dist/adapters/reactQuery.js +89 -0
- package/dist/adapters/reactSetup.js +150 -0
- package/dist/adapters/source.js +165 -0
- package/dist/cli.js +1175 -0
- package/dist/core/cache.js +76 -0
- package/dist/core/changeset.js +404 -0
- package/dist/core/commands.js +239 -0
- package/dist/core/config.js +45 -0
- package/dist/core/diff.js +143 -0
- package/dist/core/events.js +41 -0
- package/dist/core/fsutil.js +122 -0
- package/dist/core/git.js +36 -0
- package/dist/core/jsonEdit.js +113 -0
- package/dist/core/merge.js +159 -0
- package/dist/core/proc.js +23 -0
- package/dist/core/safe.js +75 -0
- package/dist/core/templates.js +100 -0
- package/dist/core/tsAst.js +112 -0
- package/dist/core/types.js +12 -0
- package/dist/core/validateConfig.js +172 -0
- package/dist/core/workflow.js +72 -0
- package/dist/core/workspace.js +80 -0
- package/dist/core/yaml.js +126 -0
- package/dist/core/yamlDoc.js +367 -0
- package/dist/detector.js +95 -0
- package/dist/input/apiSpec.js +395 -0
- package/dist/input/curl.js +259 -0
- package/dist/input/endpoint.js +220 -0
- package/dist/input/har.js +120 -0
- package/dist/input/infer.js +174 -0
- package/dist/input/naming.js +145 -0
- package/dist/input/paste.js +130 -0
- package/dist/skills/androidSkeleton.js +292 -0
- package/dist/skills/androidTests.js +221 -0
- package/dist/skills/androidUi.js +561 -0
- package/dist/skills/androidViews.js +536 -0
- package/dist/skills/apiAdd.js +99 -0
- package/dist/skills/apiDiff.js +271 -0
- package/dist/skills/apiEdit.js +547 -0
- package/dist/skills/apiImport.js +127 -0
- package/dist/skills/apiList.js +35 -0
- package/dist/skills/apiSync.js +221 -0
- package/dist/skills/auth.js +1304 -0
- package/dist/skills/completion.js +142 -0
- package/dist/skills/config.js +93 -0
- package/dist/skills/create.js +638 -0
- package/dist/skills/createDemo.js +1026 -0
- package/dist/skills/doctor.js +304 -0
- package/dist/skills/doctorFix.js +214 -0
- package/dist/skills/explain.js +61 -0
- package/dist/skills/feature.js +418 -0
- package/dist/skills/featureEdit.js +225 -0
- package/dist/skills/featureLinks.js +179 -0
- package/dist/skills/init.js +66 -0
- package/dist/skills/iosUi.js +468 -0
- package/dist/skills/locale.js +335 -0
- package/dist/skills/mcp.js +175 -0
- package/dist/skills/mock.js +482 -0
- package/dist/skills/module.js +23 -0
- package/dist/skills/plans.js +66 -0
- package/dist/skills/prefill.js +84 -0
- package/dist/skills/reactNativeUi.js +388 -0
- package/dist/skills/reactUi.js +352 -0
- package/dist/skills/report.js +75 -0
- package/dist/skills/route.js +230 -0
- package/dist/skills/screen.js +597 -0
- package/dist/skills/screenForm.js +410 -0
- package/dist/skills/setup.js +28 -0
- package/dist/skills/setupDoctor.js +226 -0
- package/dist/skills/templatesCmd.js +32 -0
- package/dist/skills/testgen.js +331 -0
- package/dist/skills/theme.js +388 -0
- package/dist/starters/auth.js +144 -0
- package/dist/starters/commands.js +283 -0
- package/dist/starters/engine.js +315 -0
- package/dist/starters/home.js +42 -0
- package/dist/starters/http.js +93 -0
- package/dist/starters/manifest.js +285 -0
- package/dist/starters/paths.js +70 -0
- package/dist/starters/publish.js +150 -0
- package/dist/starters/registry.js +258 -0
- package/dist/starters/sign.js +72 -0
- package/dist/starters/source.js +98 -0
- package/dist/starters/strictJson.js +148 -0
- package/dist/starters/tar.js +180 -0
- package/docs/COMMANDS.md +527 -0
- package/examples/openapi.yaml +319 -0
- package/package.json +57 -4
package/docs/COMMANDS.md
ADDED
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
# codz commands
|
|
2
|
+
|
|
3
|
+
Generated from `src/core/commands.ts` (codz 0.1.0). Do not edit by hand; run `npm run docs`.
|
|
4
|
+
|
|
5
|
+
## Start
|
|
6
|
+
|
|
7
|
+
### `codz create [name] [--type <type>] [--architecture <id>]`
|
|
8
|
+
|
|
9
|
+
Create a new project and set it up: pick the type, architecture, name and options, then codz runs the platform creator and applies the architecture.
|
|
10
|
+
|
|
11
|
+
Asks for anything not given as an option. Architectures: Flutter riverpod, getx, bloc, get_it, none; Next.js fetch-helper, plain-fetch, none; React Native fetch-helper, axios-react-query, axios, none (--flavor expo or bare); Android retrofit-hilt, retrofit-koin, retrofit, none (Kotlin, Jetpack Compose, version catalog); React (Vite) fetch-helper, axios, axios-react-query, none; iOS urlsession, none (SwiftUI, Xcode 16 project). The app opens on a demo screen written in the chosen architecture, on sample data. Without the platform creator (flutter, npx) or with --offline, codz writes a minimal project itself; Android, React (Vite) and iOS always use the built-in templates.
|
|
12
|
+
|
|
13
|
+
| Option | |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| `--type <type>` | Project type: flutter, nextjs, react, react-native, android, ios |
|
|
16
|
+
| `--architecture <id>` | Flutter: getx, riverpod, bloc, get_it. Next.js: fetch-helper, plain-fetch. React Native and React: fetch-helper, axios, axios-react-query. Android: retrofit-hilt, retrofit-koin, retrofit. iOS: urlsession |
|
|
17
|
+
| `--base-url <url>` | The API's base URL (setup), or only HAR requests under it (import/sync) |
|
|
18
|
+
| `--org <com.example>` | Organization in reverse-domain form, for app ids (default com.example) |
|
|
19
|
+
| `--tailwind` | Next.js: use Tailwind CSS |
|
|
20
|
+
| `--flavor <expo\|bare>` | React Native: Expo (default) or the React Native CLI |
|
|
21
|
+
| `--primary <#rrggbb>` | The theme's primary color |
|
|
22
|
+
| `--offline` | Do not run the platform's creator; write codz's minimal project |
|
|
23
|
+
| `--no-install` | Do not install dependencies |
|
|
24
|
+
| `--no-git` | Do not run git init |
|
|
25
|
+
|
|
26
|
+
### `codz init [--root <folder>] [--force]`
|
|
27
|
+
|
|
28
|
+
Detect the framework, scan, write codz.config.yaml; offers to set up an API layer when there is none.
|
|
29
|
+
|
|
30
|
+
| Option | |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| `--force` | Do it even when codz would normally refuse (see the command) |
|
|
33
|
+
| `--architecture <id>` | Flutter: getx, riverpod, bloc, get_it. Next.js: fetch-helper, plain-fetch. React Native and React: fetch-helper, axios, axios-react-query. Android: retrofit-hilt, retrofit-koin, retrofit. iOS: urlsession |
|
|
34
|
+
| `--base-url <url>` | The API's base URL (setup), or only HAR requests under it (import/sync) |
|
|
35
|
+
|
|
36
|
+
### `codz setup [--architecture <id>] [--base-url <url>]`
|
|
37
|
+
|
|
38
|
+
Create the API layer for a fresh project.
|
|
39
|
+
|
|
40
|
+
| Option | |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `--architecture <id>` | Flutter: getx, riverpod, bloc, get_it. Next.js: fetch-helper, plain-fetch. React Native and React: fetch-helper, axios, axios-react-query. Android: retrofit-hilt, retrofit-koin, retrofit. iOS: urlsession |
|
|
43
|
+
| `--base-url <url>` | The API's base URL (setup), or only HAR requests under it (import/sync) |
|
|
44
|
+
|
|
45
|
+
Accepts the change options.
|
|
46
|
+
|
|
47
|
+
### `codz explain [--rescan]`
|
|
48
|
+
|
|
49
|
+
Show routes, endpoints, models, locales and conventions.
|
|
50
|
+
|
|
51
|
+
| Option | |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `--rescan` | Scan again instead of using the cached project map |
|
|
54
|
+
|
|
55
|
+
## Endpoints
|
|
56
|
+
|
|
57
|
+
### `codz api add [input] [options]`
|
|
58
|
+
|
|
59
|
+
Add an endpoint: model, function and registration.
|
|
60
|
+
|
|
61
|
+
Input: --curl, --url, --clipboard, or a cURL command or URL pasted on stdin, optionally followed by "response:" and JSON (and "request:" and JSON). A response sample is strongly recommended.
|
|
62
|
+
|
|
63
|
+
| Option | |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| `--curl '<curl command>'` | A cURL command; secrets in it are removed, never written |
|
|
66
|
+
| `--url '<url>'` | A URL (or "POST https://...") |
|
|
67
|
+
| `--method <GET\|POST\|...>` | HTTP method (api add), or only these methods (api import) |
|
|
68
|
+
| `--clipboard` | Read the cURL command (and response) from the clipboard |
|
|
69
|
+
| `--sample <file.json>` | Response sample; repeat for several samples (repeatable) |
|
|
70
|
+
| `--request-sample <file.json>` | Request body sample |
|
|
71
|
+
| `--name <functionName>` | Override the derived function name |
|
|
72
|
+
| `--path </users/{id}>` | Path parameters (api add), route path (screen/route add), or a path filter (import/sync) |
|
|
73
|
+
| `--model-name <Name>` | Name the response model yourself |
|
|
74
|
+
| `--no-unwrap` | Keep a {"data": ...} envelope instead of returning data |
|
|
75
|
+
| `--into <module>` | Call the endpoint from that module's controller (GetX) |
|
|
76
|
+
| `--no-load` | Do not call the load method from onInit |
|
|
77
|
+
|
|
78
|
+
Accepts the change options.
|
|
79
|
+
|
|
80
|
+
### `codz api import <file> [filters]`
|
|
81
|
+
|
|
82
|
+
Add every endpoint from an OpenAPI 3, Swagger 2, Postman or HAR file.
|
|
83
|
+
|
|
84
|
+
| Option | |
|
|
85
|
+
| --- | --- |
|
|
86
|
+
| `--tag <tag>` | Only operations with this tag (folder in Postman, host in HAR) (repeatable) |
|
|
87
|
+
| `--only <name>` | Only these operations (import), or only these checks (doctor) (repeatable) |
|
|
88
|
+
| `--path </users/{id}>` | Path parameters (api add), route path (screen/route add), or a path filter (import/sync) |
|
|
89
|
+
| `--method <GET\|POST\|...>` | HTTP method (api add), or only these methods (api import) |
|
|
90
|
+
| `--max <n>` | Import at most n operations |
|
|
91
|
+
| `--list` | Show what would be imported and stop |
|
|
92
|
+
| `--base-url <url>` | The API's base URL (setup), or only HAR requests under it (import/sync) |
|
|
93
|
+
| `--include-errors` | HAR: keep failed (non-2xx) responses |
|
|
94
|
+
| `--skip-conflicts` | Import what works and report endpoints that cannot be added |
|
|
95
|
+
|
|
96
|
+
Accepts the change options.
|
|
97
|
+
|
|
98
|
+
### `codz api sync <file> [--add] [--remove] [--check]`
|
|
99
|
+
|
|
100
|
+
Bring endpoints in line with an API spec: update changed ones, report breaking changes.
|
|
101
|
+
|
|
102
|
+
| Option | |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| `--add` | Also add operations the project does not have yet |
|
|
105
|
+
| `--remove` | Also delete endpoints the spec no longer has |
|
|
106
|
+
| `--check` | Report drift without writing; exit 1 when out of sync |
|
|
107
|
+
| `--tag <tag>` | Only operations with this tag (folder in Postman, host in HAR) (repeatable) |
|
|
108
|
+
| `--path </users/{id}>` | Path parameters (api add), route path (screen/route add), or a path filter (import/sync) |
|
|
109
|
+
| `--base-url <url>` | The API's base URL (setup), or only HAR requests under it (import/sync) |
|
|
110
|
+
|
|
111
|
+
Accepts the change options.
|
|
112
|
+
|
|
113
|
+
### `codz api diff <old spec> <new spec> [--format md] [--fail-on breaking]`
|
|
114
|
+
|
|
115
|
+
What changed between two API specs, what breaks, and the lines in this project that use it.
|
|
116
|
+
|
|
117
|
+
Breaking: an operation removed, a response field removed or retyped, a new path parameter, a new required request field. Warning: a field that can now be null, a removed query parameter, a retyped request field.
|
|
118
|
+
|
|
119
|
+
Inside a project each change lists the files and lines that use it. Works outside a project too.
|
|
120
|
+
|
|
121
|
+
CI: codz api diff main.yaml pr.yaml --format md --report api-diff.md (exit 1 on breaking changes); --format sarif for GitHub code scanning.
|
|
122
|
+
|
|
123
|
+
| Option | |
|
|
124
|
+
| --- | --- |
|
|
125
|
+
| `--format <text\|md\|json\|sarif>` | Report format (default text; md for a pull request comment, sarif for code scanning) |
|
|
126
|
+
| `--report <file>` | Write the report to a file |
|
|
127
|
+
| `--fail-on <breaking\|warning\|any\|none>` | Exit 1 at this level (default breaking) |
|
|
128
|
+
| `--tag <tag>` | Only operations with this tag (folder in Postman, host in HAR) (repeatable) |
|
|
129
|
+
| `--path </users/{id}>` | Path parameters (api add), route path (screen/route add), or a path filter (import/sync) |
|
|
130
|
+
|
|
131
|
+
### `codz api update <endpoint> --sample <file>`
|
|
132
|
+
|
|
133
|
+
Rebuild the response model from new samples.
|
|
134
|
+
|
|
135
|
+
| Option | |
|
|
136
|
+
| --- | --- |
|
|
137
|
+
| `--sample <file.json>` | Response sample; repeat for several samples (repeatable) |
|
|
138
|
+
| `--no-unwrap` | Keep a {"data": ...} envelope instead of returning data |
|
|
139
|
+
|
|
140
|
+
Accepts the change options.
|
|
141
|
+
|
|
142
|
+
### `codz api remove <endpoint>`
|
|
143
|
+
|
|
144
|
+
Remove an endpoint and list callers that break.
|
|
145
|
+
|
|
146
|
+
Accepts the change options.
|
|
147
|
+
|
|
148
|
+
### `codz api rename <endpoint> <newName>`
|
|
149
|
+
|
|
150
|
+
Rename an endpoint and its call sites.
|
|
151
|
+
|
|
152
|
+
Accepts the change options.
|
|
153
|
+
|
|
154
|
+
### `codz api wire <endpoint> --into <module>`
|
|
155
|
+
|
|
156
|
+
Call an endpoint from a module's controller (GetX).
|
|
157
|
+
|
|
158
|
+
| Option | |
|
|
159
|
+
| --- | --- |
|
|
160
|
+
| `--into <module>` | Call the endpoint from that module's controller (GetX) |
|
|
161
|
+
| `--no-load` | Do not call the load method from onInit |
|
|
162
|
+
|
|
163
|
+
Accepts the change options.
|
|
164
|
+
|
|
165
|
+
### `codz api list [filter]`
|
|
166
|
+
|
|
167
|
+
Every endpoint: method, path, function, response, file.
|
|
168
|
+
|
|
169
|
+
### `codz api show <endpoint>`
|
|
170
|
+
|
|
171
|
+
One endpoint: signature, models, every place that uses it.
|
|
172
|
+
|
|
173
|
+
### `codz mock add <endpoint>... | --all`
|
|
174
|
+
|
|
175
|
+
Mock responses for building screens before the backend.
|
|
176
|
+
|
|
177
|
+
Next.js, React Native and Flutter. Not yet on Android.
|
|
178
|
+
|
|
179
|
+
| Option | |
|
|
180
|
+
| --- | --- |
|
|
181
|
+
| `--all` | Every endpoint (mock add, test add), or every plan (plans clean) |
|
|
182
|
+
| `--sample <file.json>` | Response sample; repeat for several samples (repeatable) |
|
|
183
|
+
| `--keep-values` | Write --sample values exactly as given (no secret or personal-data scrubbing) |
|
|
184
|
+
| `--force` | Do it even when codz would normally refuse (see the command) |
|
|
185
|
+
|
|
186
|
+
Accepts the change options.
|
|
187
|
+
|
|
188
|
+
### `codz test add <endpoint>... | --all`
|
|
189
|
+
|
|
190
|
+
Unit tests for API functions with the network faked.
|
|
191
|
+
|
|
192
|
+
Next.js: Vitest or Jest. React Native: Jest. Flutter: flutter_test with a fake Dio adapter. Android: JUnit with MockWebServer (adds the test dependencies).
|
|
193
|
+
|
|
194
|
+
| Option | |
|
|
195
|
+
| --- | --- |
|
|
196
|
+
| `--all` | Every endpoint (mock add, test add), or every plan (plans clean) |
|
|
197
|
+
|
|
198
|
+
Accepts the change options.
|
|
199
|
+
|
|
200
|
+
## Screens and app
|
|
201
|
+
|
|
202
|
+
### `codz screen add <name> --api <endpoint> [--path /x/:id] [--form]`
|
|
203
|
+
|
|
204
|
+
A working screen (route, page, the call, loading, error, data), or a form with --form.
|
|
205
|
+
|
|
206
|
+
Android: a Compose screen plus a ViewModel (Hilt, Koin or the service locator) with a UiState StateFlow, registered in the NavHost.
|
|
207
|
+
|
|
208
|
+
| Option | |
|
|
209
|
+
| --- | --- |
|
|
210
|
+
| `--api <endpoint>` | Endpoint to load (repeat for several in module add) (repeatable) |
|
|
211
|
+
| `--path </users/{id}>` | Path parameters (api add), route path (screen/route add), or a path filter (import/sync) |
|
|
212
|
+
| `--initial` | Make it the first screen |
|
|
213
|
+
| `--form` | A form that sends the endpoint's request body (POST, PUT, PATCH) |
|
|
214
|
+
|
|
215
|
+
Accepts the change options.
|
|
216
|
+
|
|
217
|
+
### `codz route add <name> [--path /x/:id]`
|
|
218
|
+
|
|
219
|
+
Add a screen and its route (GetX module, GoRoute, Next.js page, React Navigation or Expo Router screen, Compose NavHost entry).
|
|
220
|
+
|
|
221
|
+
| Option | |
|
|
222
|
+
| --- | --- |
|
|
223
|
+
| `--path </users/{id}>` | Path parameters (api add), route path (screen/route add), or a path filter (import/sync) |
|
|
224
|
+
| `--initial` | Make it the first screen |
|
|
225
|
+
|
|
226
|
+
Accepts the change options.
|
|
227
|
+
|
|
228
|
+
### `codz feature add <name> --spec <file> | --api <endpoint>...`
|
|
229
|
+
|
|
230
|
+
A whole feature in one change: endpoints, list, detail, create and edit screens, routes and tests.
|
|
231
|
+
|
|
232
|
+
A project with no API layer yet is set up first, in the same change: the recommended architecture (or --architecture), with the base URL from --base-url or the spec.
|
|
233
|
+
|
|
234
|
+
Without --tag or --path, the endpoints are those whose path or tag names the feature (orders: /orders, /orders/{id}, /users/{id}/orders).
|
|
235
|
+
|
|
236
|
+
Screens: a list for a GET that returns a list, a detail for a GET with an id, a create form for a POST with a body, an edit form for a PUT or PATCH with a body. Other endpoints are added and listed.
|
|
237
|
+
|
|
238
|
+
Everything is planned in a private copy of the project and shown as one diff: one apply, one undo.
|
|
239
|
+
|
|
240
|
+
| Option | |
|
|
241
|
+
| --- | --- |
|
|
242
|
+
| `--spec <file>` | OpenAPI, Swagger, Postman or HAR file to take the endpoints from |
|
|
243
|
+
| `--tag <tag>` | Only operations with this tag (folder in Postman, host in HAR) (repeatable) |
|
|
244
|
+
| `--path </users/{id}>` | Path parameters (api add), route path (screen/route add), or a path filter (import/sync) |
|
|
245
|
+
| `--api <endpoint>` | Endpoint to load (repeat for several in module add) (repeatable) |
|
|
246
|
+
| `--base-url <url>` | The API's base URL (setup), or only HAR requests under it (import/sync) |
|
|
247
|
+
| `--architecture <id>` | Flutter: getx, riverpod, bloc, get_it. Next.js: fetch-helper, plain-fetch. React Native and React: fetch-helper, axios, axios-react-query. Android: retrofit-hilt, retrofit-koin, retrofit. iOS: urlsession |
|
|
248
|
+
| `--initial` | Make it the first screen |
|
|
249
|
+
| `--no-forms` | No create or edit form screens |
|
|
250
|
+
| `--no-tests` | Do not generate tests |
|
|
251
|
+
| `--skip-conflicts` | Import what works and report endpoints that cannot be added |
|
|
252
|
+
| `--no-install` | Do not install dependencies |
|
|
253
|
+
|
|
254
|
+
Accepts the change options.
|
|
255
|
+
|
|
256
|
+
### `codz auth add [--login-path /auth/login] [--me-path /auth/me]`
|
|
257
|
+
|
|
258
|
+
Sign-in for this project: secure token storage, the token on every request, sign out on 401, a login screen and a guard.
|
|
259
|
+
|
|
260
|
+
Next.js: server actions, an HttpOnly session cookie, middleware that sends signed-out visitors to /login, withAuth() for server calls.
|
|
261
|
+
|
|
262
|
+
React Native: expo-secure-store (or react-native-keychain), the fetch helper or axios sends the token, AuthProvider and useAuth().
|
|
263
|
+
|
|
264
|
+
Flutter: flutter_secure_storage, a Dio interceptor (refresh or sign out on 401), AuthService, a go_router redirect.
|
|
265
|
+
|
|
266
|
+
Android (Hilt): EncryptedSharedPreferences, an OkHttp interceptor, AuthApi, AuthRepository, a login screen with a ViewModel.
|
|
267
|
+
|
|
268
|
+
| Option | |
|
|
269
|
+
| --- | --- |
|
|
270
|
+
| `--login-path </auth/login>` | Sign-in endpoint: POST { email, password }, answers with the token (default /auth/login) |
|
|
271
|
+
| `--me-path </auth/me>` | Endpoint that returns the signed-in user (default /auth/me) |
|
|
272
|
+
| `--logout-path </auth/logout>` | Sign-out endpoint, called on sign out (default /auth/logout) |
|
|
273
|
+
| `--refresh-path </auth/refresh>` | Refresh endpoint: POST { refreshToken }; with it a 401 tries one refresh first (Flutter, React Native) |
|
|
274
|
+
| `--token-field <name>` | Field of the login answer with the token (default token) |
|
|
275
|
+
| `--refresh-field <name>` | Field with the refresh token (default refreshToken) |
|
|
276
|
+
| `--public </about>` | Next.js: a page that stays public (besides /login) (repeatable) |
|
|
277
|
+
|
|
278
|
+
Accepts the change options.
|
|
279
|
+
|
|
280
|
+
### `codz module add <name> [--api <endpoint>]`
|
|
281
|
+
|
|
282
|
+
Create a GetX module: binding, controller, view, route.
|
|
283
|
+
|
|
284
|
+
| Option | |
|
|
285
|
+
| --- | --- |
|
|
286
|
+
| `--api <endpoint>` | Endpoint to load (repeat for several in module add) (repeatable) |
|
|
287
|
+
| `--initial` | Make it the first screen |
|
|
288
|
+
| `--no-load` | Do not call the load method from onInit |
|
|
289
|
+
|
|
290
|
+
Accepts the change options.
|
|
291
|
+
|
|
292
|
+
### `codz locale add <lang> [--from en]`
|
|
293
|
+
|
|
294
|
+
Add a language: copies every key from the default one.
|
|
295
|
+
|
|
296
|
+
| Option | |
|
|
297
|
+
| --- | --- |
|
|
298
|
+
| `--from <lang>` | Language to copy keys from (default: the default language) |
|
|
299
|
+
|
|
300
|
+
Accepts the change options.
|
|
301
|
+
|
|
302
|
+
### `codz locale key <key> "<text>" [--value hi="..."]`
|
|
303
|
+
|
|
304
|
+
Add a text key to every language file.
|
|
305
|
+
|
|
306
|
+
| Option | |
|
|
307
|
+
| --- | --- |
|
|
308
|
+
| `--value lang="text"` | Text for one more language; repeat for several (repeatable) |
|
|
309
|
+
| `--force` | Do it even when codz would normally refuse (see the command) |
|
|
310
|
+
|
|
311
|
+
Accepts the change options.
|
|
312
|
+
|
|
313
|
+
### `codz theme set <name> <value> [...]`
|
|
314
|
+
|
|
315
|
+
Set a color (#hex), size (number) or font in the app theme.
|
|
316
|
+
|
|
317
|
+
Example: codz theme set primary "#6750A4" radius 12 font Inter
|
|
318
|
+
|
|
319
|
+
Accepts the change options.
|
|
320
|
+
|
|
321
|
+
### `codz templates list`
|
|
322
|
+
|
|
323
|
+
Which templates the project customizes.
|
|
324
|
+
|
|
325
|
+
### `codz templates init [id...]`
|
|
326
|
+
|
|
327
|
+
Start custom templates from files that reproduce codz's output.
|
|
328
|
+
|
|
329
|
+
Accepts the change options.
|
|
330
|
+
|
|
331
|
+
## Health
|
|
332
|
+
|
|
333
|
+
### `codz report [--json]`
|
|
334
|
+
|
|
335
|
+
Usage summary for beta feedback: commands run, changes applied and undone, errors; no code, file names or URLs.
|
|
336
|
+
|
|
337
|
+
Built from .codz/history.json and .codz/events.jsonl, which stay on this machine. CODZ_NO_EVENTS=1 stops recording commands.
|
|
338
|
+
|
|
339
|
+
### `codz doctor [--only locales,api,urls,models] [--strict] [--fix] [--setup]`
|
|
340
|
+
|
|
341
|
+
Check locales, unhandled API errors, untyped responses, hardcoded URLs and unused models.
|
|
342
|
+
|
|
343
|
+
Exit 1 on errors (--strict: on warnings too). --fix repairs what is safe (missing locale keys, base-URL literals, unused models) as one previewed change. --setup checks Node, git, the config, the formatter and the analyzer instead.
|
|
344
|
+
|
|
345
|
+
| Option | |
|
|
346
|
+
| --- | --- |
|
|
347
|
+
| `--only <name>` | Only these operations (import), or only these checks (doctor) (repeatable) |
|
|
348
|
+
| `--strict` | Exit 1 on warnings too |
|
|
349
|
+
| `--fix` | Repair what is safe as one previewed change; list the rest |
|
|
350
|
+
| `--setup` | Check that codz can run here: Node, git, config, formatter, analyzer |
|
|
351
|
+
| `--force` | Do it even when codz would normally refuse (see the command) |
|
|
352
|
+
|
|
353
|
+
Accepts the change options.
|
|
354
|
+
|
|
355
|
+
### `codz check`
|
|
356
|
+
|
|
357
|
+
CI gate: config check + doctor; exit 1 on any error or warning.
|
|
358
|
+
|
|
359
|
+
## Setup
|
|
360
|
+
|
|
361
|
+
### `codz config show`
|
|
362
|
+
|
|
363
|
+
The conventions codz uses, and where each came from.
|
|
364
|
+
|
|
365
|
+
### `codz config get <key>`
|
|
366
|
+
|
|
367
|
+
One convention.
|
|
368
|
+
|
|
369
|
+
### `codz config set <key> <value>`
|
|
370
|
+
|
|
371
|
+
Change one convention in codz.config.yaml ('' = detect).
|
|
372
|
+
|
|
373
|
+
| Option | |
|
|
374
|
+
| --- | --- |
|
|
375
|
+
| `--force` | Do it even when codz would normally refuse (see the command) |
|
|
376
|
+
|
|
377
|
+
Accepts the change options.
|
|
378
|
+
|
|
379
|
+
### `codz config check`
|
|
380
|
+
|
|
381
|
+
Find problems in codz.config.yaml (exit 1 on errors).
|
|
382
|
+
|
|
383
|
+
### `codz mcp [--cwd <project>]`
|
|
384
|
+
|
|
385
|
+
Serve codz to AI agents and editors over the Model Context Protocol (stdio).
|
|
386
|
+
|
|
387
|
+
Every command becomes a tool (api add → api_add). Tools that edit code return a diff and a plan id; the apply tool applies it. Resources: codz://project and codz://commands.
|
|
388
|
+
|
|
389
|
+
### `codz completion bash|zsh|fish`
|
|
390
|
+
|
|
391
|
+
Print the shell completion script.
|
|
392
|
+
|
|
393
|
+
## Starters (online)
|
|
394
|
+
|
|
395
|
+
### `codz new [name] --template <id[@version]|folder>`
|
|
396
|
+
|
|
397
|
+
Create a project from a ready-made starter: from the catalog (free or bought) or a template folder.
|
|
398
|
+
|
|
399
|
+
Shows every file and step first, then creates the folder in one step; codz undo inside the new project removes it again while it is unchanged. Catalog starters are checked against the signed catalog, and template scripts never run. Next: cd <name> && codz init.
|
|
400
|
+
|
|
401
|
+
This and the other starter commands are the only ones that use the network, and only to reach the starter catalog.
|
|
402
|
+
|
|
403
|
+
| Option | |
|
|
404
|
+
| --- | --- |
|
|
405
|
+
| `--template <id[@version]\|folder>` | The starter: a catalog id (pin a version with @x.y.z) or a template folder |
|
|
406
|
+
| `--org <com.example>` | Organization in reverse-domain form, for app ids (default com.example) |
|
|
407
|
+
| `--dir <folder>` | Parent folder for the new project (default: the current folder) |
|
|
408
|
+
| `--set <key=value>` | Answer one of the starter's questions; repeat for more (repeatable) |
|
|
409
|
+
| `--framework <name>` | Only starters for this framework |
|
|
410
|
+
| `--state <name>` | Only starters with this state management (riverpod, get_it, ...) |
|
|
411
|
+
| `--router <name>` | Only starters with this router (go_router, ...) |
|
|
412
|
+
| `--http <name>` | Only starters with this HTTP client (dio, fetch, ...) |
|
|
413
|
+
| `--cached` | Use only starters and the catalog already downloaded on this machine (no network) |
|
|
414
|
+
| `--no-steps` | Skip the setup steps after creating (flutter pub get, dart format, npm install) |
|
|
415
|
+
|
|
416
|
+
### `codz starters list [--framework flutter] [--free] [--owned]`
|
|
417
|
+
|
|
418
|
+
Starters in the catalog: id, latest version, framework, price, api add support.
|
|
419
|
+
|
|
420
|
+
| Option | |
|
|
421
|
+
| --- | --- |
|
|
422
|
+
| `--framework <name>` | Only starters for this framework |
|
|
423
|
+
| `--state <name>` | Only starters with this state management (riverpod, get_it, ...) |
|
|
424
|
+
| `--router <name>` | Only starters with this router (go_router, ...) |
|
|
425
|
+
| `--http <name>` | Only starters with this HTTP client (dio, fetch, ...) |
|
|
426
|
+
| `--owned` | Only starters your account owns (and free ones) |
|
|
427
|
+
| `--free` | Only free starters |
|
|
428
|
+
| `--refresh` | Download the catalog again even if it has not changed |
|
|
429
|
+
| `--cached` | Use only starters and the catalog already downloaded on this machine (no network) |
|
|
430
|
+
|
|
431
|
+
### `codz starters show <id>[@version]`
|
|
432
|
+
|
|
433
|
+
One starter: what it includes beyond codz create, tested SDKs, license, versions.
|
|
434
|
+
|
|
435
|
+
| Option | |
|
|
436
|
+
| --- | --- |
|
|
437
|
+
| `--refresh` | Download the catalog again even if it has not changed |
|
|
438
|
+
| `--cached` | Use only starters and the catalog already downloaded on this machine (no network) |
|
|
439
|
+
|
|
440
|
+
### `codz starters cache [--clear]`
|
|
441
|
+
|
|
442
|
+
Starters downloaded on this machine (--clear deletes them).
|
|
443
|
+
|
|
444
|
+
| Option | |
|
|
445
|
+
| --- | --- |
|
|
446
|
+
| `--clear` | Delete every downloaded starter |
|
|
447
|
+
|
|
448
|
+
### `codz login [--no-browser]`
|
|
449
|
+
|
|
450
|
+
Log in to the starter catalog (prints a code to approve in the browser); needed only for paid starters.
|
|
451
|
+
|
|
452
|
+
The token is kept in ~/.codz/auth.json, readable only by you. In CI, set CODZ_TOKEN instead.
|
|
453
|
+
|
|
454
|
+
| Option | |
|
|
455
|
+
| --- | --- |
|
|
456
|
+
| `--no-browser` | Do not open the login page; print it only |
|
|
457
|
+
|
|
458
|
+
### `codz logout`
|
|
459
|
+
|
|
460
|
+
Log out: delete the token here and revoke it on the server.
|
|
461
|
+
|
|
462
|
+
### `codz whoami`
|
|
463
|
+
|
|
464
|
+
The logged-in account and the starters it owns.
|
|
465
|
+
|
|
466
|
+
## Changes
|
|
467
|
+
|
|
468
|
+
### `codz plans list`
|
|
469
|
+
|
|
470
|
+
Plans saved with --plan: ready, applied or stale.
|
|
471
|
+
|
|
472
|
+
### `codz plans show <id>`
|
|
473
|
+
|
|
474
|
+
One plan's summary and diff.
|
|
475
|
+
|
|
476
|
+
### `codz plans clean [--all]`
|
|
477
|
+
|
|
478
|
+
Delete applied and stale plans (--all: every plan).
|
|
479
|
+
|
|
480
|
+
| Option | |
|
|
481
|
+
| --- | --- |
|
|
482
|
+
| `--all` | Every endpoint (mock add, test add), or every plan (plans clean) |
|
|
483
|
+
|
|
484
|
+
### `codz apply <plan-id>`
|
|
485
|
+
|
|
486
|
+
Apply a plan saved with --plan, exactly as previewed.
|
|
487
|
+
|
|
488
|
+
### `codz undo [--to <id>] [--force]`
|
|
489
|
+
|
|
490
|
+
Revert the last applied change (or every change back to <id>).
|
|
491
|
+
|
|
492
|
+
| Option | |
|
|
493
|
+
| --- | --- |
|
|
494
|
+
| `--to <id>` | Undo every change back to and including <id> |
|
|
495
|
+
| `--force` | Do it even when codz would normally refuse (see the command) |
|
|
496
|
+
|
|
497
|
+
### `codz history [show <id>]`
|
|
498
|
+
|
|
499
|
+
List applied changes, or show one change's files and diff.
|
|
500
|
+
|
|
501
|
+
## Change options
|
|
502
|
+
|
|
503
|
+
| Option | |
|
|
504
|
+
| --- | --- |
|
|
505
|
+
| `--dry-run` | Show the diff only |
|
|
506
|
+
| `--plan` | Save the diff as a plan and print its id (apply later with codz apply) |
|
|
507
|
+
| `--yes` | Apply without asking |
|
|
508
|
+
| `--y` | Same as --yes |
|
|
509
|
+
| `--allow-dirty` | Apply even if git has uncommitted changes |
|
|
510
|
+
| `--no-format` | Do not run the project's formatter |
|
|
511
|
+
| `--no-verify` | Do not run the project's analyzer after applying |
|
|
512
|
+
| `--commit` | Commit the applied files |
|
|
513
|
+
| `--commit-message <text>` | Message for --commit (default: one from the summary) |
|
|
514
|
+
| `--open` | Open the diff in $EDITOR before asking |
|
|
515
|
+
|
|
516
|
+
## Global options
|
|
517
|
+
|
|
518
|
+
| Option | |
|
|
519
|
+
| --- | --- |
|
|
520
|
+
| `--json` | Machine-readable output on stdout (for scripts and AI agents) |
|
|
521
|
+
| `--cwd <folder>` | Run as if started in <folder> |
|
|
522
|
+
| `--root <folder>` | Project root (monorepos: which project) |
|
|
523
|
+
| `--no-color` | Plain output |
|
|
524
|
+
| `--help` | Show help (for one command: codz <command> --help) |
|
|
525
|
+
| `--h` | Same as --help |
|
|
526
|
+
| `--version` | Print the version |
|
|
527
|
+
| `--v` | Same as --version |
|