@idea1/cli 1.0.1 → 1.0.3

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 (46) hide show
  1. package/README.md +105 -15
  2. package/dist/commands/create-worktree.d.ts +3 -0
  3. package/dist/commands/create-worktree.d.ts.map +1 -0
  4. package/dist/commands/create-worktree.js +74 -0
  5. package/dist/commands/create-worktree.js.map +1 -0
  6. package/dist/commands/help.d.ts.map +1 -1
  7. package/dist/commands/help.js +22 -3
  8. package/dist/commands/help.js.map +1 -1
  9. package/dist/commands/index.d.ts +4 -1
  10. package/dist/commands/index.d.ts.map +1 -1
  11. package/dist/commands/index.js +7 -1
  12. package/dist/commands/index.js.map +1 -1
  13. package/dist/commands/push.d.ts +3 -0
  14. package/dist/commands/push.d.ts.map +1 -0
  15. package/dist/commands/push.js +125 -0
  16. package/dist/commands/push.js.map +1 -0
  17. package/dist/commands/start-project-item.d.ts.map +1 -1
  18. package/dist/commands/start-project-item.js +9 -59
  19. package/dist/commands/start-project-item.js.map +1 -1
  20. package/dist/commands/update-docs.d.ts +3 -0
  21. package/dist/commands/update-docs.d.ts.map +1 -0
  22. package/dist/commands/update-docs.js +21 -0
  23. package/dist/commands/update-docs.js.map +1 -0
  24. package/dist/lib/settings.d.ts +12 -0
  25. package/dist/lib/settings.d.ts.map +1 -1
  26. package/dist/lib/settings.js +21 -0
  27. package/dist/lib/settings.js.map +1 -1
  28. package/dist/services/config.d.ts +8 -0
  29. package/dist/services/config.d.ts.map +1 -1
  30. package/dist/services/config.js +13 -0
  31. package/dist/services/config.js.map +1 -1
  32. package/dist/services/context.d.ts +26 -0
  33. package/dist/services/context.d.ts.map +1 -0
  34. package/dist/services/context.js +304 -0
  35. package/dist/services/context.js.map +1 -0
  36. package/dist/services/test.d.ts +11 -0
  37. package/dist/services/test.d.ts.map +1 -0
  38. package/dist/services/test.js +52 -0
  39. package/dist/services/test.js.map +1 -0
  40. package/dist/services/worktree.d.ts +32 -0
  41. package/dist/services/worktree.d.ts.map +1 -0
  42. package/dist/services/worktree.js +136 -0
  43. package/dist/services/worktree.js.map +1 -0
  44. package/dist/types/index.d.ts +23 -0
  45. package/dist/types/index.d.ts.map +1 -1
  46. package/package.json +3 -2
package/README.md CHANGED
@@ -5,7 +5,7 @@ CLI tool for Idea1.ai workflow automation - AI-assisted development workflows.
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install -g idea1
8
+ npm install -g @idea1/cli
9
9
  ```
10
10
 
11
11
  ## Usage
@@ -19,18 +19,23 @@ Run commands directly from the command line:
19
19
  idea1 start-project-item https://app.idea1.ai/project/items/590
20
20
  idea1 -s https://app.idea1.ai/project/items/590
21
21
 
22
- # Start with custom options
23
- idea1 -s https://app.idea1.ai/project/items/590 --base-branch main
24
- idea1 -s https://app.idea1.ai/project/items/590 -b prompt
22
+ # Create a new worktree (without a project item)
23
+ idea1 create-worktree my-feature
24
+ idea1 -w my-feature -d main
25
+
26
+ # Commit, push, and create PR
27
+ idea1 push
28
+ idea1 -p --no-tests
25
29
 
26
30
  # Close worktree and create PR
27
31
  idea1 close-worktree
28
- idea1 -c
29
32
  idea1 -c --prompt-pr
30
33
 
34
+ # Update documentation
35
+ idea1 update-docs
36
+
31
37
  # Show help
32
38
  idea1 --help
33
- idea1 -h
34
39
  ```
35
40
 
36
41
  ### Interactive Mode
@@ -42,18 +47,21 @@ $ idea1
42
47
 
43
48
  ╭──────────────────────────────────────────────────╮
44
49
  │ │
45
- │ Idea1 CLI v1.0.0
50
+ │ Idea1 CLI v1.0.1
46
51
  │ ~/src/my-repo-name │
47
52
  │ │
48
53
  ╰──────────────────────────────────────────────────╯
49
54
 
50
55
  Available commands:
51
- /start-project-item (s) - Start implementing a project item in an isolated environment
52
- /close-worktree (c) - Close current worktree, commit changes, and create PR
53
- /help (h, ?) - Show help information
56
+ /start-project-item (s, start) - Start implementing a project item in an isolated branch & worktree
57
+ /create-worktree (w, worktree) - Create a new branch and worktree (no project item associated)
58
+ /close-worktree (c, close) - Close current worktree and create PR
59
+ /push (p, push-changes) - Commit, push changes, and create PR
60
+ /update-docs (docs) - Update README.md for changed folders
61
+ /help (h) - Show help information
54
62
  /exit (q, quit) - Exit the CLI
55
63
 
56
- > [Search and select commands using arrow keys and Enter]
64
+ > [Type "/" to see commands, use arrow keys and tab to navigate, Enter to select]
57
65
  ```
58
66
 
59
67
  ## Commands
@@ -72,11 +80,11 @@ idea1 -s <url> [branch-name] [options]
72
80
  - `[branch-name]` - Custom branch name (optional, auto-generated from item description if not provided)
73
81
 
74
82
  **Options:**
75
- - `-m, --isolation-mode <mode>` - Isolation mode: `worktree` (default) or `container`
83
+ - `-m, --isolation-mode <mode>` - Isolation mode: `worktree` (default) or `container` (not yet implemented)
76
84
  - `-p, --source-path <path>` - Path to source directory
77
85
  - `-b, --base-branch <branch>` - Base branch (default: `working/release`). Use `prompt` to interactively select.
78
- - `--build-image` - Force rebuild of Docker image (container mode only)
79
- - `--disable-firewall` - Disable network firewall (container mode only)
86
+ - `--build-image` - Force rebuild of Docker image (container mode only, not yet implemented)
87
+ - `--disable-firewall` - Disable network firewall (container mode only, not yet implemented)
80
88
 
81
89
  **What it does:**
82
90
  1. Sets the item's workflow status to "Agent implementation"
@@ -86,6 +94,50 @@ idea1 -s <url> [branch-name] [options]
86
94
  5. Runs any setup hooks defined in `.idea1/settings.json`
87
95
  6. Launches Claude Code with the implementation prompt
88
96
 
97
+ ### create-worktree
98
+
99
+ Create a new branch and git worktree for development (without a project item).
100
+
101
+ ```bash
102
+ idea1 create-worktree <branch-name> [options]
103
+ idea1 -w <branch-name> [options]
104
+ ```
105
+
106
+ **Arguments:**
107
+ - `<branch-name>` - Name for the new branch (required)
108
+
109
+ **Options:**
110
+ - `-d, --dest-branch <branch>` - Base branch to branch from (default: from settings or `working/release`)
111
+ - `-p, --branch-prefix <prefix>` - Prefix for new branch (default: from settings or `working/agent`)
112
+ - `-s, --source-path <path>` - Path to source directory
113
+
114
+ **What it does:**
115
+ 1. Creates a new branch from the base branch
116
+ 2. Creates a git worktree for isolated development
117
+ 3. Runs any setup hooks defined in `.idea1/settings.json`
118
+
119
+ ### push
120
+
121
+ Commit and push changes, optionally creating a PR.
122
+
123
+ ```bash
124
+ idea1 push [options]
125
+ idea1 -p [options]
126
+ ```
127
+
128
+ **Options:**
129
+ - `-i, --project-item-url <url>` - Project item URL for commit message
130
+ - `--no-project-item` - Skip project item URL
131
+ - `--no-tests` - Skip running tests before PR creation
132
+ - `--create-pr <true|false>` - Whether to create PR (default: true)
133
+ - `-d, --dest-branch <branch>` - PR target branch
134
+
135
+ **What it does:**
136
+ 1. Commits all changes with a descriptive message
137
+ 2. Pushes to remote
138
+ 3. Runs tests if configured (skippable with `--no-tests`)
139
+ 4. Creates a PR if requested
140
+
89
141
  ### close-worktree
90
142
 
91
143
  Close the current worktree, commit changes, and create a PR.
@@ -108,16 +160,44 @@ idea1 -c [options]
108
160
  5. Removes the git worktree
109
161
  6. Cleans up orphaned branch configs
110
162
 
163
+ ### update-docs
164
+
165
+ Update README.md files for folders with code changes.
166
+
167
+ ```bash
168
+ idea1 update-docs
169
+ idea1 docs
170
+ ```
171
+
172
+ **What it does:**
173
+ 1. Finds all folders with staged, unstaged, or PR file changes
174
+ 2. Classifies changes as "small" or "large" to determine update strategy
175
+ 3. Uses Claude to update or create README.md files
176
+ 4. Respects `.contextignore` patterns to skip folders
177
+
111
178
  ## Configuration
112
179
 
180
+ ### Configuration Hierarchy
181
+
182
+ Settings are resolved in order of priority:
183
+ 1. **CLI argument** (highest priority)
184
+ 2. **User-level XDG config** (`~/.config/idea1-cli/config.json`)
185
+ 3. **Repository-level `.idea1/settings.json`**
186
+ 4. **Hardcoded defaults** (lowest priority)
187
+
113
188
  ### Repository Settings
114
189
 
115
- Create `.idea1/settings.json` in your repository root to configure hooks:
190
+ Create `.idea1/settings.json` in your repository root to configure repo-specific settings.
116
191
 
117
192
  ```json
118
193
  {
119
194
  "hooks": {
120
195
  "setup-worktree": "dev/workflow/setup-worktree.sh"
196
+ },
197
+ "defaults": {
198
+ "branchPrefix": "working/agent",
199
+ "baseBranch": "working/release",
200
+ "testCommand": "npm run test"
121
201
  }
122
202
  }
123
203
  ```
@@ -125,6 +205,11 @@ Create `.idea1/settings.json` in your repository root to configure hooks:
125
205
  **Hooks:**
126
206
  - `setup-worktree` - Script to run after creating a new worktree (e.g., install dependencies)
127
207
 
208
+ **Defaults:**
209
+ - `branchPrefix` - Prefix for new branches (default: `working/agent`)
210
+ - `baseBranch` - Default base branch for branching (default: `working/release`)
211
+ - `testCommand` - Command to run tests before PR creation (e.g., `npm run test`)
212
+
128
213
  ### User Settings
129
214
 
130
215
  User settings are stored in the XDG-compliant config directory:
@@ -134,6 +219,7 @@ User settings are stored in the XDG-compliant config directory:
134
219
 
135
220
  Settings include:
136
221
  - `defaultBaseBranch` - Default base branch (default: `working/release`)
222
+ - `defaultBranchPrefix` - Default branch prefix (default: `working/agent`)
137
223
  - `defaultIsolationMode` - Default isolation mode (default: `worktree`)
138
224
 
139
225
  ## Requirements
@@ -158,3 +244,7 @@ npm link
158
244
  # Run the CLI
159
245
  idea1 --help
160
246
  ```
247
+
248
+ ## License
249
+
250
+ MIT
@@ -0,0 +1,3 @@
1
+ import type { Command } from '../types/index.js';
2
+ export declare const createWorktreeCommand: Command;
3
+ //# sourceMappingURL=create-worktree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-worktree.d.ts","sourceRoot":"","sources":["../../src/commands/create-worktree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAyB,MAAM,mBAAmB,CAAC;AAuDxE,eAAO,MAAM,qBAAqB,EAAE,OA4CnC,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { logger } from '../lib/logger.js';
2
+ import * as worktree from '../services/worktree.js';
3
+ /**
4
+ * Parse command line arguments for create-worktree
5
+ */
6
+ function parseArgs(args) {
7
+ const options = {
8
+ destBranch: 'working/release', // Will be resolved via hierarchy
9
+ branchPrefix: 'working/agent' // Will be resolved via hierarchy
10
+ };
11
+ let branchName = '';
12
+ let i = 0;
13
+ while (i < args.length) {
14
+ const arg = args[i];
15
+ switch (arg) {
16
+ case '--dest-branch':
17
+ case '-d':
18
+ i++;
19
+ options.destBranch = args[i];
20
+ break;
21
+ case '--branch-prefix':
22
+ case '-p':
23
+ i++;
24
+ options.branchPrefix = args[i];
25
+ break;
26
+ case '--source-path':
27
+ case '-s':
28
+ i++;
29
+ options.sourcePath = args[i];
30
+ break;
31
+ default:
32
+ if (arg.startsWith('-')) {
33
+ throw new Error(`Unknown option: ${arg}`);
34
+ }
35
+ if (!branchName) {
36
+ branchName = arg;
37
+ }
38
+ else {
39
+ throw new Error('Too many arguments');
40
+ }
41
+ }
42
+ i++;
43
+ }
44
+ return { branchName, options };
45
+ }
46
+ export const createWorktreeCommand = {
47
+ name: 'create-worktree',
48
+ aliases: ['w', 'worktree'],
49
+ description: 'Create a new branch and git worktree for development',
50
+ async execute(args) {
51
+ const { branchName, options } = parseArgs(args);
52
+ if (!branchName) {
53
+ throw new Error('Please provide a branch name');
54
+ }
55
+ // Navigate to source path if provided
56
+ if (options.sourcePath) {
57
+ process.chdir(options.sourcePath);
58
+ }
59
+ // Resolve branch prefix and base branch using config hierarchy
60
+ const branchPrefix = await worktree.resolveBranchPrefix(options.branchPrefix);
61
+ const baseBranch = await worktree.resolveBaseBranch(options.destBranch);
62
+ logger.info(`Creating worktree for branch: ${branchName}`);
63
+ logger.dim(` Branch prefix: ${branchPrefix}`);
64
+ logger.dim(` Base branch: ${baseBranch}`);
65
+ // Prepare the branch for worktree creation
66
+ const fullBranchName = await worktree.prepareBranchForWorktree(branchName, baseBranch, branchPrefix);
67
+ // Setup worktree isolation (without Claude and without project item URL)
68
+ await worktree.setupWorktreeIsolation(fullBranchName, branchName, baseBranch, {
69
+ launchClaude: false
70
+ });
71
+ logger.success('Worktree created successfully');
72
+ }
73
+ };
74
+ //# sourceMappingURL=create-worktree.js.map
@@ -0,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EAAE,KAAK;SACpB,CACF,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC;IAClD,CAAC;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIjD,eAAO,MAAM,WAAW,EAAE,OAgDzB,CAAC"}
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIjD,eAAO,MAAM,WAAW,EAAE,OAqEzB,CAAC"}
@@ -14,7 +14,10 @@ export const helpCommand = {
14
14
  logger.newline();
15
15
  console.log(chalk.bold('COMMANDS:'));
16
16
  console.log(' start-project-item, -s <url> Start implementing a project item');
17
+ console.log(' create-worktree, -w <name> Create a new branch and worktree');
17
18
  console.log(' close-worktree, -c Close current worktree and create PR');
19
+ console.log(' push, -p Commit, push changes, and create PR');
20
+ console.log(' update-docs, docs Update README.md for changed folders');
18
21
  console.log(' help, -h Show this help message');
19
22
  logger.newline();
20
23
  console.log(chalk.bold('START-PROJECT-ITEM OPTIONS:'));
@@ -25,20 +28,36 @@ export const helpCommand = {
25
28
  console.log(' --build-image Force rebuild of Docker image (container mode)');
26
29
  console.log(' --disable-firewall Disable network firewall (container mode)');
27
30
  logger.newline();
31
+ console.log(chalk.bold('CREATE-WORKTREE OPTIONS:'));
32
+ console.log(' --dest-branch, -d <branch> Base branch to branch from (default: working/release)');
33
+ console.log(' --branch-prefix, -p <prefix> Prefix for new branch (default: working/agent)');
34
+ console.log(' --source-path, -s <path> Path to source directory');
35
+ logger.newline();
28
36
  console.log(chalk.bold('CLOSE-WORKTREE OPTIONS:'));
29
37
  console.log(' --source-path, -p <path> Path to worktree directory');
30
38
  console.log(' --base-branch, -b <branch> Base branch for PR');
31
39
  console.log(' --prompt-pr Prompt before creating PR');
32
40
  logger.newline();
41
+ console.log(chalk.bold('PUSH OPTIONS:'));
42
+ console.log(' --project-item-url, -i <url> Project item URL for commit message');
43
+ console.log(' --no-project-item Skip project item URL');
44
+ console.log(' --no-tests Skip running tests before PR creation');
45
+ console.log(' --create-pr <true|false> Whether to create PR (default: true)');
46
+ console.log(' --dest-branch, -d <branch> PR target branch');
47
+ logger.newline();
33
48
  console.log(chalk.bold('EXAMPLES:'));
34
49
  console.log(' idea1 -s https://app.idea1.ai/project/items/590');
35
- console.log(' idea1 --start-project-item https://app.idea1.ai/project/items/590 -b main');
50
+ console.log(' idea1 start-project-item https://app.idea1.ai/project/items/590 -b main');
51
+ console.log(' idea1 -w my-feature');
52
+ console.log(' idea1 create-worktree my-feature -d main');
53
+ console.log(' idea1 -p');
54
+ console.log(' idea1 push --no-tests');
36
55
  console.log(' idea1 -c');
37
- console.log(' idea1 --close-worktree --prompt-pr');
56
+ console.log(' idea1 close-worktree --prompt-pr');
38
57
  logger.newline();
39
58
  console.log(chalk.bold('INTERACTIVE MODE:'));
40
59
  console.log(' Run "idea1" without arguments to enter interactive mode.');
41
- console.log(' Use slash commands: /start-project-item, /close-worktree, /help, /exit');
60
+ console.log(' Use slash commands: /start, /worktree, /push, /docs, /close, /help, /exit');
42
61
  logger.newline();
43
62
  }
44
63
  };
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,WAAW,GAAY;IAClC,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;IACnB,WAAW,EAAE,uBAAuB;IAEpC,KAAK,CAAC,OAAO,CAAC,KAAe;QAC3B,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,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GAAG,CAAC,4DAA4D,CAAC,CAAC;QAC1E,OAAO,CAAC,GAAG,CAAC,6EAA6E,CAAC,CAAC;QAC3F,MAAM,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACF,CAAC"}
@@ -1,6 +1,9 @@
1
1
  import type { Command } from '../types/index.js';
2
2
  import { startProjectItemCommand } from './start-project-item.js';
3
3
  import { closeWorktreeCommand } from './close-worktree.js';
4
+ import { createWorktreeCommand } from './create-worktree.js';
5
+ import { pushCommand } from './push.js';
6
+ import { updateDocsCommand } from './update-docs.js';
4
7
  import { helpCommand } from './help.js';
5
8
  /**
6
9
  * Get a command by name or alias
@@ -14,5 +17,5 @@ export declare function getAllCommands(): Command[];
14
17
  * Get all command names and aliases for autocomplete
15
18
  */
16
19
  export declare function getAllCommandNamesAndAliases(): string[];
17
- export { startProjectItemCommand, closeWorktreeCommand, helpCommand };
20
+ export { startProjectItemCommand, closeWorktreeCommand, createWorktreeCommand, pushCommand, updateDocsCommand, helpCommand };
18
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAyBxC;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAEnE;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,EAAE,CAM1C;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,EAAE,CAEvD;AAED,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AA4BxC;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAEnE;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,EAAE,CAM1C;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,EAAE,CAEvD;AAED,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,WAAW,EAAE,iBAAiB,EAAE,WAAW,EAAE,CAAC"}
@@ -1,5 +1,8 @@
1
1
  import { startProjectItemCommand } from './start-project-item.js';
2
2
  import { closeWorktreeCommand } from './close-worktree.js';
3
+ import { createWorktreeCommand } from './create-worktree.js';
4
+ import { pushCommand } from './push.js';
5
+ import { updateDocsCommand } from './update-docs.js';
3
6
  import { helpCommand } from './help.js';
4
7
  /**
5
8
  * Command registry - Map-based for O(1) lookup
@@ -19,6 +22,9 @@ function registerCommand(command) {
19
22
  // Register all commands
20
23
  registerCommand(startProjectItemCommand);
21
24
  registerCommand(closeWorktreeCommand);
25
+ registerCommand(createWorktreeCommand);
26
+ registerCommand(pushCommand);
27
+ registerCommand(updateDocsCommand);
22
28
  registerCommand(helpCommand);
23
29
  /**
24
30
  * Get a command by name or alias
@@ -42,5 +48,5 @@ export function getAllCommands() {
42
48
  export function getAllCommandNamesAndAliases() {
43
49
  return Array.from(commandRegistry.keys());
44
50
  }
45
- export { startProjectItemCommand, closeWorktreeCommand, helpCommand };
51
+ export { startProjectItemCommand, closeWorktreeCommand, createWorktreeCommand, pushCommand, updateDocsCommand, helpCommand };
46
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;GAEG;AACH,MAAM,eAAe,GAAG,IAAI,GAAG,EAAmB,CAAC;AAEnD;;GAEG;AACH,SAAS,eAAe,CAAC,OAAgB;IACvC,mBAAmB;IACnB,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAE3C,sBAAsB;IACtB,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpC,eAAe,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;AACH,CAAC;AAED,wBAAwB;AACxB,eAAe,CAAC,uBAAuB,CAAC,CAAC;AACzC,eAAe,CAAC,oBAAoB,CAAC,CAAC;AACtC,eAAe,CAAC,WAAW,CAAC,CAAC;AAE7B;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,WAAmB;IAC5C,OAAO,eAAe,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,cAAc,GAAG,IAAI,GAAG,EAAW,CAAC;IAC1C,KAAK,MAAM,OAAO,IAAI,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC;QAC/C,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC9B,CA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;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,WAAmB;IAC5C,OAAO,eAAe,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,cAAc,GAAG,IAAI,GAAG,EAAW,CAAC;IAC1C,KAAK,MAAM,OAAO,IAAI,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC;QAC/C,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B;IAC1C,OAAO,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,WAAW,EAAE,iBAAiB,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from '../types/index.js';
2
+ export declare const pushCommand: Command;
3
+ //# sourceMappingURL=push.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/commands/push.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,mBAAmB,CAAC;AA8E9D,eAAO,MAAM,WAAW,EAAE,OA4EzB,CAAC"}
@@ -0,0 +1,125 @@
1
+ import { logger } from '../lib/logger.js';
2
+ import * as git from '../services/git.js';
3
+ import * as github from '../services/github.js';
4
+ import * as test from '../services/test.js';
5
+ import { configService } from '../services/config.js';
6
+ import inquirer from 'inquirer';
7
+ /**
8
+ * Parse command line arguments for push
9
+ */
10
+ function parseArgs(args) {
11
+ const options = {
12
+ noProjectItem: false,
13
+ noTests: false,
14
+ createPr: true,
15
+ destBranch: configService.getDefaultBaseBranch()
16
+ };
17
+ let i = 0;
18
+ while (i < args.length) {
19
+ const arg = args[i];
20
+ switch (arg) {
21
+ case '--project-item-url':
22
+ case '-i':
23
+ i++;
24
+ options.projectItemUrl = args[i];
25
+ break;
26
+ case '--no-project-item':
27
+ options.noProjectItem = true;
28
+ break;
29
+ case '--no-tests':
30
+ options.noTests = true;
31
+ break;
32
+ case '--create-pr':
33
+ i++;
34
+ options.createPr = args[i] !== 'false';
35
+ break;
36
+ case '--dest-branch':
37
+ case '-d':
38
+ i++;
39
+ options.destBranch = args[i];
40
+ break;
41
+ default:
42
+ if (arg.startsWith('-')) {
43
+ throw new Error(`Unknown option: ${arg}`);
44
+ }
45
+ throw new Error(`Unexpected argument: ${arg}`);
46
+ }
47
+ i++;
48
+ }
49
+ return options;
50
+ }
51
+ /**
52
+ * Prompt for project item URL
53
+ */
54
+ async function promptProjectItemUrl() {
55
+ const { url } = await inquirer.prompt([
56
+ {
57
+ type: 'input',
58
+ name: 'url',
59
+ message: 'Please paste the project item URL (or press Enter to skip):',
60
+ }
61
+ ]);
62
+ return url.trim();
63
+ }
64
+ export const pushCommand = {
65
+ name: 'push',
66
+ aliases: ['p', 'push-changes'],
67
+ description: 'Commit and push changes, optionally creating a PR',
68
+ async execute(args) {
69
+ const options = parseArgs(args);
70
+ // Get current branch
71
+ const branchName = await git.getCurrentBranch();
72
+ logger.info(`Current branch: ${branchName}`);
73
+ // Resolve project item URL
74
+ let projectItemUrl = options.projectItemUrl;
75
+ // Try to get from git config if not provided
76
+ if (!projectItemUrl && !options.noProjectItem) {
77
+ projectItemUrl = await git.getProjectItemUrl(branchName) ?? undefined;
78
+ if (projectItemUrl) {
79
+ logger.dim(`Found stored project item URL: ${projectItemUrl}`);
80
+ }
81
+ }
82
+ // If still no URL and not explicitly skipped, prompt
83
+ if (!projectItemUrl && !options.noProjectItem) {
84
+ projectItemUrl = await promptProjectItemUrl();
85
+ if (!projectItemUrl) {
86
+ options.noProjectItem = true;
87
+ }
88
+ }
89
+ // Check for uncommitted changes
90
+ const hasChanges = await git.hasUncommittedChanges();
91
+ if (hasChanges) {
92
+ // Commit and push changes
93
+ const commitMessage = projectItemUrl
94
+ ? `Agent implementation of ${projectItemUrl} on ${branchName}`
95
+ : `Changes on ${branchName}`;
96
+ await git.commitAllChanges(commitMessage);
97
+ await git.pushToRemote(branchName);
98
+ logger.success('Changes pushed successfully');
99
+ }
100
+ else {
101
+ logger.dim('No uncommitted changes detected.');
102
+ // Still push any committed but unpushed changes
103
+ await git.pushToRemote(branchName);
104
+ }
105
+ // Run tests before creating PR if configured and not skipped
106
+ if (options.createPr && !options.noTests) {
107
+ const testsPass = await test.runTestsIfNeeded();
108
+ if (!testsPass) {
109
+ throw new Error('Tests failed. PR creation aborted.');
110
+ }
111
+ }
112
+ // Create PR if requested
113
+ if (options.createPr) {
114
+ const existingPr = await github.checkPrExists(branchName, options.destBranch);
115
+ if (!existingPr) {
116
+ await github.createPrIfNeeded(branchName, options.destBranch, projectItemUrl ?? null);
117
+ }
118
+ else {
119
+ logger.info(`PR #${existingPr.number} already exists for this branch.`);
120
+ }
121
+ }
122
+ logger.success('Done.');
123
+ }
124
+ };
125
+ //# sourceMappingURL=push.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/commands/push.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC;;GAEG;AACH,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,OAAO,GAAgB;QAC3B,aAAa,EAAE,KAAK;QACpB,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,aAAa,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AE,OAAO,EAA2B,MAAM,mBAAmB,CAAC;AA+L1E,eAAO,MAAM,uBAAuB,EAAE,OAqErC,CAAC"}
1
+ {"version":3,"file":"start-project-item.d.ts","sourceRoot":"","sources":["../../src/commands/start-project-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAA2B,MAAM,mBAAmB,CAAC;AAoI1E,eAAO,MAAM,uBAAuB,EAAE,OAoErC,CAAC"}