> ## 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 clone

> Clone a VibeHub project to your local machine

## Usage

```bash theme={null}
vibe clone <project-url> [directory]
```

## Description

Clone a VibeHub project to create a local copy. This downloads all files and sets up the project for local development.

## Arguments

<ParamField query="project-url" type="string" required>
  The URL of the VibeHub project to clone.
  Example: `https://vibehub.co.in/username/project-name`
</ParamField>

<ParamField query="directory" type="string">
  Optional directory name. Defaults to the project name.
</ParamField>

## Examples

### Basic Clone

```bash theme={null}
vibe clone https://vibehub.co.in/username/my-project
```

This creates a `my-project` directory with all the project files.

### Clone to Specific Directory

```bash theme={null}
vibe clone https://vibehub.co.in/username/my-project ./custom-folder
```

### Clone and Enter Directory

```bash theme={null}
vibe clone https://vibehub.co.in/username/my-project && cd my-project
```

## What Gets Cloned

| Content               | Included                |
| --------------------- | ----------------------- |
| All files             | Yes                     |
| Latest file versions  | Yes                     |
| VibeHub configuration | Yes                     |
| Commit history        | Metadata only           |
| AI prompts            | Viewable in VibeHub web |

## Prerequisites

* Must be authenticated with `vibe login`
* Must have access to the project (owner or collaborator)

## Output

A successful clone shows:

```
Cloning vibehub.co.in/username/my-project...
✓ Created directory: my-project
✓ Downloaded 47 files
✓ Configured VibeHub sync
Clone complete!

cd my-project to get started.
```

## After Cloning

Once cloned, you can immediately:

```bash theme={null}
# Enter the directory
cd my-project

# Check status
vibe status

# Make changes and push
# ... edit files ...
vibe push
```

The project is automatically connected - no need to run `vibe init` or `vibe set`.

## Cloning Private Projects

For private projects, you must:

1. Be logged in (`vibe login`)
2. Be a collaborator on the project

If you try to clone a project you don't have access to:

```
Error: Access denied. You don't have permission to access this project.
```

## Error Handling

### Project Not Found

```
Error: Project not found. Check the URL and try again.
```

**Solution:** Verify the project URL is correct.

### Directory Exists

```
Error: Directory 'my-project' already exists.
```

**Solution:** Either:

* Remove the existing directory
* Specify a different directory name

### Not Authenticated

```
Error: Not logged in. Run 'vibe login' first.
```

**Solution:** Authenticate with `vibe login`.

## Clone vs Set

| Command      | Use Case                                          |
| ------------ | ------------------------------------------------- |
| `vibe clone` | Starting fresh, downloading a project             |
| `vibe set`   | Connecting an existing local directory to VibeHub |

Use `clone` when you don't have the files locally.
Use `set` when you already have files and want to connect them.

## Related Commands

* [vibe set](/cli/commands/init) - Connect existing directory to VibeHub
* [vibe pull](/cli/commands/pull) - Update an already-cloned project
* [vibe status](/cli/commands/status) - Check project status
