> 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). Agents can also search and read this documentation through its [MCP server](https://cbwire.ortusbooks.com/~gitbook/mcp).

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
