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

# Initialize a project

> Generate starter configuration files for your Upsun project by using AI or guided setup.


The `init` command generates starter configuration files for your Upsun project.

## Usage

```bash theme={null}
upsun init
```

When you run `upsun init`, you can choose how to generate your starter configuration files. You can either:

* Use AI to analyze your project and generate a configuration automatically.
* Follow a guided setup, which does not use AI.

## AI configuration

The AI option analyzes the repository locally and sends a sanitized "digest" to the Upsun API, which then contacts our AI provider.

You can view the repository digest by running `upsun init --digest`. The digest contains:

* `tree`: a concise list of the files in the repository
* `reports`: a list of findings for each directory in the repository, including identified frameworks or build tools
* `selected_files`: the contents of a few files that look particularly relevant for configuration, including `README.md` and `Dockerfile`

At this time, OpenAI is the provider used for all configuration generation.

## Privacy

<Info>
  **Neither Upsun nor our AI providers will use your data for AI model training.**
</Info>

The selected files whose contents are included in the repository digest are chosen to be unlikely to include sensitive information.

The file contents are sanitized locally before being sent to the Upsun API. Upsun redacts email addresses and common secrets identified by using [`gitleaks`](https://github.com/gitleaks/gitleaks).

## Output

For both the AI and non-AI processes, the expected result is valid YAML. In many cases, the result is an acceptable starter configuration for the project.

<Info>
  AI can make convincing-looking mistakes, and projects can be very diverse in layout.

  Be sure to review and edit your configuration to suit your needs.
</Info>

Both the AI and non-AI processes create an `.upsun/config.yaml` file in your project root. This config file contains:

* Application configuration (see the [App reference](/docs/configure-apps/app-reference))
* Service definitions (see [Add services](/docs/add-services))
* Route configurations (see [Define routes](/docs/routes))

After running `upsun init`, you can deploy your project as follows:

```bash theme={null}
git add .upsun/config.yaml
git commit -m 'Add Upsun configuration'
upsun project:set-remote
upsun push
```

## `init` command options

| Option             | Description                                                                                                                                          |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--ai`             | Use AI configuration (use `--ai=false` to disable)                                                                                                   |
| `--digest`         | Only show the repository digest (AI input) without sending it                                                                                        |
| `--yes` (`-y`)     | Answer "yes" to confirmation questions and accept defaults (including overwriting existing configuration, if it exists). Implies `--no-interaction`. |
| `--no-interaction` | Don't ask interactive questions; accept default values                                                                                               |
