A powerful command-line tool to generate RocketModel classes from JSON data.
- Generate models from raw JSON strings.
- Generate models from JSON files.
- Automatically handles nested objects and lists.
- Supports custom class names and output directories.
You can run it directly using dart run within the package:
dart run rocket_cli [arguments]Or activate it globally:
dart pub global activate --source path .
rocket_cli [arguments]rocket_cli -f data.json -n UserProfile -o lib/modelsrocket_cli -j '{"id":1, "name":"John"}' -n User| Argument | Abbr | Description | Default |
|---|---|---|---|
--json |
-j |
Raw JSON string | |
--file |
-f |
Path to JSON file | |
--name |
-n |
Root class name | MyModel |
--output |
-o |
Output directory | lib/models |
--help |
-h |
Show help |