You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cmds/apply.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,15 @@ Reconciles system state by installing missing packages and deploying missing dot
5
5
## Synopsis
6
6
7
7
```bash
8
-
plonk apply [options]
8
+
plonk apply [options] [files...]
9
9
```
10
10
11
11
## Description
12
12
13
13
The apply command reconciles the system state with the desired configuration by installing packages listed in `plonk.lock` and deploying dotfiles from `$PLONK_DIR`. It acts like a sync operation, bringing the local environment in line with the managed configuration.
14
14
15
+
When file arguments are provided, apply validates that the specified files are managed by plonk before proceeding.
16
+
15
17
Apply targets "missing" resources (tracked but not present) and "drifted" dotfiles (modified since deployment), transitioning them to "managed" state. The command uses plonk's internal reconciliation system to identify what needs to be applied.
16
18
17
19
## Options
@@ -68,6 +70,9 @@ Files matching `ignore_patterns` are excluded from deployment.
68
70
# Apply all changes (packages and dotfiles)
69
71
plonk apply
70
72
73
+
# Apply only specific dotfiles
74
+
plonk apply ~/.vimrc ~/.zshrc
75
+
71
76
# Preview what would be changed
72
77
plonk apply --dry-run
73
78
@@ -87,3 +92,5 @@ plonk apply --dotfiles
87
92
## Notes
88
93
89
94
- The `--packages` and `--dotfiles` flags cannot be used together
95
+
- File arguments cannot be combined with `--packages` or `--dotfiles` flags
96
+
- All specified files must be managed by plonk or command will fail
**Problem**: Current ordering is inconsistent with user mental model.
219
226
220
-
**Fix**: Display `$HOME` (deployed location) on the left and `$PLONKDIR` (source) on the right, matching standard diff conventions where "original" is on left and "modified" is on right.
227
+
**Fix Applied**:
228
+
- Swapped diff arguments from `source, dest` to `dest, source`
229
+
- Now shows $HOME (deployed) on left and $PLONKDIR (source) on right
230
+
- Matches standard diff conventions (current state vs. source)
231
+
- File: `internal/commands/diff.go`
221
232
222
233
## Feature Additions
223
234
224
-
### 11. Add `plonk add -y` to sync drifted files back to $PLONKDIR
235
+
### 11. ✅ Add `plonk add -y` to sync drifted files back to $PLONKDIR (COMPLETED)
225
236
**Priority**: Medium (Feature enhancement)
226
237
**Command**: `plonk add`
238
+
**Status**: ✅ Completed (commit 55e9249)
227
239
228
240
**Feature**: Add a `-y` or `--sync-drifted` flag to automatically copy all drifted files from $HOME back to $PLONKDIR (reverse of `apply`).
229
241
230
-
**Use case**: When you've edited dotfiles in $HOME and want to quickly capture all changes back to your managed config directory.
231
-
232
-
**Behavior**:
242
+
**Implementation**:
233
243
```bash
234
-
plonk add -y
235
-
# Finds all files with "drifted" status
236
-
# Copies them from $HOME to $PLONKDIR
237
-
# Updates timestamps/hashes
244
+
plonk add -y # Sync all drifted files
245
+
plonk add -y --dry-run # Preview what would be synced
238
246
```
239
247
240
-
**Implementation considerations**:
241
-
- Should show which files will be synced before copying (or require `-y` for non-interactive)
242
-
- Consider `--dry-run` option to preview changes
243
-
- Respect `.plonkignore` or similar patterns if implemented
244
-
245
-
### 12. Add selective file deployment to `plonk apply`
248
+
**Changes Applied**:
249
+
- Added `--sync-drifted` flag (short: `-y`) to add command
250
+
- Finds all files with State==StateDegraded (drifted)
251
+
- Copies them from $HOME back to $PLONKDIR
252
+
- Shows summary of synced files
253
+
- Works with `--dry-run` for preview
254
+
- Shows appropriate message when no files are drifted
0 commit comments