permachine 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +42 -0
  2. package/dist/cli.js +4072 -3461
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -119,6 +119,48 @@ Same pattern works for `.env` files:
119
119
  | Machine-specific | `.env.{machine=laptop}` | ✅ Yes |
120
120
  | Final output | `.env` | ❌ No (gitignored) |
121
121
 
122
+ ### Directory Matching (NEW)
123
+
124
+ In addition to file-level merging, you can apply filters to **entire directories**. When a directory matches, all its contents are copied as-is to the output directory (without further filter processing or merging).
125
+
126
+ **Example:**
127
+
128
+ ```bash
129
+ .opencode/skills/
130
+ ├── jira.{machine=homezone}/ # Only exists on machine "homezone"
131
+ │ ├── skill.md
132
+ │ └── templates/
133
+ │ └── issue.md
134
+ ├── work-tools.{machine=laptop}/ # Only exists on machine "laptop"
135
+ │ └── slack.md
136
+ └── shared-skill/ # Regular directory (always present)
137
+ └── common.md
138
+ ```
139
+
140
+ **On machine `homezone`:**
141
+ ```bash
142
+ .opencode/skills/
143
+ ├── jira/ # ← Copied from jira.{machine=homezone}/
144
+ │ ├── skill.md
145
+ │ └── templates/
146
+ │ └── issue.md
147
+ └── shared-skill/
148
+ └── common.md
149
+ ```
150
+
151
+ **Supported filters on directories:**
152
+ - `{machine=hostname}` - Machine-specific directories
153
+ - `{os=windows}`, `{os=macos}`, `{os=linux}` - OS-specific directories
154
+ - `{user=username}` - User-specific directories
155
+ - Multiple filters: `mydir.{machine=laptop}{os=windows}/` (AND logic)
156
+
157
+ **Key behaviors:**
158
+ - Files inside matched directories are copied verbatim (no recursive filter processing)
159
+ - No base directory fallback (unlike files, there's no `mydir.base/` pattern)
160
+ - Nested filtered directories are not allowed: `outer.{machine=X}/inner.{os=Y}/` → Error
161
+ - If multiple directories would produce the same output, an error is raised
162
+ - Stale outputs are renamed with `.permachine-deleted` suffix for safety
163
+
122
164
  ### Basic Commands
123
165
 
124
166
  #### Initialize in Repository