@garyr/pt-cli 0.39.1 → 0.40.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.
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ import { Command } from 'commander';
3
3
  import chalk from 'chalk';
4
4
  // Command imports
5
5
  import { learn } from './commands/learnCommand.js';
6
+ import { update } from './commands/updateCommand.js';
6
7
  import { init } from './commands/initCommand.js';
7
8
  import { configCommand } from './commands/configCommand.js';
8
9
  import { ignoreCommand } from './commands/ignoreCommand.js';
@@ -52,9 +53,10 @@ program
52
53
  .option('--ignore <patterns>', 'Folder patterns to ignore (comma-separated)')
53
54
  .option('-y, --yes', 'Automatically confirm prompts')
54
55
  .option('--desc <description>', 'Template description (skip prompt)')
56
+ .option('--no-diff', 'Disable additive mode, show full list')
55
57
  .action(async (templateName, sourcePath, options) => {
56
58
  try {
57
- await learn(sourcePath || '.', templateName, options);
59
+ await update(sourcePath || '.', templateName, options);
58
60
  }
59
61
  catch (err) {
60
62
  console.error(chalk.red(`Error: ${err.message || err}`));
package/doc/usage.md CHANGED
@@ -7,9 +7,13 @@
7
7
  pt learn /path/to/PROJECT
8
8
 
9
9
  # Update an existing template (use current directory if no path given)
10
+ # (Runs in additive difference mode by default: shows only new items, auto-selected, for de-selection)
10
11
  pt update <template_name>
11
12
  pt update <template_name> /path/to/PROJECT
12
13
 
14
+ # Use full mode (original behavior, presents all items)
15
+ pt update <template_name> /path/to/PROJECT --no-diff
16
+
13
17
  # Ignore specific folders during learning
14
18
  pt learn /path/to/PROJECT --ignore=DAILIES/*,PARKING_LOT/*,REFERENCE/*
15
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@garyr/pt-cli",
3
- "version": "0.39.1",
3
+ "version": "0.40.0",
4
4
  "description": "Project Template CLI - Learn structures and initialize projects",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -27,7 +27,11 @@ As an agent equipped with this skill, you have the ability to rapidly scaffold,
27
27
  3. **Capturing Knowledge (`pt learn`):**
28
28
  If you spend time establishing a new, complex directory structure or configuration (e.g., a specific flavor of an Express backend with testing hooks), save it! Remote URLs (GitHub, Gitea, etc.) are automatically translated to tarball downloads.
29
29
  - **Command:** `pt learn <source_path> --name <template_name> --desc "<Description>" --yes`
30
- - **Update existing template:** Update an existing template with new structure/files: `pt update <template_name> <source_path> --yes`
30
+ - **Update existing template:** Update an existing template with new structure/files: `pt update <template_name> <source_path> --yes`.
31
+ - **Additive Difference Mode (Default):** By default, `pt update` operates in an additive mode that only presents *new* folders, files, and variables from the target directory to the user for de-selection. Existing items and their configurations (such as `substitute_variables` and `post_copy` settings) are preserved as-is.
32
+ - **Editing Metadata:** During update, description and templateRoot are presented for editing with the existing template values pre-filled as defaults.
33
+ - **Global/Default Variables:** Default/global variables require the user to explicitly opt-in via checkboxes, rather than being automatically added.
34
+ - **Full/Original Mode:** To review all items manually instead of showing differences only, pass the `--no-diff` flag: `pt update <template_name> <source_path> --no-diff`
31
35
  - **Remote Templates:** Learn from a remote Git repository or archive URL directly! Pass the HTTP/HTTPS URL as the `<source_path>`:
32
36
  `pt learn https://github.com/username/my-template --name my_template --desc "Description" --yes`
33
37
  - Explain to the user that you've captured this template for future use.
@@ -191,7 +195,7 @@ For more details, see the [Security Guide](security.md).
191
195
  | Command | Description |
192
196
  |---------|-------------|
193
197
  | `pt learn <path>` | Learn a project structure from an existing directory |
194
- | `pt update <template> [path]` | Update an existing template with new structure/files |
198
+ | `pt update <template> [path]` | Update an existing template (additive difference mode by default, use --no-diff for full mode) |
195
199
  | `pt init [template] [dest]` | Initialize a new project from a learned template |
196
200
  | `pt config [template]` | Show current config location and list templates, or export a specific template |
197
201
  | `pt variables [pairs]` | View or set global variables (comma-separated key=value) |