CBWIRE
v4.x
v4.x
  • Introduction
  • How It Works
  • Getting Started
  • Configuration
  • Releases
    • What's New With 4.1
    • What's New With 4.0
    • What's New With 3.2
    • What's New With 3.1
    • What's New With 3.0
    • What's New With 2.2
    • What's New With 2.1
    • What's New With 2.0
  • Resources
  • Upgrading from CBWIRE 3.x
  • Upgrading from CBWIRE 2.x
  • CBWIRE CLI
  • The Essentials
    • Components
    • Templates
    • Data Properties
    • Computed Properties
    • Data Binding
    • Actions
    • Events
    • Nesting Components
    • Lifecycle Methods
    • JavaScript
    • Testing
  • Features
    • Single-file Components
    • Alpine.js
    • Lazy Loading
    • Form Validation
    • File Uploads
    • Query String
    • Redirecting
    • WireBox
  • Template Directives
    • wire:click
    • wire:confirm
    • wire:dirty
    • wire:ignore
    • wire:init
    • wire:key
    • wire:loading
    • wire:model
    • wire:navigate
    • wire:offline
    • wire:poll
    • wire:stream
    • wire:submit
    • wire:transition
  • Advanced
    • Troubleshooting
Powered by GitBook
On this page
  • Installation
  • Command Line Arguments
  • Examples
  • Super Basic Example
  • Basic Example
  • Basic Example with module name using myWireName@MyModuleName
  • Many options (WITHOUT singleFileWire)
  • Many options (WITH singleFileWire)

Was this helpful?

Export as PDF

CBWIRE CLI

PreviousUpgrading from CBWIRE 2.xNextComponents

Last updated 2 days ago

Was this helpful?

has created a CLI for CBWIRE that you can use to quickly scaffold out CBWIRE components. You can find the CBWIRE CLI on .

Installation

Install via CommandBox like so:

box install cbwire-cli

Command Line Arguments

Argument
Type
Description

name

String

Name of the wire to create without extensions. Use @module to place in a module's wires directory.

dataProps

String

A comma-delimited list of data property keys to add.

lockedDataProps

String

A comma-delimited list of data property keys to lock.

actions

String

A comma-delimited list of actions to generate.

outerElement

String

The outer element type to use for the wire. Defaults to "div".

jsWireRef

Boolean

If true, includes livewire:init & component.init hooks and assigns a reference as window.wirename = $wire.

lifeCycleEvents

String

A comma-delimited list of lifecycle event names to generate. If none provided, only onMount() will be generated but commented out.

onHydrateProps

String

A comma-delimited list of properties to create onHydrate() property methods for in the wire.

onUpdateProps

String

A comma-delimited list of properties to create onUpdate() property methods for in the wire.

wiresDirectory

String

The directory where your wires are stored. Defaults to the standard wires directory.

appMapping

String

The root location of the application in the web root (e.g., MyApp/) or leave blank if in the root.

description

String

The wire component's hint description.

open

Boolean

If true, opens the wire component & template once generated.

force

Boolean

If true, forces overwrite of existing wires.

singleFileWire

Boolean

If true, creates a single file wire.

includePlaceholder

Boolean

If true, inserts a placeholder action in the wire component for lazy loading wires.

Examples

Super Basic Example

cbwire create wire myWireName

Basic Example

cbwire create wire name="myWireName" dataProps="counter1,counter2,counter3" actions="saveSomething,doSomething,GetSomething" --jsWireRef --open

Basic Example with module name using myWireName@MyModuleName

cbwire create wire name="myWireName@MyModuleName" dataProps="counter1,counter2,counter3" actions="saveSomething,doSomething,GetSomething" --jsWireRef --open

Many options (WITHOUT singleFileWire)

cbwire create wire name="myWireName" dataProps="counter1,counter2,counter3" lockedDataProps="counter2,counter3" actions="saveSomething,doSomething,GetSomething" outerElement="p" lifeCycleEvents="onRender,onHydrate,onMount,onUpdate" onHydrateProps="counter2,counter3" onUpdateProps="counter1,counter2" description="This is my wire description" --jsWireRef --open --force

Many options (WITH singleFileWire)

cbwire create wire name="myWireName" dataProps="counter1,counter2,counter3" lockedDataProps="counter2,counter3" actions="saveSomething,doSomething,GetSomething" outerElement="p" lifeCycleEvents="onRender,onHydrate,onMount,onUpdate" onHydrateProps="counter2,counter3" onUpdateProps="counter1,counter2" description="This is my wire description" --jsWireRef --open --force --singleFileWire
Michael Risby
CommandBox
ForgeBox
LogoFORGEBOX: CBWIRE CLI
CBWIRE CLI on ForgeBox