# Configuration file

Reference for the project configuration file format.

The `croct.json` file stores the project configuration, including organization and workspace identifiers, application mappings, locale settings, and directory paths. The CLI creates this file when you run the [`init`](/reference/cli/commands/init) command.

## Example

Here is a typical configuration file:

**croct.json**

```json
{
  "$schema": "https://schema.croct.com/json/v1/project.json",
  "organization": "acme",
  "workspace": "default",
  "applications": {
    "development": "my-app-dev",
    "production": "my-app"
  },
  "defaultLocale": "en",
  "locales": [
    "en",
    "pt-br"
  ],
  "slots": {},
  "components": {},
  "paths": {
    "source": "src",
    "components": "src/components"
  }
}
```

## Properties

The following list describes the properties of the configuration file:

- `$schema`: `string` (optional)

  The URL of the JSON Schema for validation and autocomplete in editors.

  Set this to `https://schema.croct.com/json/v1/project.json` to enable autocomplete and validation in editors that support JSON Schema.

- `organization`: `string`

  The ID of the organization that owns the project.

- `workspace`: `string`

  The ID of the workspace associated with the project.

- `applications`: `object`

  The application IDs mapped to the project.

  - `development`: `string`

    The ID of the development application.

  - `production`: `string` (optional)

    The ID of the production application.

- `defaultLocale`: `string`

  The default locale for the project, for example `en` or `pt-br`.

- `locales`: `Array<string>`

  The list of locales supported by the project.

- `slots`: `Record<string, string>`

  A mapping of slot identifiers to [version specifiers](#version-specifiers). The CLI manages this property automatically when you add or remove slots.

  The version specifier controls which versions get [type definitions](/reference/cli/type-generation) and [fallback content](/reference/cli/fallback-content).

- `components`: `Record<string, string>`

  A mapping of component identifiers to [version specifiers](#version-specifiers). The CLI manages this property automatically when you add or remove components.

  The version specifier controls which versions get [type definitions](/reference/cli/type-generation).

- `paths`: `object` (optional)

  Custom directory paths for the project. When omitted, the CLI auto-detects paths based on the project structure.

  Templates use these paths to know where to place generated code in the project. For example, a template that downloads a UI component uses the `components` path to determine the destination directory.

  - `source`: `string` (optional)

    The root directory for application source code, for example `src`.

    Auto-detected based on the recognized project type and conventions.

  - `utilities`: `string` (optional)

    The directory for helper modules and shared code, for example `src/lib`.

    Auto-detected based on the recognized project type and conventions.

  - `components`: `string` (optional)

    The directory for UI components, for example `src/components`.

    Auto-detected based on the recognized project type and conventions.

  - `examples`: `string` (optional)

    The directory for code examples, for example `src/examples`.

    The CLI generates slot usage examples here, and templates can reference this path to add their own code samples.

    Auto-detected based on the recognized project type and conventions.

  - `content`: `string` (optional)

    The directory where the CLI writes content files like fallback data and type definitions.

    Defaults to the project root when not specified.

## Version specifiers

The `slots` and `components` properties use version specifiers to define which major versions the CLI should generate types and content for. The following formats are supported:

| Format | Example   | Description                                |
| ------ | --------- | ------------------------------------------ |
| Exact  | `3`       | A single major version.                    |
| Range  | `1 - 3`   | All major versions from 1 to 3, inclusive. |
| Set    | `1, 3, 5` | A specific set of major versions.          |

For example:

**croct.json**

```json
{
  "slots": {
    "home-hero": "1 - 3",
    "banner": "2",
    "footer": "1, 4"
  }
}
```

This generates types and downloads default content for `home-hero` versions 1, 2, and 3, `banner` version 2, and `footer` versions 1 and 4.

## Explore

- [Global options](/reference/cli/global-options): Learn about the options available to every CLI command.
- [Init](/reference/cli/commands/init): Learn how to initialize and configure your project.
