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

# vibe init

> Initialize a new VibeHub repository

## Usage

```bash theme={null}
vibe init [options]
```

## Description

Initialize a new VibeHub repository in the current directory. This sets up the necessary configuration for syncing with VibeHub.

## What It Does

When you run `vibe init`, the CLI:

1. Creates a `.vibehub` directory in your project
2. Generates a local configuration file
3. Prepares the project for pushing to VibeHub

## Options

<ParamField query="--name" type="string">
  Specify a project name (optional)
</ParamField>

<ParamField query="--description" type="string">
  Add a project description (optional)
</ParamField>

## Examples

### Basic Initialization

```bash theme={null}
cd my-project
vibe init
```

### Initialize with Name

```bash theme={null}
vibe init --name "My Awesome Project"
```

### Initialize with Description

```bash theme={null}
vibe init --name "API Server" --description "REST API backend service"
```

## Directory Structure

After initialization, your project will have:

```
my-project/
├── .vibehub/
│   └── config.json
├── src/
├── package.json
└── ... (your files)
```

The `.vibehub` directory contains local configuration. You may want to add it to `.gitignore`.

## Next Steps After Init

After initializing, you typically:

1. **Create a VibeHub project** (if you haven't already):
   * Go to [vibehub.co.in](https://vibehub.co.in) and create a new project

2. **Connect to the project**:
   ```bash theme={null}
   vibe set https://vibehub.co.in/username/project-name
   ```

3. **Push your code**:
   ```bash theme={null}
   vibe push
   ```

## Common Workflows

### New Project from Scratch

```bash theme={null}
# Create and enter directory
mkdir my-new-project
cd my-new-project

# Initialize npm/your tooling
npm init -y

# Initialize VibeHub
vibe init

# Connect to VibeHub project
vibe set https://vibehub.co.in/username/my-new-project

# Start coding, then push
vibe push
```

### Existing Project

```bash theme={null}
# Enter your existing project
cd existing-project

# Initialize VibeHub
vibe init

# Connect to VibeHub project
vibe set https://vibehub.co.in/username/existing-project

# Push existing code
vibe push
```

## Re-initializing

If you need to reinitialize (e.g., after deleting `.vibehub`):

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

This creates a fresh configuration. You'll need to run `vibe set` again to connect to your project.

## Troubleshooting

### Already Initialized

If the project is already initialized:

* The command will notify you
* Your existing configuration is preserved
* Use `vibe status` to check current state

### Permission Denied

If you can't create the `.vibehub` directory:

* Check you have write permissions in the current directory
* Ensure you're not in a read-only location

## Related Commands

* [vibe set](/cli/commands/clone) - Connect to an existing VibeHub project
* [vibe push](/cli/commands/push) - Push commits to VibeHub
* [vibe status](/cli/commands/status) - Check repository status
