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

> Stage files for the next commit

## Usage

```bash theme={null}
vibe add [files...] [options]
```

## Description

Stage files to be included in your next commit. Similar to `git add`, this command marks files as ready to be committed.

## Arguments

<ParamField query="files" type="string[]">
  One or more file paths to stage. Use `.` to stage all changes.
</ParamField>

## Options

<ParamField query="--all" type="boolean">
  Stage all modified and new files. Shorthand: `-A`
</ParamField>

<ParamField query="--verbose" type="boolean">
  Show detailed output of staged files. Shorthand: `-v`
</ParamField>

## Examples

### Stage a Single File

```bash theme={null}
vibe add src/app.js
```

### Stage Multiple Files

```bash theme={null}
vibe add src/app.js src/utils.js README.md
```

### Stage All Changes

```bash theme={null}
vibe add .
```

Or:

```bash theme={null}
vibe add --all
```

### Stage with Verbose Output

```bash theme={null}
vibe add . --verbose
```

## Output

### Basic Output

```
✓ Staged 3 files for commit
```

### Verbose Output

```
Staging files...
  + src/app.js (modified)
  + src/utils.js (new file)
  + README.md (modified)

✓ Staged 3 files for commit
```

## File States

| State        | Description                              |
| ------------ | ---------------------------------------- |
| **new file** | File is being tracked for the first time |
| **modified** | Existing file has changes                |
| **deleted**  | File has been removed                    |
| **renamed**  | File has been moved or renamed           |

## Workflow

A typical workflow using `vibe add`:

```bash theme={null}
# 1. Make changes to your code
vim src/app.js

# 2. Check what's changed
vibe status

# 3. Stage specific files
vibe add src/app.js

# 4. Or stage everything
vibe add .

# 5. Commit the staged changes
vibe commit -m "Add new feature"

# 6. Push to VibeHub
vibe push
```

## Staging vs Committing

<Note>
  `vibe add` only stages files locally. You must run `vibe commit` to create a commit, then `vibe push` to sync with VibeHub.
</Note>

| Command       | What It Does                       |
| ------------- | ---------------------------------- |
| `vibe add`    | Stages files for the next commit   |
| `vibe commit` | Creates a commit from staged files |
| `vibe push`   | Pushes commits to VibeHub          |

## Unstaging Files

To unstage files before committing:

```bash theme={null}
vibe reset src/app.js
```

Or unstage all:

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

## Ignoring Files

Files listed in `.gitignore` or `.vibeignore` will be excluded from staging.

Common patterns to ignore:

```
# .vibeignore
node_modules/
.env
*.log
dist/
.DS_Store
```

## Best Practices

<AccordionGroup>
  <Accordion title="Stage Related Changes Together" icon="layer-group">
    Group related changes in a single commit. Don't mix unrelated changes.

    ```bash theme={null}
    # Good: Stage related auth files
    vibe add src/auth.js src/login.js tests/auth.test.js
    vibe commit -m "Add user authentication"
    ```
  </Accordion>

  <Accordion title="Review Before Staging" icon="eye">
    Check what you're about to stage:

    ```bash theme={null}
    vibe status
    vibe add src/app.js
    ```
  </Accordion>

  <Accordion title="Use Verbose Mode" icon="list">
    When staging many files, use verbose mode to see what's included:

    ```bash theme={null}
    vibe add . --verbose
    ```
  </Accordion>
</AccordionGroup>

## Related Commands

* [vibe commit](/cli/commands/commit) - Commit staged changes
* [vibe status](/cli/commands/status) - See what's staged and unstaged
* [vibe push](/cli/commands/push) - Push commits to VibeHub
