@@ -249,25 +249,79 @@ coldbox apidocs
249249
250250Most commands support these common options:
251251
252- - ` --force ` - Overwrite existing files
252+ - ` --force ` - Overwrite existing files without prompting
253253- ` --open ` - Open generated files in your default editor
254- - ` --boxlang ` - Generate BoxLang code instead of CFML
254+ - ` --boxlang ` - Force BoxLang code generation (overrides auto-detection)
255+ - ` --!boxlang ` - Force CFML code generation (overrides auto-detection)
255256- ` --help ` - Show detailed help for any command
256257
258+ #### Language Generation Control
259+
260+ The CLI supports both automatic detection and manual override of the target language:
261+
262+ - ** Automatic** : Uses detection methods (server engine, ` box.json ` settings)
263+ - ** Force BoxLang** : Use ` --boxlang ` flag to generate BoxLang code regardless of detection
264+ - ** Force CFML** : Use ` --!boxlang ` flag to generate CFML code regardless of detection
265+
257266### 💡 BoxLang Support
258267
259- The CLI automatically detects BoxLang projects and generates appropriate code. You can also force BoxLang mode:
268+ The CLI automatically detects BoxLang projects and generates appropriate code. You can also force BoxLang mode using the ` --boxlang ` flag.
269+
270+ #### 🔍 Automatic Detection
271+
272+ The CLI detects BoxLang projects using three methods (in order of precedence):
273+
274+ 1 . ** Server Engine Detection** : Running on a BoxLang server
275+ 2 . ** TestBox Runner Setting** : When ` testbox.runner ` is set to ` "boxlang" ` in ` box.json `
276+ 3 . ** Language Property** : When ` language ` is set to ` "boxlang" ` in ` box.json `
277+
278+ #### ⚙️ Configuration Examples
279+
280+ ##### Method 1: Language Property (Recommended)
281+
282+ ``` json
283+ {
284+ "name" : " My BoxLang App" ,
285+ "language" : " boxlang" ,
286+ "testbox" : {
287+ "runner" : " /tests/runner.bxm"
288+ }
289+ }
290+ ```
291+
292+ ##### Method 2: TestBox Runner Setting
293+
294+ ``` json
295+ {
296+ "name" : " My App" ,
297+ "testbox" : {
298+ "runner" : " boxlang"
299+ }
300+ }
301+ ```
302+
303+ #### 🚀 Usage Examples
260304
261305``` bash
262- # Force BoxLang generation
306+ # Automatic detection (uses box.json settings)
307+ coldbox create handler users
308+
309+ # Force BoxLang generation (overrides detection)
263310coldbox create handler users --boxlang
264311
265- # BoxLang project detection based on:
266- # - Server engine (BoxLang)
267- # - package.json testbox.runner setting
268- # - package.json language property
312+ # Force CFML generation (overrides detection)
313+ coldbox create handler users --! boxlang
269314```
270315
316+ #### 📝 Generated Code Differences
317+
318+ When BoxLang mode is detected or forced:
319+
320+ - Uses ` .bx ` file extensions instead of ` .cfc `
321+ - Generates ` class ` syntax instead of ` component `
322+ - Uses BoxLang-specific template variants
323+ - Creates BoxLang test files (` .bxm ` extensions)
324+
271325### 📖 Getting Help
272326
273327Every command provides detailed help:
0 commit comments