@profoundlogic/coderflow-cli 0.12.141 → 0.12.143

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.
@@ -19,7 +19,7 @@ export async function attachToContainer(args = []) {
19
19
  } else if (arg === '--agent') {
20
20
  const next = args[index + 1];
21
21
  if (!next) {
22
- console.error('Error: --agent requires a value (claude, codex, gemini, bob, grok)');
22
+ console.error('Error: --agent requires a value (claude, codex, gemini, bob, grok, kimi)');
23
23
  process.exit(1);
24
24
  }
25
25
  agentOverride = next;
@@ -96,9 +96,12 @@ export async function attachToContainer(args = []) {
96
96
  // Grok continues the most recent session in the current cwd with -c.
97
97
  cmd = 'cd /workspace && grok -c';
98
98
  descriptiveAction = 'Resuming with Grok';
99
+ } else if (agentOverride === 'kimi') {
100
+ cmd = 'cd /workspace && kimi --continue';
101
+ descriptiveAction = 'Resuming with Kimi';
99
102
  } else {
100
103
  console.error(`Error: Unknown agent: ${agentOverride}`);
101
- console.error('Valid agents: claude, codex, grok');
104
+ console.error('Valid agents: claude, codex, grok, kimi');
102
105
  process.exit(1);
103
106
  }
104
107
  } else {
@@ -113,6 +116,9 @@ export async function attachToContainer(args = []) {
113
116
  } else if (agent === 'grok') {
114
117
  cmd = 'cd /workspace && grok -c';
115
118
  descriptiveAction = 'Resuming with Grok';
119
+ } else if (agent === 'kimi') {
120
+ cmd = 'cd /workspace && kimi --continue';
121
+ descriptiveAction = 'Resuming with Kimi';
116
122
  } else {
117
123
  // Fallback for unknown agents
118
124
  cmd = `cd /workspace && ${agent}`;
@@ -78,7 +78,7 @@ export async function startInteractive(args = []) {
78
78
  } else if (arg === '--agent') {
79
79
  const next = args[index + 1];
80
80
  if (!next) {
81
- console.error('Error: --agent requires a value (claude, codex, gemini, or bob)');
81
+ console.error('Error: --agent requires a value (claude, codex, gemini, bob, grok, or kimi)');
82
82
  process.exit(1);
83
83
  }
84
84
  envVars.CODER_AGENT = next;
@@ -27,6 +27,19 @@ function parseTestArgs(args) {
27
27
  let customCommand = null;
28
28
  let noLocalState = false;
29
29
  let listTests = false;
30
+ const branches = {};
31
+
32
+ const addBranch = value => {
33
+ const rawValue = String(value || '');
34
+ const separatorIndex = rawValue.indexOf('=');
35
+ const repoName = separatorIndex > 0 ? rawValue.slice(0, separatorIndex).trim() : '';
36
+ const branch = separatorIndex > 0 ? rawValue.slice(separatorIndex + 1).trim() : '';
37
+ if (!repoName || !branch) {
38
+ console.error('Error: --branch requires a value in the form repository=branch');
39
+ process.exit(1);
40
+ }
41
+ branches[repoName] = branch;
42
+ };
30
43
 
31
44
  for (let index = 0; index < args.length; index += 1) {
32
45
  const arg = args[index];
@@ -41,6 +54,22 @@ function parseTestArgs(args) {
41
54
  continue;
42
55
  }
43
56
 
57
+ if (arg === '--branch') {
58
+ const next = args[index + 1];
59
+ if (!next) {
60
+ console.error('Error: --branch requires a value in the form repository=branch');
61
+ process.exit(1);
62
+ }
63
+ addBranch(next);
64
+ index += 1;
65
+ continue;
66
+ }
67
+
68
+ if (arg.startsWith('--branch=')) {
69
+ addBranch(arg.substring('--branch='.length));
70
+ continue;
71
+ }
72
+
44
73
  if (arg === '--environment' || arg === '--env') {
45
74
  const next = args[index + 1];
46
75
  if (!next) {
@@ -93,7 +122,7 @@ function parseTestArgs(args) {
93
122
  process.exit(1);
94
123
  }
95
124
 
96
- return { testName, environment, customCommand, noLocalState, listTests };
125
+ return { testName, environment, customCommand, noLocalState, listTests, branches };
97
126
  }
98
127
 
99
128
  /**
@@ -139,7 +168,7 @@ async function listAvailableTests(environmentName) {
139
168
  * Run a test in an ephemeral container
140
169
  */
141
170
  export async function runTest(args = []) {
142
- const { testName, environment, customCommand, noLocalState, listTests } = parseTestArgs(args);
171
+ const { testName, environment, customCommand, noLocalState, listTests, branches } = parseTestArgs(args);
143
172
 
144
173
  // Resolve environment
145
174
  let resolvedEnvironment = environment;
@@ -211,7 +240,8 @@ export async function runTest(args = []) {
211
240
  // Prepare request body
212
241
  const requestBody = {
213
242
  environment: resolvedEnvironment,
214
- test_command: command
243
+ test_command: command,
244
+ branches: { ...branches }
215
245
  };
216
246
 
217
247
  // Apply local state by default (unless --no-local-state)
@@ -253,6 +283,11 @@ export async function runTest(args = []) {
253
283
 
254
284
  // Send the captured state JSON to the server
255
285
  requestBody.local_state = localState;
286
+ for (const [repoName, repoState] of Object.entries(localState.repositories || {})) {
287
+ if (!requestBody.branches[repoName] && typeof repoState?.current_branch === 'string') {
288
+ requestBody.branches[repoName] = repoState.current_branch;
289
+ }
290
+ }
256
291
  }
257
292
  } catch (error) {
258
293
  console.error(`Error capturing local state: ${error.message}`);
package/lib/help.js CHANGED
@@ -46,7 +46,7 @@ Arguments:
46
46
  container-id Container ID to attach to (optional - uses last container if omitted)
47
47
 
48
48
  Options:
49
- --agent=<agent> Agent to use (claude, codex, gemini, bob, grok)
49
+ --agent=<agent> Agent to use (claude, codex, gemini, bob, grok, kimi)
50
50
  --shell Start bash shell instead of agent
51
51
 
52
52
  Examples:
@@ -219,7 +219,7 @@ Arguments:
219
219
  environment Environment to start session in (required)
220
220
 
221
221
  Options:
222
- --agent=<agent> Agent to use (claude, codex, gemini, bob, grok)
222
+ --agent=<agent> Agent to use (claude, codex, gemini, bob, grok, kimi)
223
223
  --no-attach Start container but don't auto-connect
224
224
  --branch <repo>=<branch> Override branch for specific repository
225
225
  --env=<KEY>=<value> Pass custom environment variables
@@ -261,6 +261,7 @@ Arguments:
261
261
  Options:
262
262
  --env=<environment> Environment to run test in (uses default if omitted)
263
263
  --cmd="<command>" Run custom command instead of named test
264
+ --branch=<repo>=<name> Select a branch (repeat for multiple repositories)
264
265
  --list List available tests for the environment
265
266
  --no-local-state Don't capture local repo state
266
267
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profoundlogic/coderflow-cli",
3
- "version": "0.12.141",
3
+ "version": "0.12.143",
4
4
  "description": "AI Coder CLI - Command-line interface for managing AI coding tasks",
5
5
  "main": "coder.js",
6
6
  "type": "module",