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

# bazable init

> Initialize a Bazable project

Creates a `bazable.config.json` file with your project name (from `package.json`) and an empty endpoints list.

## Usage

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

## Options

<Info>
  This command takes no options.
</Info>

## What it does

Looks for a `package.json` in the current directory and reads its `name` field to set the contract's `projectName`. If no `package.json` is found, it defaults to `"unknown-project"`.

Writes a new `bazable.config.json` with the following structure:

```json theme={null}
{
  "version": "1.0",
  "projectName": "your-project-name",
  "endpoints": {}
}
```

The `endpoints` object starts empty. Populate it with [`bazable extract`](/commands/extract), [`bazable add`](/commands/add), or [`bazable import`](/commands/import).

## Safety checks

If `bazable.config.json` already exists, the command refuses to overwrite it and prints a warning:

```text theme={null}
⚠ Project already initialized. A bazable.config.json already exists.
```

<Note>
  This prevents accidental loss of your contract.
</Note>

## Prerequisites

* Your project should be a valid Node.js project with a `package.json` (optional, but recommended).
* The current directory should be the root of your frontend or backend project.

## Example

```bash theme={null}
cd my-frontend
bazable init
```

<Tip>
  Follow up with [`bazable extract`](/commands/extract) to auto-populate the contract from your existing code.
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.