# --base-dir

Base directory (auto-fills all directories from standard structure)

## Synopsis

```bash
cupertino save --base-dir <path>
```

## Description

Specifies the base directory containing the standard Cupertino directory structure. When provided, automatically derives paths for all subdirectories:

- `docs/` - Apple Developer documentation
- `swift-evolution/` - Swift Evolution proposals
- `swift-org/` - Swift.org documentation
- `packages/` - Swift package READMEs
- `metadata.json` - Crawl metadata
- `search.db` - Search database

Individual directory options (`--docs-dir`, `--evolution-dir`, etc.) override the base-derived paths.

## Default

`~/.cupertino`

## Examples

### Index Default Base Directory
```bash
cupertino save
```

Equivalent to:
```bash
cupertino save --base-dir ~/.cupertino
```

### Index Custom Base Directory
```bash
cupertino save --base-dir ./my-cupertino
```

Auto-fills:
- `--docs-dir ./my-cupertino/docs`
- `--evolution-dir ./my-cupertino/swift-evolution`
- `--swift-org-dir ./my-cupertino/swift-org`
- `--packages-dir ./my-cupertino/packages`
- `--metadata-file ./my-cupertino/metadata.json`
- `--search-db ./my-cupertino/search.db`

### Override Specific Paths
```bash
cupertino save --base-dir ~/cupertino-data --search-db ~/databases/search.db
```

Uses `~/cupertino-data` for all directories except the search database.

### Absolute Path
```bash
cupertino save --base-dir /Users/username/Documents/cupertino
```

## Expected Structure

The base directory should follow this layout:

```
base-dir/
├── docs/                    # Apple docs (from fetch --type docs)
│   ├── metadata.json
│   ├── swiftui/
│   └── foundation/
├── swift-evolution/         # Proposals (from fetch --type evolution)
│   ├── SE-0001-*.md
│   └── SE-0002-*.md
├── swift-org/               # Swift.org docs (from fetch --type swift)
│   └── *.md
├── packages/                # Package READMEs (from fetch --type packages)
│   └── owner/
│       └── repo/
└── search.db                # Generated by save command
```

## Notes

- Simplifies command invocation when using standard structure
- Tilde (`~`) expansion is supported
- Individual options take precedence over base-derived paths
- Base directory does not need to exist yet (subdirectories created as needed)
- Recommended approach for most users
- Useful for managing multiple documentation sets

## See Also

- `--docs-dir` - Override docs directory
- `--evolution-dir` - Override Swift Evolution directory
- `--swift-org-dir` - Override Swift.org directory
- `--packages-dir` - Override packages directory
- `--metadata-file` - Override metadata file path
- `--search-db` - Override search database path
