> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appz.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# appz build

> Learn how to build an Appz Project locally or in your CI environment using the `appz build` CLI command.

export const GlobalOptionsComponent = ({command}) => <div>
    <h2><a href="#global-options">Global Options</a></h2>
    <p>These general options can be applied when using the <code>{command}</code> command:</p>
    <ul>
    <li><code>--cwd</code></li>
    <li><code>--debug</code></li>
    <li><code>--global-config</code></li>
    <li><code>--help</code></li>
    <li><code>--local-config</code></li>
    <li><code>--no-color</code></li>
    <li><code>--scope</code></li>
    <li><code>--token</code></li>
    </ul>

    <p>For detailed information on these global options and their applications, refer to the <a href="/cli/global-options">options section</a>.</p>
    </div>;

The `appz build` command facilitates the building of an Appz Project either locally or in your own CI setup. The generated build artifacts are stored in the `.appz/output` directory in accordance with the Build Output API.

Using this in tandem with the `appz deploy --prebuilt` command allows for an Appz Deployment to be initiated without disclosing the source code of the Appz Project to Appz.

This command is also useful for troubleshooting an Appz Project by generating error messages for a failed local build, or by analyzing the build artifacts to understand better how Appz will handle the Deployment.

It's advisable to execute the `appz pull` command before running `appz build` to make sure the latest Project Settings and Environment Variables are downloaded locally.

## Usage

```bash terminal theme={null}
appz build
```

> Use the `appz build` command for constructing an Appz Project.

## Unique Options

These are specific options that apply only to the `appz build` command.

### Production

The `--prod` flag should be used when you aim to build the Appz Project with Production Environment Variables. By default, the Preview Environment Variables are applied.

```bash terminal theme={null}
appz build --prod
```

> Building an Appz Project using the `--prod` flag.

### Yes

The `--yes` option allows you to skip the confirmation step and directly fetch environment variables and Project Settings if they are missing locally.

```bash terminal theme={null}
appz build --yes
```

> Executing the appz build command with the `--yes` option.

<GlobalOptionsComponent command={'appz build'} />

## Related Guides

[How can I leverage the Appz CLI for customized workflows?](/guides/using-appz-cli-with-custom-workflows)
