@promptscript/cli 1.0.0-alpha.0 → 1.0.0-alpha.10

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 (39) hide show
  1. package/CHANGELOG.md +362 -0
  2. package/README.md +56 -9
  3. package/index.js +14646 -10439
  4. package/package.json +29 -17
  5. package/src/cli.d.ts.map +1 -1
  6. package/src/commands/compile.d.ts +2 -1
  7. package/src/commands/compile.d.ts.map +1 -1
  8. package/src/commands/diff.d.ts.map +1 -1
  9. package/src/commands/init.d.ts.map +1 -1
  10. package/src/commands/pull.d.ts +1 -2
  11. package/src/commands/pull.d.ts.map +1 -1
  12. package/src/commands/update-check.d.ts +6 -0
  13. package/src/commands/update-check.d.ts.map +1 -0
  14. package/src/commands/validate.d.ts.map +1 -1
  15. package/src/index.d.ts +3 -0
  16. package/src/index.d.ts.map +1 -1
  17. package/src/output/console.d.ts +15 -1
  18. package/src/output/console.d.ts.map +1 -1
  19. package/src/prettier/index.d.ts +2 -0
  20. package/src/prettier/index.d.ts.map +1 -0
  21. package/src/prettier/loader.d.ts +36 -0
  22. package/src/prettier/loader.d.ts.map +1 -0
  23. package/src/services.d.ts +1 -0
  24. package/src/services.d.ts.map +1 -1
  25. package/src/templates/migrate-skill.d.ts +9 -0
  26. package/src/templates/migrate-skill.d.ts.map +1 -0
  27. package/src/types.d.ts +12 -2
  28. package/src/types.d.ts.map +1 -1
  29. package/src/utils/ai-tools-detector.d.ts +11 -1
  30. package/src/utils/ai-tools-detector.d.ts.map +1 -1
  31. package/src/utils/manifest-loader.d.ts +157 -0
  32. package/src/utils/manifest-loader.d.ts.map +1 -0
  33. package/src/utils/registry-resolver.d.ts +41 -0
  34. package/src/utils/registry-resolver.d.ts.map +1 -0
  35. package/src/utils/suggestion-engine.d.ts +56 -0
  36. package/src/utils/suggestion-engine.d.ts.map +1 -0
  37. package/src/utils/version-check.d.ts +48 -0
  38. package/src/utils/version-check.d.ts.map +1 -0
  39. package/package.publish.json +0 -32
package/CHANGELOG.md ADDED
@@ -0,0 +1,362 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0-alpha.10](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2026-01-31)
9
+
10
+
11
+ ### chore
12
+
13
+ * prepare alpha release ([c6595b6](https://github.com/mrwogu/promptscript/commit/c6595b6fd639f93f0093c503e8468fbbbf057cf9))
14
+
15
+ ## [1.0.0-alpha.9](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2026-01-30)
16
+
17
+
18
+ ### chore
19
+
20
+ * prepare alpha release ([ce96d95](https://github.com/mrwogu/promptscript/commit/ce96d954ae0a015689dda443effc7e80ce80dec5))
21
+
22
+
23
+ ### Features
24
+
25
+ * **docs:** add interactive terminal demos to homepage and getting started ([b2f781b](https://github.com/mrwogu/promptscript/commit/b2f781b45d57862026e5c8ab8cb4525ccacbbd15))
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **cli:** correct version detection in bundled package ([28c15a2](https://github.com/mrwogu/promptscript/commit/28c15a2622c92e99051854868a45825cbedf80cc))
31
+ * **cli:** use universal migration hint instead of Claude Code specific ([ff2e731](https://github.com/mrwogu/promptscript/commit/ff2e731371840b95ed2378755ff431399903c3c2))
32
+
33
+ ## [1.0.0-alpha.8](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2026-01-30)
34
+
35
+
36
+ ### chore
37
+
38
+ * prepare alpha release ([7b1fe19](https://github.com/mrwogu/promptscript/commit/7b1fe197b1ddc9b0fec87c407f557fbaa67113fd))
39
+
40
+ ## [1.0.0-alpha.7](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2026-01-28)
41
+
42
+
43
+ ### chore
44
+
45
+ * prepare alpha release ([9f2f1ed](https://github.com/mrwogu/promptscript/commit/9f2f1ed61923048312206118ff1e0a10679f9899))
46
+
47
+
48
+ ### Features
49
+
50
+ * **cli:** add registry manifest support for init command ([790ae31](https://github.com/mrwogu/promptscript/commit/790ae312bfef2cb80a74feb6ccbb334f15a3985b))
51
+
52
+ ## [1.0.0-alpha.6](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2026-01-28)
53
+
54
+
55
+ ### chore
56
+
57
+ * prepare alpha release ([970c1c8](https://github.com/mrwogu/promptscript/commit/970c1c8c6bc2ebdc4a508314ce7c9c38ddc10a6d))
58
+
59
+
60
+ ### Features
61
+
62
+ * **cli:** add --migrate flag to init command for AI-assisted migration ([3e567c6](https://github.com/mrwogu/promptscript/commit/3e567c606ddff779b841f76615a2aac93e35dec3))
63
+
64
+
65
+ ### Bug Fixes
66
+
67
+ * **cli:** skip writing unchanged files during compilation ([8542512](https://github.com/mrwogu/promptscript/commit/854251214d927dd5f5dea0aea04a65e0f96819a2))
68
+
69
+ ## [1.0.0-alpha.5](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2026-01-27)
70
+
71
+
72
+ ### chore
73
+
74
+ * prepare alpha release ([54696c9](https://github.com/mrwogu/promptscript/commit/54696c93e27cf9fc2f09dd730b09e568d0dc425e))
75
+
76
+
77
+ ### Features
78
+
79
+ * **cli:** add AI-assisted migration skill and CLI integration ([53e9cca](https://github.com/mrwogu/promptscript/commit/53e9cca8669a30e787cbc2aa7679bb63f7896fce))
80
+ * **cli:** add verbose and debug logging throughout compilation pipeline ([36bd63a](https://github.com/mrwogu/promptscript/commit/36bd63a2fa1dde1acbfd0794bb174f645ef71335))
81
+
82
+
83
+ ### Bug Fixes
84
+
85
+ * **cli:** add migrationCandidates to test mocks ([d8fe117](https://github.com/mrwogu/promptscript/commit/d8fe117ff5523bb5b1c15996e00d8c24548c7b8f))
86
+ * **cli:** extend marker detection from 10 to 20 lines ([229e9bc](https://github.com/mrwogu/promptscript/commit/229e9bc5bf4d0441c9674e6483a5125347b6f0b8))
87
+
88
+ ## [1.0.0-alpha.4](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2026-01-27)
89
+
90
+
91
+ ### ⚠ BREAKING CHANGES
92
+
93
+ * **compiler:** Generated files now have compact marker instead of verbose header. Existing files with legacy marker still recognized.
94
+
95
+ ### chore
96
+
97
+ * prepare alpha release ([8c3a428](https://github.com/mrwogu/promptscript/commit/8c3a428856bc088fb27a4fdd6a16185fe5e63589))
98
+
99
+
100
+ ### Features
101
+
102
+ * **compiler:** add compact PromptScript marker to all outputs ([6d74480](https://github.com/mrwogu/promptscript/commit/6d744800a4ab38030b6c23b2ab949c79977ab12e))
103
+
104
+ ## [1.0.0-alpha.3](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2026-01-27)
105
+
106
+
107
+ ### chore
108
+
109
+ * prepare alpha release ([8bb0fb2](https://github.com/mrwogu/promptscript/commit/8bb0fb2e643566af2fed08a5cd7bc17420c4dd96))
110
+
111
+
112
+ ### Features
113
+
114
+ * **cli:** add file overwrite protection for prs compile ([9213a1d](https://github.com/mrwogu/promptscript/commit/9213a1d6edecff54333c65226a2ede8ff20ae417))
115
+ * **formatting:** add dynamic Prettier configuration support ([c7ceca1](https://github.com/mrwogu/promptscript/commit/c7ceca13928df3449d3ac9f16b1c4749cc48dc2f))
116
+
117
+ ## [1.0.0-alpha.2](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2026-01-24)
118
+
119
+
120
+ ### chore
121
+
122
+ * prepare alpha.2 release ([449fbcc](https://github.com/mrwogu/promptscript/commit/449fbccc119d34ab2a674cbfcd8cc4cc3012d108))
123
+
124
+
125
+ ### Bug Fixes
126
+
127
+ * **cli:** resolve ESM dynamic require error for simple-git ([748a401](https://github.com/mrwogu/promptscript/commit/748a401377b5b58dff1935b94543f65f11f5360c))
128
+ * **formatters:** read devCommands and postWork from [@knowledge](https://github.com/knowledge) block ([83a2727](https://github.com/mrwogu/promptscript/commit/83a272707bf3550142ae440f1a595657bb5704e9))
129
+ * sync package.publish.json keywords and description ([ae7481f](https://github.com/mrwogu/promptscript/commit/ae7481fe64639420ba38fc98ea1349bca17cb91d))
130
+
131
+ ## [1.0.0-alpha.1](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.1...v1.0.0-alpha.1) (2026-01-23)
132
+
133
+
134
+ ### ⚠ BREAKING CHANGES
135
+
136
+ * All packages now use ES Modules. Consumers must use ESM imports.
137
+ * All packages now use ES Modules. Consumers must use ESM imports.
138
+
139
+ ### chore
140
+
141
+ * prepare alpha.1 release ([01bb952](https://github.com/mrwogu/promptscript/commit/01bb952a967566c0dcd61b80eec2119c06966167))
142
+
143
+
144
+ ### refactor
145
+
146
+ * migrate to pure ESM ([72d0333](https://github.com/mrwogu/promptscript/commit/72d0333580c688c617831885c13a270619817d5b))
147
+ * migrate to pure ESM ([8a59387](https://github.com/mrwogu/promptscript/commit/8a59387d6f81ee9db33c46db8e737fe52e705c2e))
148
+
149
+
150
+ ### Features
151
+
152
+ * cli ([d6cfb7c](https://github.com/mrwogu/promptscript/commit/d6cfb7c5ee7262fcfb63f3ee79333fadfb39ee34))
153
+ * **cli/diff:** support pager ([c5133f7](https://github.com/mrwogu/promptscript/commit/c5133f7a58f0f03323c8fa925387178e823d9415))
154
+ * **cli:** add Antigravity to AI tool detection ([809d055](https://github.com/mrwogu/promptscript/commit/809d055d9b9308059306c6dd8d5893ecdfe8f3b5))
155
+ * **cli:** add chokidar watch mode and --registry flag ([afe30a9](https://github.com/mrwogu/promptscript/commit/afe30a93171ae2f08ea3d022b30a1356deca0627))
156
+ * **cli:** add Codecov bundle analysis ([b93568f](https://github.com/mrwogu/promptscript/commit/b93568f81835dd62517ff5f290687dd5ef9cb4da))
157
+ * **cli:** force init ([5275c14](https://github.com/mrwogu/promptscript/commit/5275c14b9559f16cbc1b4aecf2f8edcf520e51ff))
158
+ * **core:** config schema ([2692b4d](https://github.com/mrwogu/promptscript/commit/2692b4d51e1fb20c4df35b5ce6b8264369910bcb))
159
+ * **formatters:** copilot agents support ([886f6fc](https://github.com/mrwogu/promptscript/commit/886f6fca9d0a7cd276997a31e62618ef0153322f))
160
+ * interactive cli init ([3f77d28](https://github.com/mrwogu/promptscript/commit/3f77d28c1f7644cb9c0620ab4b9f94c01d1ea243))
161
+ * **resolver:** add Git registry support for remote configuration sharing ([555e488](https://github.com/mrwogu/promptscript/commit/555e4883c26b45661965d5994cbaf7f43b928d26))
162
+ * support conventions ([3ccea55](https://github.com/mrwogu/promptscript/commit/3ccea55eb92e3374a2613bbf975c7b4cae80fcf5))
163
+
164
+
165
+ ### Bug Fixes
166
+
167
+ * **cli:** change registry configuration default to No ([0927050](https://github.com/mrwogu/promptscript/commit/0927050523df7a659ea5eff47c11ae11dba976a6))
168
+
169
+ ## [1.0.0-alpha.1](https://github.com/mrwogu/promptscript/compare/v1.0.0-alpha.0...v1.0.0-alpha.1) (2026-01-23)
170
+
171
+
172
+ ### Features
173
+
174
+ * **cli:** add Antigravity to AI tool detection ([809d055](https://github.com/mrwogu/promptscript/commit/809d055d9b9308059306c6dd8d5893ecdfe8f3b5))
175
+ * **resolver:** add Git registry support for remote configuration sharing ([555e488](https://github.com/mrwogu/promptscript/commit/555e4883c26b45661965d5994cbaf7f43b928d26))
176
+
177
+
178
+ ### Bug Fixes
179
+
180
+ * **cli:** change registry configuration default to No ([0927050](https://github.com/mrwogu/promptscript/commit/0927050523df7a659ea5eff47c11ae11dba976a6))
181
+
182
+
183
+ ### Miscellaneous Chores
184
+
185
+ * prepare alpha.1 release ([01bb952](https://github.com/mrwogu/promptscript/commit/01bb952a967566c0dcd61b80eec2119c06966167))
186
+
187
+ ## [1.0.0-alpha.0] - 2026-01-22
188
+
189
+ ### Added
190
+
191
+ 🎉 **PromptScript Language Implementation** - A language for standardizing AI instructions across organizations.
192
+
193
+ #### Language Features
194
+
195
+ - **PromptScript Syntax 1.0.0** - Initial language specification for `.prs` files
196
+ - **@meta block** - Metadata with `id` and `syntax` fields, optional `org`, `team`, `tags`
197
+ - **@inherit directive** - Single inheritance from registry namespaces or relative paths
198
+ - **@use directive** - Import fragments for composition with optional aliasing
199
+ - **@extend block** - Modify inherited blocks at any nesting level
200
+ - **Content blocks:**
201
+ - `@identity` - AI persona definition
202
+ - `@context` - Project context with key-value properties and text
203
+ - `@standards` - Coding standards with nested objects (merged during inheritance)
204
+ - `@restrictions` - Things AI should avoid (concatenated during inheritance)
205
+ - `@shortcuts` - Custom commands (child overrides parent)
206
+ - `@params` - Configurable parameters with types and defaults
207
+ - `@guards` - Validation rules with `globs` for file targeting
208
+ - `@skills` - Reusable AI workflows with tool permissions
209
+ - `@local` - Private instructions (not committed to git)
210
+ - `@knowledge` - Reference documentation
211
+ - **Value types:** Strings, numbers, booleans, null, arrays, objects, multi-line text (`"""`)
212
+ - **Type expressions:** `range(min..max)`, `enum("a", "b", "c")`
213
+
214
+ #### Formatters
215
+
216
+ - **GitHub Copilot** - `simple`, `multifile`, `full` versions with agents support (`.github/copilot-instructions.md`, `.github/agents/`, `.github/skills/`)
217
+ - **Claude Code** - `simple`, `multifile`, `full` versions with local memory support (`CLAUDE.md`, `.claude/agents/`, `.claude/skills/`, `CLAUDE.local.md`)
218
+ - **Cursor** - `modern`, `multifile`, `legacy` versions (`.cursor/rules/project.mdc`, `.cursorrules`)
219
+ - **Google Antigravity** - `simple`, `frontmatter` versions (`.agent/rules/project.md`)
220
+ - Output conventions: `markdown` (default) and `xml`
221
+ - Path-specific rule generation with glob patterns
222
+
223
+ #### Internal Packages (bundled into CLI)
224
+
225
+ - `core` - AST types, error classes, utility functions
226
+ - `parser` - PromptScript parser with recovery support
227
+ - `resolver` - Resolution for `@inherit`, `@use`, `@extend` with registry support
228
+ - `validator` - Semantic validation with custom rule support
229
+ - `compiler` - Compilation pipeline with watch mode
230
+ - `formatters` - Multiple formatter implementations
231
+
232
+ #### CLI Features
233
+
234
+ - `prs init` - Project initialization with auto-detection
235
+ - Tech stack detection (TypeScript, JavaScript, Python, Rust, Go, Java, Ruby, PHP, C#)
236
+ - Framework detection (React, Vue, Angular, Next.js, Django, FastAPI, Express, NestJS, etc.)
237
+ - Existing AI tools detection (GitHub Copilot, Claude Code, Cursor)
238
+ - Interactive configuration wizard
239
+ - `prs compile` - Multi-file compilation with watch mode and dry-run support
240
+ - `prs validate` - File validation with detailed error reporting
241
+ - `prs diff` - Show compilation diff
242
+ - `prs pull` - Registry updates
243
+
244
+ #### Configuration
245
+
246
+ - `promptscript.yaml` - Project configuration
247
+ - Registry configuration with authentication support
248
+ - Target configuration for multiple AI platforms
249
+ - Validation rules configuration
250
+
251
+ #### Documentation
252
+
253
+ - Complete language reference
254
+ - API documentation for all 6 packages
255
+ - CLI reference guide
256
+ - Getting started guide and tutorial
257
+ - Multiple examples (minimal, enterprise, skills & local, team setup)
258
+ - Package READMEs with ecosystem diagrams
259
+
260
+ #### Infrastructure
261
+
262
+ - Nx monorepo with pnpm workspaces
263
+ - TypeScript strict mode with 100% type coverage
264
+ - Pure ESM packages with NodeNext module resolution
265
+ - Comprehensive test suite (Vitest)
266
+ - ESLint and Prettier
267
+ - Husky pre-commit hooks (format, lint, schema validation)
268
+ - TypeDoc for automated API documentation
269
+ - MkDocs documentation site with versioning support (mike)
270
+ - GitHub Actions CI/CD pipeline
271
+ - Code coverage tracking
272
+
273
+ ### Internal Architecture
274
+
275
+ > All packages below are internal and bundled into `@promptscript/cli`. They are not published separately.
276
+
277
+ #### core
278
+
279
+ - AST types and interfaces
280
+ - Error classes (`PSError`, `ParseError`, `ResolveError`, `ValidationError`)
281
+ - Utility functions for version comparison, paths, AST operations
282
+ - Config types: `input`, `watch`, `output`, `registry` with auth support
283
+ - Utility exports: `formatPath()`, `diagnostics`, constants
284
+
285
+ #### parser
286
+
287
+ - Chevrotain-based lexer and parser
288
+ - CST to AST transformation
289
+ - `parse()` and `parseOrThrow()` API
290
+ - `parseFile()` function with recovery option
291
+ - Error recovery for better diagnostics
292
+
293
+ #### resolver
294
+
295
+ - `@inherit`, `@use`, `@extend` resolution
296
+ - File loader with registry support
297
+ - `RegistryInterface` for custom registry implementations
298
+ - Standalone `resolve()` function for programmatic use
299
+
300
+ #### validator
301
+
302
+ - Required fields validation
303
+ - Semantic version format checking
304
+ - Custom rule support
305
+ - Standalone `validate()` function
306
+ - `removeRule()` API for dynamic rule management
307
+ - `formatters` export for formatting validation results
308
+
309
+ #### compiler
310
+
311
+ - Resolve → Validate → Format pipeline
312
+ - Watch mode with chokidar for file monitoring
313
+ - Dry-run support
314
+ - Standalone `compile()` function
315
+
316
+ #### formatters
317
+
318
+ - **GitHub Copilot** - `simple`, `multifile`, `full` versions with agents support
319
+ - **Claude Code** - `simple`, `multifile`, `full` versions
320
+ - **Cursor** - `modern`, `multifile`, `legacy` versions
321
+ - **Antigravity** - `simple`, `frontmatter` versions
322
+ - Output conventions: `markdown` or `xml`
323
+ - Base formatter class for custom implementations
324
+ - Standalone `format()` functions for each formatter
325
+
326
+ #### cli (published)
327
+
328
+ - `prs init` - Initialize project with auto-detection
329
+ - Tech stack detection (TypeScript, JavaScript, Python, Rust, Go, Java, Ruby, PHP, C#)
330
+ - Framework detection (React, Vue, Angular, Next.js, Django, FastAPI, etc.)
331
+ - Existing AI tools detection (GitHub, Claude, Cursor)
332
+ - `prs compile` - Compile to target formats with watch mode support
333
+ - `prs validate` - Validate files
334
+ - `prs diff` - Show output diff
335
+ - `prs pull` - Pull registry updates with `--registry` flag
336
+
337
+ ### Configuration
338
+
339
+ - `promptscript.yaml` configuration file
340
+ - Registry and targets configuration with authentication
341
+ - Validation rules configuration
342
+ - Support for multiple output formats per target
343
+
344
+ ### Documentation
345
+
346
+ - Complete language reference
347
+ - CLI and configuration reference
348
+ - Getting started guide and tutorial
349
+ - API documentation for all 6 packages
350
+ - Multiple examples and best practices
351
+
352
+ ### Infrastructure
353
+
354
+ - Nx monorepo with pnpm workspaces
355
+ - TypeScript strict mode
356
+ - Pure ESM packages with NodeNext module resolution
357
+ - Comprehensive test suite with Vitest
358
+ - ESLint and Prettier for code quality
359
+ - Husky pre-commit hooks
360
+ - TypeDoc for automated API documentation
361
+ - MkDocs documentation site with versioning (mike)
362
+ - GitHub Actions CI/CD pipeline
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @promptscript/cli
2
2
 
3
- > Part of the [PromptScript](https://github.com/mrwogu/promptscript) ecosystem - The Infrastructure-as-Code for AI Context.
3
+ > Part of the [PromptScript](https://github.com/mrwogu/promptscript) ecosystem - The Prompt-as-Code for AI Instructions.
4
4
 
5
5
  Command-line interface for PromptScript. Compile, validate, and manage AI instructions at enterprise scale.
6
6
 
@@ -8,16 +8,17 @@ Command-line interface for PromptScript. Compile, validate, and manage AI instru
8
8
 
9
9
  The CLI bundles all internal packages into a single distributable:
10
10
 
11
- ```text
11
+ ```
12
12
  @promptscript/cli (published)
13
13
 
14
- └─► bundles:
15
- ├─► compiler
16
- │ ├─► parser
17
- ├─► resolver
18
- ├─► validator
19
- └─► formatters
20
- └─► core
14
+ ├─► compiler (pipeline orchestration)
15
+ ├─► resolver
16
+ │ ├─► validator ─────► core
17
+ └─► formatters ────► core
18
+
19
+ └─► resolver (inheritance & import resolution)
20
+ ├─► parser ────────► core
21
+ └───────────────────► core
21
22
  ```
22
23
 
23
24
  See the [PromptScript monorepo](https://github.com/mrwogu/promptscript) for development details.
@@ -66,11 +67,21 @@ Options:
66
67
  -w, --watch Watch mode for continuous compilation (uses chokidar)
67
68
  -o, --output <dir> Output directory
68
69
  --dry-run Preview changes without writing files
70
+ --force Force overwrite existing files without prompts
69
71
  --registry <path> Path or URL to registry
72
+ --verbose Show detailed compilation progress
73
+ --debug Show debug information (includes verbose)
70
74
  ```
71
75
 
72
76
  **Watch Mode:** Uses [chokidar](https://github.com/paulmillr/chokidar) for reliable file watching across all platforms. Automatically recompiles when `.prs` files change.
73
77
 
78
+ **Overwrite Protection:** By default, `prs compile` protects user-created files from accidental overwriting. Files generated by PromptScript contain a marker (`> Auto-generated by PromptScript`) and are overwritten silently. For files without this marker:
79
+
80
+ - **Interactive mode:** You'll be prompted to overwrite (y/N/a)
81
+ - **Non-interactive mode:** Compilation fails with a list of conflicting files
82
+
83
+ Use `--force` to skip all prompts and overwrite everything. Use `--dry-run` to preview conflicts before writing.
84
+
74
85
  ### Validate
75
86
 
76
87
  ```bash
@@ -103,6 +114,42 @@ Options:
103
114
 
104
115
  By default, diff output is shown through a pager (`less`) for easy scrolling. Use `--no-pager` to disable this behavior. You can customize the pager via the `PAGER` environment variable.
105
116
 
117
+ ### Check for Updates
118
+
119
+ ```bash
120
+ prs update-check
121
+ ```
122
+
123
+ Checks if a newer version of the CLI is available on npm and displays the result:
124
+
125
+ ```
126
+ @promptscript/cli v1.0.0
127
+ ✓ Up to date
128
+ ```
129
+
130
+ Or if an update is available:
131
+
132
+ ```
133
+ @promptscript/cli v1.0.0
134
+ Update available: 1.0.0 → 1.1.0 (npm i -g @promptscript/cli)
135
+ ```
136
+
137
+ **Automatic Update Checks:** The CLI automatically checks for updates once every 24 hours when running any command. The check is non-blocking and cached locally. To disable automatic checks, set the `PROMPTSCRIPT_NO_UPDATE_CHECK` environment variable:
138
+
139
+ ```bash
140
+ PROMPTSCRIPT_NO_UPDATE_CHECK=1 prs compile
141
+ ```
142
+
143
+ ## Environment Variables
144
+
145
+ | Variable | Description |
146
+ | ------------------------------ | ---------------------------------------------- |
147
+ | `PROMPTSCRIPT_NO_UPDATE_CHECK` | Set to `1` to disable automatic update checks |
148
+ | `PROMPTSCRIPT_VERBOSE` | Set to `1` to enable verbose output |
149
+ | `PROMPTSCRIPT_DEBUG` | Set to `1` to enable debug output |
150
+ | `PAGER` | Custom pager for diff output (default: `less`) |
151
+ | `NO_COLOR` | Set to disable colored output |
152
+
106
153
  ## Configuration
107
154
 
108
155
  Create a `promptscript.yaml` file: