heimdal 1.2.0

A universal dotfile and system configuration manager
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# Heimdal

[![CI](https://github.com/limistah/heimdal/workflows/CI/badge.svg)](https://github.com/limistah/heimdal/actions)
[![Release](https://img.shields.io/github/v/release/limistah/heimdal)](https://github.com/limistah/heimdal/releases)
[![Crates.io](https://img.shields.io/crates/v/heimdal)](https://crates.io/crates/heimdal)
[![License](https://img.shields.io/github/license/limistah/heimdal)](LICENSE)
[![Rust Version](https://img.shields.io/badge/rust-1.70%2B-blue.svg)](https://www.rust-lang.org)
[![Documentation](https://img.shields.io/badge/docs-wiki-blue)](https://github.com/limistah/heimdal/wiki)
[![Packages](https://img.shields.io/badge/packages-60+-green)](https://github.com/limistah/heimdal-packages)

**A universal dotfile and system configuration manager built in Rust**

Heimdal automatically manages your dotfiles, installs packages, and keeps your development environment in sync across multiple machines. Built with Rust for performance and reliability.

πŸ“– **[Full Documentation](https://github.com/limistah/heimdal/wiki)** | 
πŸ“¦ **[Package Database](https://github.com/limistah/heimdal-packages)** | 
πŸ’¬ **[Discussions](https://github.com/limistah/heimdal/discussions)**

---

## ⚑ Quick Start

### Installation

**Homebrew (macOS)**
```bash
brew install limistah/tap/heimdal
```

**APT (Debian/Ubuntu)**
```bash
# One-line setup
curl -fsSL https://raw.githubusercontent.com/limistah/heimdal/main/scripts/install-deb.sh | bash

# Or manual
curl -fsSL https://limistah.github.io/heimdal/gpg | sudo gpg --dearmor -o /usr/share/keyrings/heimdal-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/heimdal-archive-keyring.gpg] https://limistah.github.io/heimdal/deb stable main" | sudo tee /etc/apt/sources.list.d/heimdal.list
sudo apt update && sudo apt install heimdal
```

**Cargo (All Platforms)**
```bash
cargo install heimdal
```

**Universal installer**
```bash
curl -fsSL https://raw.githubusercontent.com/limistah/heimdal/main/install.sh | bash
```

**More installation options:** [Installation Guide β†’](https://github.com/limistah/heimdal/wiki/Installation)

### Setup (2 minutes)

**New to dotfiles?**
```bash
heimdal wizard
```

The interactive wizard guides you through:
- Smart scanning with real-time progress
- Interactive file and package selection
- Smart profile names (auto-generated from hostname/OS)
- Git sync setup with remote configuration

**Migrating from Stow, dotbot, chezmoi, yadm, or homesick?**
```bash
heimdal wizard  # Choose "Import existing dotfiles"
heimdal import --path ~/dotfiles --preview  # Preview before importing
```

**Cloning to a new machine?**
```bash
git clone <your-dotfiles-repo> ~/.dotfiles
cd ~/.dotfiles
heimdal apply
```

[Learn more β†’](https://github.com/limistah/heimdal/wiki/Quick-Start)

---

## ✨ Key Features

- πŸ“¦ **Universal Package Management** - One config for Homebrew, APT, DNF, Pacman, and Mac App Store
- πŸ”— **Intelligent Symlinking** - GNU Stow-compatible with automatic conflict resolution
- 🎯 **Smart Package Discovery** - Fuzzy search, tags, groups, and 60+ curated packages
- πŸ” **Secret Management** - Secure storage using OS keychains (macOS Keychain, Linux Secret Service)
- 🎨 **Template System** - Machine-specific configs with variable substitution
- 🌿 **Git-Based Sync** - Keep configs in sync across machines with automatic conflict detection
- 🎭 **Profile System** - Different configs for work, personal, and server machines
- πŸ€– **Interactive Wizard** - Guided setup with smart defaults
- πŸš€ **Import Support** - Migrate from Stow, dotbot, chezmoi, yadm, homesick
- πŸ”„ **Rollback Support** - Easily revert to previous configurations
- πŸͺ **Hooks System** - Run custom scripts before/after installation
- πŸ” **Dry-Run Mode** - Preview changes before applying them

[Explore all features β†’](https://github.com/limistah/heimdal/wiki/Features)

---

## πŸ“¦ Package System

Heimdal includes a [powerful package database](https://github.com/limistah/heimdal-packages) with 60+ popular development tools, smart search, and curated groups.

### Search & Install
```bash
# Fuzzy search with intelligent scoring
heimdal packages search neovim
heimdal packages install neovim

# Browse by tags
heimdal packages search --tag editor

# Install pre-configured groups
heimdal packages group install web-dev

# Get package info
heimdal packages info docker

# Check for outdated packages
heimdal packages outdated

# Upgrade all outdated packages
heimdal packages upgrade
```

### Supported Package Managers
- **macOS**: Homebrew (formulae + casks), Mac App Store (via `mas`)
- **Debian/Ubuntu**: APT
- **Fedora/RHEL/CentOS**: DNF/YUM
- **Arch/Manjaro**: Pacman

### Available Package Groups

Pre-configured collections for common workflows:

- **`essential`** - Core CLI tools (git, curl, vim, tmux)
- **`web-dev`** - Modern web development (node, yarn, docker, postgres, redis)
- **`rust-dev`** - Rust ecosystem (rust, cargo, rust-analyzer, ripgrep, fd, bat)
- **`python-dev`** - Python development (python, pip, pipenv, pyenv)
- **`go-dev`** - Go development (go, gopls, docker, kubectl)
- **`devops`** - Infrastructure tools (terraform, ansible, docker, kubectl, helm)
- **`data-science`** - Data analysis (python, jupyter, pandas, postgresql)
- **`terminal`** - Enhanced terminal experience (tmux, fzf, ripgrep, bat, delta)

[See all 15+ groups β†’](https://github.com/limistah/heimdal/wiki/Package-Groups)

### Smart Features
- βœ… Dependency detection and suggestions
- βœ… Outdated package detection
- βœ… Cross-platform package mapping
- βœ… Installation status checking
- βœ… Fuzzy search with typo tolerance
- βœ… Tag-based filtering
- βœ… Automatic suggestions based on project files

**Want to add a package?** See the [Package Contribution Guide β†’](https://github.com/limistah/heimdal-packages/blob/main/CONTRIBUTING.md)

---

## πŸ—οΈ Architecture

Heimdal consists of two repositories:

### [`limistah/heimdal`]https://github.com/limistah/heimdal (This repo)
The main CLI tool - installation, configuration, and management commands.

**Contribute here for:**
- πŸ› Bug fixes and issue reports
- ✨ New CLI features and commands
- πŸ”§ Core functionality improvements
- πŸ“š Documentation updates

[Development Guide β†’](https://github.com/limistah/heimdal/wiki/CLI-Development)

### [`limistah/heimdal-packages`]https://github.com/limistah/heimdal-packages
The package metadata database - YAML definitions compiled to binary format (20KB, 60+ packages).

**Contribute here for:**
- πŸ“¦ Adding new packages
- 🏷️ Updating package metadata
- πŸ“ Package descriptions and tags
- 🎯 New package groups

[Package Contribution Guide β†’](https://github.com/limistah/heimdal-packages/blob/main/CONTRIBUTING.md)

### How It Works

```
User β†’ Heimdal CLI β†’ Package Database (60+ packages)
                    β”œβ”€β†’ Homebrew / APT / DNF / Pacman / MAS
                    β”œβ”€β†’ Dotfile Management (GNU Stow compatible)
                    β”œβ”€β†’ Secret Management (OS Keychain)
                    └─→ Git Sync (with state management)
```

The package database is downloaded from GitHub Releases and cached locally (`~/.heimdal/cache/packages.db`). It auto-updates every 7 days.

---

## πŸ“š Documentation

### For Users
- [πŸ“– Quick Start Guide]https://github.com/limistah/heimdal/wiki/Quick-Start
- [πŸ“¦ Package Management]https://github.com/limistah/heimdal/wiki/Package-Management
- [🎭 Profile System]https://github.com/limistah/heimdal/wiki/Profile-System
- [πŸ“ Dotfile Management]https://github.com/limistah/heimdal/wiki/Dotfile-Management
- [🎨 Template System]https://github.com/limistah/heimdal/wiki/Template-System
- [πŸ” Secret Management]https://github.com/limistah/heimdal/wiki/Secret-Management
- [🌿 Git Sync]https://github.com/limistah/heimdal/wiki/Git-Sync
- [βš™οΈ Configuration Reference]https://github.com/limistah/heimdal/wiki/Configuration
- [πŸ› Troubleshooting]https://github.com/limistah/heimdal/wiki/Troubleshooting

### For Contributors
- [πŸ”§ CLI Development Guide]https://github.com/limistah/heimdal/wiki/CLI-Development
- [πŸ“¦ Package Contributions]https://github.com/limistah/heimdal-packages/blob/main/CONTRIBUTING.md
- [πŸ§ͺ Testing Guide]docs/dev/TESTING.md
- [🀝 Contributing Guide]docs/dev/CONTRIBUTING.md

### Technical Docs
- [πŸ—οΈ Architecture Overview]docs/ARCHITECTURE.md
- [πŸ”’ State Management]docs/STATE_MANAGEMENT.md - Locking, conflict resolution
- [πŸ’Ύ Package Database Design]docs/PACKAGE_DATABASE.md - Binary format, indexing
- [πŸ—ΊοΈ Module Guide]docs/MODULE_GUIDE.md - Codebase structure

---

## 🎯 Example Configuration

Here's a minimal `heimdal.yaml` to get started:

```yaml
global:
  dotfiles_dir: ~/.dotfiles
  ignore_patterns:
    - ".git"
    - "*.swp"
    - ".DS_Store"

package_sources:
  packages:
    - git
    - neovim
    - tmux
    - fzf
  groups:
    - rust-dev

profiles:
  work:
    packages:
      - docker
      - kubectl
      - terraform
    dotfiles:
      targets:
        - path: ~/dotfiles/work
          stow: true
    templates:
      email: "work@example.com"

  personal:
    packages:
      - spotify
    dotfiles:
      targets:
        - path: ~/dotfiles/personal
          stow: true
    templates:
      email: "personal@example.com"
```

**More examples:**
- [Minimal configuration]examples/minimal.yaml
- [Full-featured setup]examples/full.yaml
- [Cross-platform configuration]examples/multi-platform.yaml

---

## πŸš€ Usage Examples

### Basic Workflow
```bash
# Initialize a new dotfiles repository
heimdal wizard

# Apply your configuration
heimdal apply

# Sync changes to/from Git
heimdal sync

# Check status
heimdal status

# Switch profiles
heimdal profile switch personal

# Validate configuration
heimdal validate
```

### Package Management
```bash
# Search for packages
heimdal packages search ripgrep

# Install a package
heimdal packages install ripgrep

# Install a package group
heimdal packages group install terminal

# List installed packages
heimdal packages list --installed

# Check for outdated packages
heimdal packages outdated

# Upgrade all packages
heimdal packages upgrade
```

### Advanced Features
```bash
# Dry-run before applying
heimdal apply --dry-run

# Import from existing dotfiles
heimdal import --path ~/old-dotfiles

# Rollback to previous state
heimdal rollback

# View sync history
heimdal history

# Manage secrets
heimdal secret set API_KEY "secret-value"
heimdal secret get API_KEY
```

[See full CLI reference β†’](https://github.com/limistah/heimdal/wiki/CLI-Reference)

---

## πŸ’¬ Community & Support

- πŸ› **Bug Reports:** [GitHub Issues]https://github.com/limistah/heimdal/issues
- πŸ’‘ **Feature Requests:** [GitHub Discussions]https://github.com/limistah/heimdal/discussions
- πŸ’¬ **Questions:** [GitHub Discussions]https://github.com/limistah/heimdal/discussions
- πŸ“¦ **Package Requests:** [heimdal-packages Issues]https://github.com/limistah/heimdal-packages/issues

---

## 🀝 Contributing

We welcome contributions! Here's how to get involved:

### CLI Development

1. Fork this repository
2. Clone your fork: `git clone <your-fork-url>`
3. Create a feature branch: `git checkout -b feature/amazing-feature`
4. Make your changes
5. Run tests: `cargo test`
6. Run clippy: `cargo clippy --all-targets`
7. Commit your changes: `git commit -m 'Add amazing feature'`
8. Push to your fork: `git push origin feature/amazing-feature`
9. Open a Pull Request

[See full CLI development guide β†’](https://github.com/limistah/heimdal/wiki/CLI-Development)

### Package Contributions

Want to add a package to the database?

1. Head to [`limistah/heimdal-packages`]https://github.com/limistah/heimdal-packages
2. Follow the [contribution guide]https://github.com/limistah/heimdal-packages/blob/main/CONTRIBUTING.md
3. Create a YAML file for your package
4. Run validation: `cargo run --bin validate`
5. Submit a Pull Request

Package contributions are quick and easy - most packages take <5 minutes to add!

---

## πŸ”§ Directory Structure

Heimdal uses the following directories:

- `~/.heimdal/` - Heimdal state and data
  - `state.json` - Current state (active profile, last sync, etc.)
  - `cache/packages.db` - Cached package database
  - `backups/` - Backup of overwritten files
- `~/.dotfiles/` - Default dotfiles directory (customizable via config)
- `/usr/local/bin/heimdal` - Heimdal binary (or `~/.cargo/bin/heimdal`)

---

## πŸ“„ License

MIT License - see [LICENSE](LICENSE) for details

---

## πŸ™ Acknowledgments

- Inspired by [GNU Stow]https://www.gnu.org/software/stow/, [Homebrew]https://brew.sh/, and various dotfile management tools
- Built with [Rust]https://www.rust-lang.org/ for performance and reliability
- Thanks to all [contributors]https://github.com/limistah/heimdal/graphs/contributors and users!

---

## πŸ”— Links

- **Main Repository:** https://github.com/limistah/heimdal
- **Package Database:** https://github.com/limistah/heimdal-packages
- **Documentation:** https://github.com/limistah/heimdal/wiki
- **Crates.io:** https://crates.io/crates/heimdal
- **Changelog:** [CHANGELOG.md]CHANGELOG.md

---

**Built by [@limistah](https://github.com/limistah)**