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/BETA.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# codz beta: quick start
|
|
2
|
+
|
|
3
|
+
Thanks for trying codz. It writes the repetitive parts of an app that talks to an API (models, API functions, screens, routes, tests, sign-in) in the style your project already uses. Every change is shown as a diff first, and `codz undo` takes it back.
|
|
4
|
+
|
|
5
|
+
This is a beta. It will get some things wrong, and that is exactly what we want to hear about.
|
|
6
|
+
|
|
7
|
+
## 1. Install (2 minutes)
|
|
8
|
+
|
|
9
|
+
You need Node.js 20 or newer (22 recommended) and git.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g codz-cli # the command is `codz`
|
|
13
|
+
codz --version
|
|
14
|
+
codz doctor --setup # checks Node, git, your formatter and analyzer
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 2. Before you start
|
|
18
|
+
|
|
19
|
+
- **Work on a branch.** `git switch -c try-codz`. codz refuses to write over uncommitted changes unless you pass `--allow-dirty`.
|
|
20
|
+
- **Nothing is written until you say yes.** Every command shows the diff and asks. `--dry-run` only shows it.
|
|
21
|
+
- **Undo is always there.** `codz undo` restores the files from codz's own backups, even without git. `codz history` lists what was applied.
|
|
22
|
+
- **No network, no telemetry.** codz works on your files only. It keeps a small log of which commands ran in `.codz/` so you can send us a report (step 6); nothing is sent by itself.
|
|
23
|
+
|
|
24
|
+
## 3. The first 10 minutes
|
|
25
|
+
|
|
26
|
+
In your app's folder:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
codz init # detects the framework and conventions
|
|
30
|
+
codz explain # what codz understood about the project
|
|
31
|
+
codz feature add products --spec "$(npm root -g)/codz-cli/examples/openapi.yaml"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`feature add` adds the endpoints, a list, detail, create and edit screen, links them and writes tests, as one change. If your project has no API layer yet, it sets one up first in your framework's usual style (choose another with `--architecture`).
|
|
35
|
+
|
|
36
|
+
Run the app and look at the new screens. Then take it all back:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
codz undo
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 4. Then try it on your own API
|
|
43
|
+
|
|
44
|
+
| Try | Command |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| A whole feature from your OpenAPI / Swagger / Postman file | `codz feature add orders --spec your-api.yaml` |
|
|
47
|
+
| One endpoint from a cURL command | `codz api add` and paste the cURL (and a response sample) |
|
|
48
|
+
| One more screen | `codz screen add order-details --api getOrder --path /orders/:id` |
|
|
49
|
+
| Sign-in | `codz auth add` |
|
|
50
|
+
| Keep up with API changes | `codz api sync your-api.yaml --check` |
|
|
51
|
+
| What changed between two spec versions, and where you use it | `codz api diff old.yaml new.yaml` |
|
|
52
|
+
| Find problems | `codz doctor` |
|
|
53
|
+
|
|
54
|
+
`codz help <command>` explains any command and its options.
|
|
55
|
+
|
|
56
|
+
## 5. What is ready, and what is new
|
|
57
|
+
|
|
58
|
+
| Platform | Status |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| Next.js (App Router) | Stable |
|
|
61
|
+
| React Native (Expo or CLI; React Navigation or Expo Router) | Stable |
|
|
62
|
+
| Flutter (Riverpod, Bloc, get_it, GetX) | Stable |
|
|
63
|
+
| Android with Jetpack Compose (Hilt, Koin or none) | Stable |
|
|
64
|
+
| React web apps (Vite or Create React App) | Experimental |
|
|
65
|
+
| Android with XML layouts (Activities) | Experimental |
|
|
66
|
+
| iOS with SwiftUI | Experimental |
|
|
67
|
+
|
|
68
|
+
Known gaps: forms for nested data (an order with line items) are skipped; iOS has no `test add`, `mock add` or `auth add`; UIKit and Fragments are not supported.
|
|
69
|
+
|
|
70
|
+
## 6. Tell us how it went
|
|
71
|
+
|
|
72
|
+
After a few days of use, in each project you tried it on:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
codz report
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
It prints counts only: commands run, changes applied and undone, errors, and your setup (framework, HTTP client, router). No code, file names, endpoint paths or URLs. Paste it into the feedback form with your answers to:
|
|
79
|
+
|
|
80
|
+
1. What did you use codz for?
|
|
81
|
+
2. Roughly how much time did it save you (or cost you)?
|
|
82
|
+
3. What did it get wrong, or what did you have to fix by hand?
|
|
83
|
+
4. Would you keep using it? Why or why not?
|
|
84
|
+
5. What is the one thing it should do next?
|
|
85
|
+
|
|
86
|
+
## When something goes wrong
|
|
87
|
+
|
|
88
|
+
- Read the message and the line under it: it says what happened and what to do.
|
|
89
|
+
- `codz undo` puts the files back. If you edited them since, it asks before overwriting (`--force`).
|
|
90
|
+
- For a crash ("This is a codz bug"), run the command again with `CODZ_DEBUG=1` and send us the output.
|
|
91
|
+
- `CODZ_NO_EVENTS=1` stops codz from logging which commands ran.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pradeep Pandey
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|