# Rustelo CLI API Reference

## Feature Management Commands

### `cargo rustelo features`

Main feature management command group.

#### Subcommands

##### `list`
List available or installed features.

```bash
cargo rustelo features list
cargo rustelo features list --available
cargo rustelo features list --installed
```

##### `add <feature>`
Add a feature to the current project.

```bash
cargo rustelo features add analytics
cargo rustelo features add analytics --force
cargo rustelo features add analytics --no-deps
```

Options:
- `--force`: Force installation even if conflicts exist
- `--no-deps`: Skip dependency resolution

##### `remove <feature>`
Remove a feature from the current project.

```bash
cargo rustelo features remove analytics
cargo rustelo features remove analytics --clean-deps
```

Options:
- `--clean-deps`: Also remove unused dependencies

##### `status [feature]`
Check feature status and dependencies.

```bash
cargo rustelo features status
cargo rustelo features status analytics
```

##### `sync`
Sync feature configurations.

```bash
cargo rustelo features sync
cargo rustelo features sync --force
```

Options:
- `--force`: Force sync even if conflicts exist

## Integration System

The integration system handles:

1. **Dependency Integration**: Updates Cargo.toml and package.json
2. **Environment Integration**: Manages .env variables
3. **Configuration Integration**: Merges TOML/JSON configs
4. **Resource Integration**: Copies assets, content, i18n files
5. **Styling Integration**: Updates UnoCSS configuration
6. **Infrastructure Integration**: Updates Docker compose files
7. **Development Integration**: Integrates scripts and Just commands

## Feature Manifest Format

Feature manifests are defined in `features/<name>/feature.toml`:

```toml
[feature]
name = "analytics"
version = "0.1.0"
source = "p-jpl-website"
description = "Comprehensive analytics system"
requires = []

[dependencies]
workspace = ["chrono", "serde_json", "prometheus"]
external = ["ratatui = '0.29'", "lru = '0.16'"]

[[environment.variables]]
name = "ANALYTICS_ENABLED"
default = "true"
required = false

[configuration]
files = [
    { path = "config/analytics.toml", template = "templates/analytics.config.toml" }
]

[resources]
public = [
    { from = "assets/analytics.js", to = "public/js/analytics.js" }
]

[[scripts]]
from = "scripts/analytics-report.nu"
to = "scripts/analytics/report.nu"
```
