> For the complete documentation index, see [llms.txt](https://cbwire.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cbwire.ortusbooks.com/cbwire-v1/essentials/creating-components.md).

# Creating Components

You can scaffold cbwire components quickly using the [commandbox-cbwire](https://github.com/commandbox-modules/commandbox-cbwire) module.

## Installing commandbox-cbwire

To get started open the [CommandBox ](https://commandbox.ortusbooks.com/)binary or enter the shell by typing `box` in your terminal or console. Then let's install our scaffolding module.

```
install commandbox-cbwire
```

## Creating Components

Let's create a **Counter** cbwire component that we will use to list our favorite movies.

```javascript
cbwire create Counter
// Created /wires/Counter.cfc
// Created /views/wires/counter.cfm
// Created /tests/specs/integration/wires/CounterTest.cfc
```

You can provide named arguments as well.

```javascript
cbwire create name=Counter views=false
// Created /wires/Counter.cfc
// Created /tests/specs/integration/wires/CounterTest.cfc
```

Below is the entire signature of arguments you can provide to the `create` command.

```javascript
/**
    * @name Name of the component to create without the .cfc.
    * @actions Comma-delimited list of actions to generate.
    * @views Generate a view for the cbwire component.
    * @viewsDirectory Directory where your views are stored. Only used if views is set to true.
    * @integrationTests Generate the integration test component
    * @testsDirectory Your integration tests directory. Only used if integrationTests is true
    * @directory Base directory to create your handler in and creates the directory if it does not exist. Defaults to 'handlers'.
    * @description Component hint description.
    * @open Opens the component (and test(s) if applicable) once generated.
    **/
    function run(
    required string name,
    string actions = "",
    boolean views = true,
    string viewsDirectory = "views/wires",
    boolean integrationTests = true,
    string testsDirectory = "tests/specs/integration/wires",
    string directory = "wires",
    string description = "I am a new cbwire component.",
    boolean open = false
)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cbwire.ortusbooks.com/cbwire-v1/essentials/creating-components.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
