### Get help for a command Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/getting-started-guide.md Example of getting context-specific help for the 'version' command. ```bash CommandBox> version help ``` -------------------------------- ### Install ColdBox MVC Platform Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/getting-started-guide.md Installs the ColdBox MVC Platform using the CommandBox package manager. ```bash CommandBox> install coldbox ``` -------------------------------- ### Install the module Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/developing-for-commandbox/example-project.md This command installs the commandbox-banner-customizer module. ```bash CommandBox> install commandbox-banner-customizer ``` -------------------------------- ### Start the Embedded Server Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/getting-started-guide.md Starts an ad-hoc embedded server in the current directory. ```bash CommandBox> start ``` -------------------------------- ### Package Installation Examples Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/README.md Examples of how to install packages from different types of endpoints using the CommandBox CLI. ```bash install coldbox@3.8.1 install http://www.site.com/myPackage.zip install /var/libs/myPackage.zip install /var/libs/myPackage/ install git://github.com/username/repoName.git#v1.5.6 ``` -------------------------------- ### Example Recipe: buildSite.boxr Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/usage/execution/recipes.md A sample recipe file demonstrating common commands for initializing a project, installing dependencies, and starting a server. ```bash # Start with an empty folder rm mySite --recurse --force mkdir mySite cd mySite # Initialize this folder as a package init name=mySite version=1.0.0 slug=mySlug # Scaffold out a site and a handler coldbox create app mySite coldbox create handler myHandler index # Add some required package install coldbox install cbmessagebox,cbstorages,cbvalidation # Set the default port package set defaultPort=8081 # Start up the embedded server start ``` -------------------------------- ### Running the 'server start' command Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/developing-for-commandbox/commands/running-other-commands.md Example of running the 'server start' command. ```javascript command( 'server start' ) .run(); ``` -------------------------------- ### CFML REPL Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/getting-started-guide.md Example of using the CFML REPL to execute CFML code snippets. ```cfml fruits = [ 'apples', 'oranges' ] fruits.append( 'bananas' ) ( fruits.len() ? 'Start eating!' : 'Time to run to the store' ) for( fruit in fruits ) { echo( fruit & chr(10) ) } ``` -------------------------------- ### Install module from local path, GitHub, or Forgebox Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/developing-for-commandbox/modules/installation-and-locations.md Examples of installing a module from different sources. ```bash install /path/to/module install githubuser/modulerepo install forgebox-module-slug ``` -------------------------------- ### Smart Installation Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/installing-packages/advanced-installation.md Demonstrates how CommandBox avoids redundant installations by checking for existing dependencies at higher levels in the hierarchy. ```bash install cbi18n install cbvalidation ``` -------------------------------- ### Flags for install command Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/developing-for-commandbox/commands/running-other-commands.md Example of using flags with the 'install' command. ```javascript command( "install" ) .params( 'coldbox' ) .flags( 'force', '!save' ) .run(); ``` -------------------------------- ### Install and Start FusionReactor Module Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/fusionreactor.md Installs the CommandBox FusionReactor module and starts a server. ```bash install commandbox-fusionreactor server start ``` -------------------------------- ### command() Examples Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/task-runners/running-other-commands.md Examples of using the command() method to run 'info' and 'server start'. ```javascript command( 'info' ) .run(); command( 'server start' ) .run(); ``` -------------------------------- ### ColdBox Installation Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/cflib.md Demonstrates how to install a UDF using the `cflib-coldbox` endpoint for ColdBox projects. ```bash install cflib-coldbox:AreaParallelogram ``` -------------------------------- ### Create and Navigate to Playground Directory Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/getting-started-guide.md Creates a directory named 'playground' and then changes the current directory to it. ```bash CommandBox> mkdir C:\playground CommandBox> cd C:\playground ``` -------------------------------- ### Installation from Git Repos Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/git.md Examples of installing packages directly from Git repository URLs. ```bash install git://github.com/username/repoName.git install git+https://github.com/username/repoName.git install git+ssh://git@github.com:username/repoName.git ``` -------------------------------- ### Create a ColdBox Application Skeleton Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/getting-started-guide.md Uses the ColdBox generator to create a new application named 'MyApp'. ```bash CommandBox> coldbox create app MyApp ``` -------------------------------- ### Standard Installation Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/cflib.md Demonstrates how to install a UDF from CFLib using its slug and shows the resulting file structure. ```bash install cflib:AreaParallelogram ``` -------------------------------- ### Check version from OS shell Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/getting-started-guide.md Example of checking the CommandBox version from the operating system's native shell. ```bash C:\ > box version CommandBox 1.2.3.00000 C:\ > _ ``` -------------------------------- ### Search for Packages on ForgeBox Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/getting-started-guide.md Searches ForgeBox for packages published by a specific user. ```bash CommandBox> forgebox search lmajano ``` -------------------------------- ### Install Snapshot Version Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/artifacts.md Example of installing a snapshot package version. ```bash install myPackage@1.2.3-snapshot ``` -------------------------------- ### systemd Service File Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/starting-as-a-service.md Example of a systemd service file for starting a CommandBox server on CentOS/RHEL/Ubuntu. ```bash [Unit] Description=mySite Service [Service] ExecStart=/usr/local/bin/box server start /var/www/mySiteAPI/server.json Type=forking [Install] WantedBy=multi-user.target ``` -------------------------------- ### Example Java Installation ID Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/java.md A comprehensive example of a Java installation ID utilizing all available options. ```bash install java:OpenJDK8_jre_x64_windows_hotspot_jdk8u181b13 ``` -------------------------------- ### ForgeBox Semantic Versioning Examples Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/installing-packages/README.md Demonstrates various ways to specify package versions using semantic versioning ranges on ForgeBox. ```bash # Latest stable version (unless a version is specified in the box.json) CommandBox> install foo # Same as above CommandBox> install foo@stable # latest version, even if pre release (bleeding edge) CommandBox> install foo@be # A specific version CommandBox> install foo@1.2.3 # Any version with a major number of 4 (4.1, 4.2, 4.9, etc) CommandBox> install foo@4.x # Any version greater than 1.5.0 CommandBox> install foo@>1.5.0 # Any version greater than 5.2 but less than or equal to 6.3.4 CommandBox> install "foo@>5.2 <=6.3.4" # Any version greater than or equal to 1.2 but less than or equal to 3.2 CommandBox> install "foo@1.2 - 3.2" # Allows patch-level changes if a minor version is specified. Allows minor-level changes if not. (2.1.2, 2.1.3, 2.1.4, etc) CommandBox> install foo@~2.1 # Any greater version that does not modify the left-most non-zero digit. 4.2, 4.3, 4.9, etc CommandBox> install foo@^4.1.4 ``` -------------------------------- ### Switching Homebrew Versions Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/setup/installation.md Example of switching to an older version of CommandBox installed via Homebrew. ```bash brew install commandbox@5.1.1 brew unlink commandbox brew link commandbox@5.1.1 ``` -------------------------------- ### Edit Application File Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/getting-started-guide.md Opens a specific application file in the default editor. ```bash CommandBox> edit views/main/index.cfm ``` -------------------------------- ### Start Lucee Light Server Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/server-versions.md Examples of starting Lucee Light servers with CommandBox. ```bash # Latest stable server start cfengine=lucee-light # Specific version server start cfengine=lucee-light@5.3.4.77 # Bleeding edge server start cfengine=lucee-light@be ``` -------------------------------- ### Stop the Embedded Server and Clean Up Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/getting-started-guide.md Stops the running server, navigates up one directory, and removes the playground directory. ```bash CommandBox> stop CommandBox> cd ../ CommandBox> rm playground --recurse --force ``` -------------------------------- ### Verbose Server Start Output Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/multi-site-support/configuring-sites.md Example of the console output when starting the server with `--verbose` or `--debug` flags, showing site configuration details. ```bash | |-------------------------------------------------------------- | √ | Configuring site [site1] | |--------------------------------------- | | Site name - site1 | | Webroot - C:\path\to\site1\ | | Site config file - C:\path\to\server.json | |--------------------------------------- | | √ | Setting site [site1] Profile to [development] | | |------------------------------------------------------------ | | | Profile set from server bound to localhost | | | Block CF Admin disabled | | | Block Sensitive Paths enabled | | | Block Flash Remoting enabled | | | Allowed Extensions: [log] | | | Directory Browsing enabled | | | File Caching disabled | | |------------------------------------------------------------ | √ | Configuring site [site2] | |--------------------------------------- | | Site name - site2 | | Webroot - C:\path\to\site2\ | | Site config file - C:\path\to\server.json | |--------------------------------------- | | √ | Setting site [site2] Profile to [development] | | |------------------------------------------------------------ | | | Profile set from server bound to localhost | | | Block CF Admin enabled | | | Block Sensitive Paths enabled | | | Block Flash Remoting enabled | | | Allowed Extensions: [log2] | | | Directory Browsing enabled | | | File Caching disabled | | |------------------------------------------------------------ | √ | Configuring site [site3] | |--------------------------------------- | | Site name - site3 | | Webroot - C:\path\to\site3\ | | Site config file - C:\path\to\server.json | |--------------------------------------- | | √ | Setting site [site3] Profile to [development] | | |------------------------------------------------------------ | | | Profile set from server bound to localhost | | | Block CF Admin disabled | | | Block Sensitive Paths enabled | | | Block Flash Remoting enabled | | | Allowed Extensions: [log] | | | Directory Browsing disabled | | | File Caching disabled | | |------------------------------------------------------------ | √ | Configuring site [default] | |----------------------------------------- | | Site name - default | | Webroot - C:\path\to\default\ | | Site config file - C:\path\to\server.json | |----------------------------------------- | | √ | Setting site [default] Profile to [development] | | |-------------------------------------------------------------- | | | Profile set from server bound to localhost | | | Block CF Admin disabled | | | Block Sensitive Paths enabled | | | Block Flash Remoting enabled | | | Allowed Extensions: [log] | | | Directory Browsing enabled | | | File Caching disabled | | |-------------------------------------------------------------- ``` -------------------------------- ### Install from HTTP URL Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/http-s.md Example of installing a package directly from an HTTP URL. ```bash install http://www.site.com/myPackage.zip ``` -------------------------------- ### Install from local file (relative paths) Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/file.md Examples of installing packages using relative file paths. ```bash install libs/myPackage.zip ``` ```bash install ../../libs/myPackage2.zip ``` -------------------------------- ### Install from S3 bucket Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/s3.md Example of installing a package directly from an S3 bucket URL. ```bash install s3://my-private-bucket/myPackage.zip ``` -------------------------------- ### Install Lex from HTTP Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/lex-via-http.md Example of installing a Lucee Extension directly from a URL using the `lex:` endpoint. ```bash install lex:https://server.com/path/to/ortus-redis-cache-1.4.0.lex ``` -------------------------------- ### Custom Delimiter and Command Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/usage/foreach-command.md This example demonstrates using a custom delimiter (`,`) and a hard-coded input list to run the `install` command for each package. ```bash forEach input="coldbox,testbox,cborm" delimiter="," command=install ``` -------------------------------- ### Install from local file (absolute path) Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/file.md Example of installing a package from an absolute file path on a Unix-like system. ```bash install /var/libs/myPackage.zip ``` -------------------------------- ### Install Lex file Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/install-lucee-core-lex-files.md Example of installing a local Lex file using the server lucee-deploy command. ```bash server lucee-deploy myFile.lex ``` -------------------------------- ### Install from ForgeBox (Recommended) Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/lex-via-http.md Example of installing a Lucee Extension using its ForgeBox slug, which is recommended if the extension is hosted on ForgeBox. ```bash install 5C558CC6-1E67-4776-96A60F9726D580F1 ``` -------------------------------- ### Start server with cfengine=none Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/start-html-server.md Starts a local server without a CF Engine, serving files as static content. ```bash server start cfengine=none ``` -------------------------------- ### Install from local file (absolute path on Windows) Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/file.md Example of installing a package from an absolute file path on Windows, showing escaped backslashes. ```bash install C:\websites\libs\myPackage.zip ``` -------------------------------- ### Install Dependencies and Run Server Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/deploying-commandbox/amazon-lightsail.md Installs CommandBox dependencies and starts the server on host 0.0.0.0 and port 80. ```bash cd /app && sudo box install sudo box start --debug host=0.0.0.0 port=80 ``` -------------------------------- ### Verbose Installation Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/installing-packages/installation-options.md Installs the 'cbi18n' package with extra debugging information, including a list of all installed files. ```bash install cbi18n --verbose ``` -------------------------------- ### Server.json Configuration Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/server.json/README.md Example of server.json configuration with XNIO and Undertow options, and a script for initial installation. ```json { "XNIOOptions": { "WORKER_NAME": "MyWorker" }, "UndertowOptions": { "ALLOW_UNESCAPED_CHARACTERS_IN_URL": true } }, "scripts":{ "onServerInitialInstall":"cfpm install mysql websocket" } } ``` -------------------------------- ### Install Lex from Local File Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/lex-via-http.md Examples of installing Lucee Extensions from local file paths, including Windows UNC paths. ```bash install lex:C:\path\to\my.lex ``` ```bash install lex:/path/to/my.lex ``` ```bash # Windows UNC path install lex:\\serverName\sharename\my.lex ``` -------------------------------- ### Upgrade CommandBox Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/getting-started-guide.md Command to check for and apply CommandBox upgrades. ```bash CommandBox> upgrade ``` -------------------------------- ### Nesting Jobs Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/task-runners/interactive-jobs.md Demonstrates how to start, add logs to, and complete nested jobs, simulating a server start followed by an engine installation. ```javascript job.start( 'Starting server' ); job.addLog( 'This is the server name' ); job.addWarnLog( 'Hey, don\'t touch that dial' ); job.start( 'Installing CF Engine first' ); job.addLog( 'This was the version used' ); job.addLog( 'Yeah, we\'re done' ); job.complete(); job.addLog( 'Aaand, we\'re back!.' ); job.addErrorLog( 'I think we\'re going to crash' ); job.error( 'Didn\'t see that coming' ); ``` -------------------------------- ### With Global Dependencies Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/deploying-commandbox/github-actions.md Example demonstrating how to install system modules like commandbox-cfconfig and commandbox-dotenv. ```yaml - name: Setup CommandBox uses: Ortus-Solutions/setup-commandbox@v2.0.0 with: installSystemModules: true ``` -------------------------------- ### Writing to server home directory on server start Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/package-scripts.md An example script that creates a file in the server's home directory upon server startup, using intercept data for the path. ```bash package set scripts.onServerStart="touch \${interceptData.serverInfo.serverHomeDirectory}/hi.txt" ``` -------------------------------- ### Starting a Server Using a Specific Configuration File Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/server.json/using-multiple-server.json-files.md This command demonstrates how to start a server by explicitly specifying the path to its configuration file. ```bash start serverConfigFile=server-lucee4.json ``` -------------------------------- ### Production Installation Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/installing-packages/installation-options.md Installs the 'cbvalidation' package, skipping development dependencies and obeying the package's 'ignore' property. ```bash install cbvalidation --production ``` -------------------------------- ### Relative Path Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/usage/parameters/file-paths.md Example of a relative path. ```bash mkdir test ``` -------------------------------- ### Initialize a package with wizard Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/box.json/README.md Initializes a package using a question/answer style wizard. ```bash init --wizard ``` -------------------------------- ### Starting the server with a specific server.json Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/server.json/packaging-your-server.md This command demonstrates how to start the CommandBox server by specifying the path to the server.json configuration file. ```bash start /path/to/server.json ``` -------------------------------- ### Starting a server using a direct download link to a WAR file Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/multi-engine-support.md Starts a web server using a direct download link to a package containing a WAR file. ```bash CommandBox> start cfengine=http://downloads.ortussolutions.com/adobe/coldfusion/9.0.2/cf-engine-9.0.2.zip ``` -------------------------------- ### Configure server.json for static serving Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/start-html-server.md Sets the cfengine to none in server.json and then starts the server. ```bash server set app.cfengine=none server start ``` -------------------------------- ### Install Lex file to a specific server Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/install-lucee-core-lex-files.md Example of installing a Lex file to a specific CommandBox server. ```bash server lucee-deploy myFile.lex myServer ``` -------------------------------- ### Show module config Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/developing-for-commandbox/example-project.md This command displays the current configuration settings for the commandbox-banner-customizer module. ```bash CommandBox> config show modules.commandbox-banner-customizer ``` -------------------------------- ### Initialize a package Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/box.json/README.md Initializes any folder as a package. ```bash init ``` -------------------------------- ### Show the banner Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/developing-for-commandbox/example-project.md This command shows the ASCII art banner. ```bash CommandBox> banner on ``` -------------------------------- ### Install a Specific Version Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/deploying-commandbox/github-actions.md Example for installing a particular version of CommandBox. ```yaml - name: Setup CommandBox With ForgeBox Key uses: Ortus-Solutions/setup-commandbox@v2.0.0 with: version: 5.0.0 ``` -------------------------------- ### Install Lucee Extension using installExtension() Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/task-runners/installing-lucee-extensions.md Use the `installExtension()` method to install any extension available on an update provider. This example installs the MySQL JDBC Extension. ```javascript installExtension( '7E673D15-D87C-41A6-8B5F1956528C605F' ) ``` -------------------------------- ### Simplest possible example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/developing-for-commandbox/commands/running-other-commands.md This runs the 'version' command and the output will be flushed to the console. ```javascript command( 'version' ) .run(); ``` -------------------------------- ### Server Start Command Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/configuring-your-server/adding-custom-libs.md Specifies directories containing JAR files to be loaded by the server when starting. ```bash server start libDirs=path/to/libs,another/path/to/libs ``` -------------------------------- ### run Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/configuring-your-server/custom-tray-menus.md Example of a menu item that runs a native command synchronously and displays output in a popup window. ```javascript [ { "label" : "Does the Internet work?", "action" : "run", "command" : "ping google.com" } ] ``` -------------------------------- ### Set response header for GET requests Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/configuring-your-server/server-rules/rule-examples.md This rule sets a response header named 'type' with the value 'get' for all incoming GET requests. ```javascript method(GET) -> set(attribute='%{o,type}', value=get) ``` -------------------------------- ### Install LCO file from URL Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/install-lucee-core-lex-files.md Example of installing an LCO file from an HTTP URL using the server lucee-deploy command. ```bash server lucee-deploy https://domain.com/path/to/Lucee-core-patch.lco ``` -------------------------------- ### Custom banner file Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/developing-for-commandbox/example-project.md This command specifies a file path for a custom banner. ```bash CommandBox> banner file myCustomBanner.txt ``` -------------------------------- ### Web Root Convention Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/multi-site-support/multi-site-examples.md This server.json configuration sets up default web settings and points to web roots for multiple sites, with individual .site.json files providing site-specific configurations. ```javascript { "name":"commandbox-test-multi-site-json-webroot-convention", "web":{ "mimeTypes":{ "log":"text/plain" }, "rules":[ "path(/tea)->set-error(418)" ], "welcomeFiles":"custom.cfm,index.cfm", "bindings":{ "HTTP":{ "listen":"80" } } }, "sites":{ "site1":{ "webroot":"site1" }, "site2":{ "webroot":"site2" }, "site3":{ "webroot":"site3" }, "default":{ "webroot":"default" } } } ``` ```javascript { "hostAlias":"site1.com" } ``` ```javascript { "hostAlias":"site2.com", "accessLogEnable":"false", "aliases":{ "/js":"javascript" }, "allowedExt":"log2", "GZIPEnable":"false", "mimeTypes":{ "log2":"application/xml" }, "rules":[ "path(/brad)->set-error(123)" ], "rulesFile":"site2/.rules.txt", "welcomeFiles":"index.cfm", "directoryBrowsing":true, "blockCFAdmin":true } ``` ```javascript { "hostAlias":"site3.com", "aliases":{ "/js-brad":"javascript" }, "errorPages":{ "404":"missing.cfm" }, "welcomeFiles":"main.cfm,default.cfm,index.cfm", "directoryBrowsing":false, "blockCFAdmin":false } ``` -------------------------------- ### Getting Instance via WireBox Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/developing-for-commandbox/commands/README.md Example of getting an instance of a service using WireBox within a command. ```javascript var results = getInstance( 'artifactService' ).listArtifacts(); ``` -------------------------------- ### Override package install paths by convention Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/installing-packages/installation-path.md Example of how to override default install paths for different package types within a project's box.json. ```json { "installPathConventions" : { "modules" : "../lib/modules", "mvc" : "../lib/framework", "testing" : "they-will-never-find-it-here-lol/" } } ``` -------------------------------- ### type Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/box.json/installation.md Sets the ForgeBox type of the package, which can determine the installation directory. For example, a type of `modules` installs in the site's `/modules` directory. ```bash package set type=modules package show type ``` -------------------------------- ### Install Lucee Extension with Specific Version Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/task-runners/installing-lucee-extensions.md Specify a version when using the `installExtension()` method. This example installs a specific version of the MySQL JDBC Extension. ```javascript installExtension( '7E673D15-D87C-41A6-8B5F1956528C605F', '8.0.30' ) ``` -------------------------------- ### CFML Examples Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/task-runners/property-files.md Examples of using the `propertyFile` function in CFML to create, load, set, get, and store properties. ```javascript // Create and load property file object propertyFile( 'myFile.properties' ) .set( 'my.new.property', 'my value' ) .store(); // Get a property var value = propertyFile( 'myFile.properties' ) .get( 'existing.property' ); // Create one from scratch propertyFile() .set( 'brad', 'wood' ) .store( 'myFile.properties' ); ``` -------------------------------- ### Install from Gist with username Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/gist.md The Github username is optional. ```bash install gist:/ ``` -------------------------------- ### Saving as a Development Dependency Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/installing-packages/installation-options.md Installs the 'testbox' package and saves it as a development dependency. ```bash install testbox --saveDev ``` -------------------------------- ### Installing specific versions of a private package Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/private-packages.md Examples of installing specific versions or version ranges of a private package. ```bash install my-slug@forgeBoxUser@1.0.0 ``` ```bash install my-slug@forgeBoxUser@be ``` -------------------------------- ### Coldbox Create Command Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/usage/commands.md Example of a multi-level namespace command. ```bash coldbox create handler ``` -------------------------------- ### Running the 'info' command Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/developing-for-commandbox/commands/running-other-commands.md Example of running the 'info' command. ```javascript command( 'info' ) .run(); ``` -------------------------------- ### Install using cached HTTPS URL Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/http-s.md Example of installing a package using a cached HTTPS URL. ```bash install https+cached://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbi18n/1.4.0/cbi18n-1.4.0.zip ``` -------------------------------- ### Engines Configuration Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/box.json/embedded-server.md An example of how to configure the supported CF engines and their versions for the project. ```javascript "engines" : [ { "type" : "railo", "version" : ">=4.2.1" }, { "type" : "adobe", "version" : ">=10.0.0" } ] ``` -------------------------------- ### Simplified Java Installation IDs Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/java.md Examples of valid, simplified Java installation IDs where only the major version is specified. ```bash install java:openjdk8 ``` ```bash install java:openjdk8_jre ``` ```bash install java:OpenJDK8_jdk8u181b13 ``` ```bash install java:OpenJDK8_jdk_jdk8u181b13 ``` -------------------------------- ### Install using cached HTTP URL Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/http-s.md Example of installing a package using a cached HTTP URL for a CF engine. ```bash start cfengine=http+cached://update.lucee.org/rest/update/provider/forgebox/5.3.3.60-RC ``` -------------------------------- ### Install a specific Java version Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/java.md Example of how CommandBox can automatically download and install a specific Java version when needed. ```bash java install OpenJDK8_jdk8u181b13 ``` -------------------------------- ### Example with prefixed parameters Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/developing-for-commandbox/commands/using-parameters/dynamic-parameters.md Demonstrates how CommandBox accepts multiple parameters prefixed with 'widgetProp:' and groups them into a struct. ```bash doWidget widgetProp:foo=blue widgetProp:bar=seven widgetProp:baz=turkey ``` -------------------------------- ### Install Modules using CFPM Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/configuring-your-server/adobe-cfpm.md Example of using the CommandBox `cfpm` passthrough command to install modules into Adobe ColdFusion. ```bash CommandBox> cfpm install orm,debugger,pdf ``` -------------------------------- ### Initialize a package Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/creating-packages/README.md Use the `init` command to turn a folder into a package by adding a `box.json` file. ```bash init name="My Package" version="1.0.0" ``` -------------------------------- ### Install JAR with semantic versioning parsing Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/jar-via-http.md Example of installing a JAR where CommandBox parses the semantic version from the URL. ```bash install jar:https://repo1.maven.org/maven2/co/elastic/apm/elastic-apm-agent/1.24.0/elastic-apm-agent-1.24.0.jar ``` -------------------------------- ### Starting Servers with Different CF Engines and Names Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/server.json/using-multiple-server.json-files.md This command demonstrates how to start multiple servers, each with a specific ColdFusion engine version and a unique name, enabling distinct configurations. ```bash start cfengine=lucee@4 name=lucee4 start cfengine=lucee@5 name=lucee5 start cfengine=adobe@2016 name=adobe2016 ``` -------------------------------- ### Initialize a package with properties Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/box.json/README.md Initializes a package and passes properties using named parameters. ```bash init name="My Package" slug=my-package version=1.0.0 ``` -------------------------------- ### Custom workingDirectory and shell Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/configuring-your-server/custom-tray-menus.md Example demonstrating how to set a custom working directory and shell for a command. ```javascript [ { "label" : "Clear Temp Dir", "action" : "runAsync", "command" : "rm -rf", "workingDirectory" : "/var/tmp", "shell" : "/bin/zsh" } ] ``` -------------------------------- ### Load Packages using server.json Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/configuring-your-server/adobe-cfpm.md Example of using `server.json` to define a script that installs packages via `cfpm` on server initial install. ```json { "scripts":{ "onServerInitialInstall":"cfpm install websocket" } } ``` -------------------------------- ### Install external jars via HTTP Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/jar-via-http.md Examples of using the 'jar:' endpoint to install external JAR files from HTTP URLs. ```bash install jar:http://site.com/path/to/file.jar install "jar:https://github.com/coldbox-modules/cbox-bcrypt/blob/master/modules/bcrypt/models/lib/jbcrypt.jar?raw=true" install "jar:https://search.maven.org/remotecontent?filepath=jline/jline/3.0.0.M1/jline-3.0.0.M1.jar" ``` -------------------------------- ### site1.json (Per-site siteConfigFile) Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/multi-site-support/multi-site-examples.md An example of a site-specific configuration file that defines the hostAlias and webroot for a particular site. ```javascript { "hostAlias":"site1.com", "webroot":"site1" } ``` -------------------------------- ### Installing a Package with a Version Range Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/semantic-versioning.md Shows how to use the 'install' command to specify a version range for a package. ```bash CommandBox> install coldbox@4.x ``` -------------------------------- ### SSH Authentication Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/code-endpoints/git.md Installing a package from a Git repository using SSH authentication. ```bash install git+ssh://site.com:user/repo.git#v1.2.3 install git+ssh://git@github.com:user/repo.git ``` -------------------------------- ### Server Defaults Configuration Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/config-settings/server-settings.md Examples of setting default server configurations for rewrites, browser opening, and JVM heap size, followed by showing the current defaults. ```bash config set server.defaults.web.rewrites.enable=true config set server.defaults.openbrowser=false config set server.defaults.jvm.heapsize=1024 config show server.defaults ``` -------------------------------- ### With Specific Dependencies Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/deploying-commandbox/github-actions.md Example showing how to install specific packages, such as commandbox-fusionreactor. ```yaml - name: Setup CommandBox uses: Ortus-Solutions/setup-commandbox@v2.0.0 with: install: commandbox-fusionreactor ``` -------------------------------- ### Dry Run Output Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/multi-site-support/defining-sites.md Example console output when starting a server with multiple sites using the --dryRun flag, showing configuration for site1, site2, and site3. ```bash ❯ start --dryRun √ | Starting Server | √ | Configuring site [site1] | | √ | Setting site [site1] Profile to [production] | √ | Configuring site [site2] | | √ | Setting site [site2] Profile to [production] | √ | Configuring site [site3] | | √ | Setting site [site3] Profile to [production] ``` -------------------------------- ### Basic Piping Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/usage/parameters/piping-into-commands.md Demonstrates piping the output of 'cat' into 'grep'. ```bash cat myfile.txt | grep "find me" ``` -------------------------------- ### Simple Usage Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/deploying-commandbox/github-actions.md A basic example of how to set up CommandBox in a Github Action. ```yaml - name: Setup CommandBox uses: Ortus-Solutions/setup-commandbox@v2.0.0 ``` -------------------------------- ### Publishing to ForgeBox from start to finish Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/package-management/creating-packages/README.md A sequence of commands to register, log in, create, and publish a package to ForgeBox. ```bash # Create user (first time only) forgebox register username password your@email.com firstName lastName forgebox login username password # Create package mkdir mypackage --cd package init slug=my-package type=modules bump --major # Publish it publish # Viewable and installable by the world! forgebox show my-package install my-package ``` -------------------------------- ### Custom Bindings Example Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/embedded-server/multi-site-support/multi-site-examples.md This server.json configuration demonstrates custom HTTP, SSL, and AJP bindings for multiple sites, including shared and site-specific bindings. ```javascript { "name":"commandbox-tests-multi-site-bindings", "web":{ "host":"0.0.0.0", "HTTP":{ "port":"80" }, "SSL":{ "enable":"true", "port":"443", "certFile":"../certs/ServerCert-all-SAN.pfx" }, "AJP":{ "enable":"true", "port":"8009", "secret":"8009secret" }, "bindings":{ "HTTP":{ "listen":"0.0.0.0:8080" }, "SSL":{ "listen":"0.0.0.0:8443", "certFile":"../certs/ServerCert-all-SAN.pfx" }, "AJP":{ "listen":"0.0.0.0:16009", "secret":"16009secret" } } }, "sites":{ "site1":{ "hostAlias":"site1.com", "webroot":"site1", "bindings":{ "HTTP":{ "listen":"81" }, "SSL":{ "listen":"444", "certFile":"../certs/ServerCert-all-SAN.pfx" }, "AJP":{ "listen":"8010", "secret":"8010secret" } } }, "site2":{ "hostAlias":"site2.com", "webroot":"site2", "bindings":{ "http":[ { "listen":"0.0.0.0:80" }, { "listen":"0.0.0.0:82" } ], "ssl":{ "listen":"0.0.0.0:446", "certFile":"../certs/ServerCert-all-SAN.pfx" }, "AJP":{ "listen":"0.0.0.0:8011", "secret":"8011secret" } } }, "site3":{ "webroot":"site3" } }, "hostAlias":"site3.com" } ``` -------------------------------- ### assertEqual examples Source: https://github.com/ortus-docs/commandbox-docs/blob/6.3.0/usage/execution/exit-codes.md Examples of using `assertEqual` to conditionally execute commands when two parameters match (case-insensitive). This includes setting a package name if it doesn't match and installing production dependencies if the environment is production. ```bash assertEqual `package show name` "My Package" || package set name="My Package" assertEqual ${ENVIRONMENT} production && install --production ```