Commit 9d023b6
authored
refactor: restructure CLI command hierarchy and remove slug parameter (#44)
* refactor: remove slug parameter from CLI, enforce title-first workflow
- Remove slug parameter from CLI arguments (dot <slug>)
- Remove slug from Create and RecipeCommands::New commands
- Update handle_create to only accept title, auto-generate slug
- Update non-interactive mode to require --title instead of slug
- Update README to remove outdated CLI examples
- Remove macOS Intel from README installation instructions
- Enforce consistent title-first workflow across all interfaces
This simplifies the CLI interface and ensures slugs are always
auto-generated from titles, reducing user confusion and errors.
* refactor: restructure CLI command hierarchy for scalability
Make CLI future-proof by requiring explicit subcommands:
Breaking changes:
- Remove `dot` with no args (now requires subcommand)
- Remove `dot create` command
- Remove slug parameter entirely from CLI and SDK
- Rename `dot recipe new` to `dot recipe create`
Changes:
- Make command field required (not optional) in Cli struct
- Move all recipe creation arguments to global scope
- Enforce title-first workflow (slug auto-generated)
- Reserve top-level namespace for cross-cutting commands only
Users must now use:
- `dot recipe create` instead of `dot` or `dot create`
- `--title` is required in non-interactive mode
This change prepares the CLI for future non-recipe features while
maintaining a clean, predictable command structure.
* docs: update all documentation for new CLI command structure
Update documentation to reflect the refactored command hierarchy:
Changes:
- Replace `dot` and `dot create` with `dot recipe create`
- Replace slug parameters with --title flag
- Update macOS binary names to user-friendly versions
- Update command examples in all docs
- Add comprehensive command list to architecture.md
- Update non-interactive examples to require --title
Files updated:
- README.md: Updated CLI usage examples
- CONTRIBUTING.md: Updated installation and command reference
- cli/README.md: Complete rewrite of commands and examples
- docs/architecture.md: Updated CLI commands section
- docs/testing.md: Updated test recipe creation
- core/VERSION_MANAGEMENT.md: Updated scaffolding example
All documentation now accurately reflects the new command structure
where `dot recipe create` is the canonical way to create recipes.
* test: update CLI integration tests for new command structure
Update all CLI integration tests to use the new command hierarchy:
Changes:
- Replace `dot <slug>` with `dot recipe create --title "..."`
- Replace `dot create <slug>` with `dot recipe create --title "..."`
- Update help text assertion (removed "Polkadot Cookbook")
- Update error message assertions (slug → title)
- Use valid titles that pass validation rules
- Remove slug validation tests (no longer relevant)
- Keep empty test placeholders for future title validation
All 13 tests now pass with the new command structure.
* ci: update SDK workflow for new CLI command structure
Update test-sdk.yml to use the new CLI command hierarchy:
Changes:
- Rename "Test CLI - Valid slug" to "Test CLI - Valid recipe creation"
- Update command: `dot test-ci-valid` → `dot recipe create --title "Testing CLI Validation"`
- Rename "Test CLI - Invalid slug" to "Test CLI - Missing required title"
- Update validation test to check for missing --title flag instead of invalid slug
The workflow now tests the new command structure where recipe creation
requires `dot recipe create --title "..."` instead of `dot <slug>`.1 parent 059bd12 commit 9d023b6
File tree
9 files changed
+185
-262
lines changed- .github/workflows
- cli
- src
- tests
- core
- docs
9 files changed
+185
-262
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
308 | | - | |
| 307 | + | |
| 308 | + | |
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
313 | 313 | | |
314 | | - | |
| 314 | + | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
318 | | - | |
| 317 | + | |
| 318 | + | |
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 32 | | |
37 | | - | |
| 33 | + | |
38 | 34 | | |
39 | 35 | | |
40 | 36 | | |
| |||
63 | 59 | | |
64 | 60 | | |
65 | 61 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 62 | + | |
70 | 63 | | |
71 | 64 | | |
72 | 65 | | |
| |||
149 | 142 | | |
150 | 143 | | |
151 | 144 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
157 | 148 | | |
158 | | - | |
159 | | - | |
| 149 | + | |
| 150 | + | |
160 | 151 | | |
161 | 152 | | |
162 | | - | |
163 | | - | |
| 153 | + | |
164 | 154 | | |
165 | 155 | | |
166 | 156 | | |
167 | | - | |
| 157 | + | |
| 158 | + | |
168 | 159 | | |
169 | 160 | | |
170 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | 111 | | |
116 | | - | |
| 112 | + | |
117 | 113 | | |
118 | 114 | | |
119 | 115 | | |
| |||
132 | 128 | | |
133 | 129 | | |
134 | 130 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 131 | + | |
139 | 132 | | |
140 | 133 | | |
141 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | | - | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
| 78 | + | |
78 | 79 | | |
79 | | - | |
80 | | - | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | | - | |
| 84 | + | |
84 | 85 | | |
85 | | - | |
86 | | - | |
| 86 | + | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
163 | | - | |
| 164 | + | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
| |||
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
188 | | - | |
| 189 | + | |
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| |||
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
234 | | - | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | | - | |
| 238 | + | |
238 | 239 | | |
239 | | - | |
| 240 | + | |
240 | 241 | | |
241 | | - | |
| 242 | + | |
242 | 243 | | |
243 | 244 | | |
244 | | - | |
| 245 | + | |
245 | 246 | | |
246 | 247 | | |
247 | 248 | | |
| |||
0 commit comments