> For the complete documentation index, see [llms.txt](https://aurelia-1.gitbook.io/v1-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aurelia-1.gitbook.io/v1-docs/getting-to-know-aurelia/cli/gulp-tasks.md).

# Gulp tasks

The Aurelia CLI leverages Gulp as its task runner, providing a series of predefined tasks to streamline your development process. These tasks are located in the `aurelia_project/tasks` directory.

## Task Execution

Tasks can be executed using the `au` command. For example:

* **Build the application:**

  ```bash
  au build
  ```

  Executes the Gulp task exported from `aurelia_project/tasks/build.js`.
* **Run tests:**

  ```bash
  au test
  ```

  Executes the task from `aurelia_project/tasks/test.js`.

**Note:** The CLI executes the task exported as `default`. You can export multiple tasks from a single file:

```javascript
let task1 = () => {};
let task2 = () => {};

export { task1 as default, task2 };
```

Executing the above using `au task1` will run `task1`.

## Creating a New Task

You can create custom tasks to extend the CLI's functionality:

1. **Create a new file:** Add a `.js` or `.ts` file in the `aurelia_project/tasks` directory.
2. **Export the task function:**

   ```javascript
   export default function myCustomTask() {
     // Task implementation
   }
   ```
3. **Run the task:** Use `au myCustomTask` to execute it.

## Task Metadata

To integrate custom tasks with the CLI help system, define task metadata in a `.json` file with the same name as the task. For example, for `build.js`, create `build.json`:

```json
{
  "name": "build",
  "description": "Builds and processes all application assets.",
  "flags": [
    {
      "name": "env",
      "description": "Sets the build environment.",
      "type": "string"
    },
    {
      "name": "watch",
      "description": "Watches source files for changes and refreshes the bundles automatically.",
      "type": "boolean"
    }
  ],
  "parameters": [
    {
      "name": "some-parameter",
      "description": "A description of this parameter."
    }
  ]
}
```

{% hint style="info" %}
Only tasks with corresponding metadata JSON files appear in the `au help` command.
{% endhint %}


---

# 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://aurelia-1.gitbook.io/v1-docs/getting-to-know-aurelia/cli/gulp-tasks.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.
