automata-cli 0.1.0-007-git-publish-release.43 → 0.1.0-008-test-command.60

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 +83 -5
  2. package/dist/index.js +29 -19
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -14,12 +14,90 @@ npm install -g automata-cli
14
14
  automata --help
15
15
  ```
16
16
 
17
- ## Commands
17
+ ---
18
18
 
19
- | Command group | Description | Docs |
20
- |---|---|---|
21
- | `automata config` | Configure the tool | [docs/config.md](docs/config.md) |
22
- | `automata git` | Git workflow helpers (requires `gh` CLI) | [docs/git.md](docs/git.md) |
19
+ ## `automata config`
20
+
21
+ Launch the interactive configuration wizard to select the remote environment type.
22
+
23
+ ```bash
24
+ automata config
25
+ ```
26
+
27
+ Configuration is saved to `.automata/config.json` in the current directory.
28
+
29
+ ### `automata config set type <value>`
30
+
31
+ Set the remote type non-interactively (useful in scripts or CI).
32
+
33
+ ```bash
34
+ automata config set type gh # GitHub (requires gh CLI)
35
+ automata config set type azdo # Azure DevOps
36
+ ```
37
+
38
+ ---
39
+
40
+ ## `automata git`
41
+
42
+ Git workflow helpers. Most commands require the [`gh` CLI](https://cli.github.com/) installed and authenticated. `publish-release` only requires `git`.
43
+
44
+ ### `automata git get-pr-info`
45
+
46
+ Show the pull request for the current branch, including CI check results.
47
+
48
+ ```bash
49
+ automata git get-pr-info # human-readable output
50
+ automata git get-pr-info --json # full PR object as JSON
51
+ ```
52
+
53
+ ### `automata git get-pr-comments`
54
+
55
+ List open (unresolved) review thread comments on the current branch's PR.
56
+
57
+ ```bash
58
+ automata git get-pr-comments # human-readable output
59
+ automata git get-pr-comments --json # JSON array output
60
+ ```
61
+
62
+ ### `automata git finish-feature`
63
+
64
+ Clean up a merged feature branch: checkout `develop`, pull latest, delete the local branch.
65
+
66
+ ```bash
67
+ automata git finish-feature
68
+ ```
69
+
70
+ Checks that the PR exists and is merged, the working tree is clean, and the remote tracking branch is gone before making any changes.
71
+
72
+ ### `automata git publish-release`
73
+
74
+ Execute the full GitFlow release sequence and push to `origin`. Only requires `git`.
75
+
76
+ ```bash
77
+ automata git publish-release # auto-detect version from master tag
78
+ automata git publish-release 2.0.0 # explicit version
79
+ automata git publish-release --dry-run # preview without executing
80
+ ```
81
+
82
+ When no version is given, the latest semver tag on `master` is detected and the minor segment is incremented (e.g. `1.2.0 → 1.3.0`).
83
+
84
+ ---
85
+
86
+ ## `automata implement-next`
87
+
88
+ Find the next open GitHub issue matching the configured filter, claim it, and invoke Claude Code to implement it.
89
+
90
+ ```bash
91
+ automata implement-next # find, claim, and implement
92
+ automata implement-next --query-only # print the issue and exit
93
+ automata implement-next --yolo # skip Claude permission prompts
94
+ automata implement-next --json # JSON output
95
+ automata implement-next --no-claude # claim without launching Claude
96
+ ```
97
+
98
+ See [docs/implement-next.md](docs/implement-next.md) for full details.
99
+
100
+ ---
23
101
 
24
102
  ## Development
25
103
 
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
- import { Command as Command4 } from "commander";
4
+ import { Command as Command5 } from "commander";
5
5
 
6
6
  // src/version.ts
7
7
  import { readFileSync } from "fs";
@@ -876,9 +876,6 @@ var gitCommand = new Command2("git").description("Git workflow commands (some re
876
876
 
877
877
  // src/commands/getReady.ts
878
878
  import { Command as Command3 } from "commander";
879
- import { spawnSync as spawnSync4 } from "child_process";
880
- import { existsSync } from "fs";
881
- import { delimiter, join as join2 } from "path";
882
879
 
883
880
  // src/config/githubService.ts
884
881
  import { spawnSync as spawnSync3 } from "child_process";
@@ -903,10 +900,6 @@ function listIssues(technique, value) {
903
900
  "list",
904
901
  "--state",
905
902
  "open",
906
- "--sort",
907
- "created",
908
- "--order",
909
- "asc",
910
903
  "--limit",
911
904
  "1",
912
905
  "--json",
@@ -941,7 +934,10 @@ function postComment(issueNumber, body) {
941
934
  }
942
935
  }
943
936
 
944
- // src/commands/getReady.ts
937
+ // src/claude/claudeService.ts
938
+ import { spawnSync as spawnSync4 } from "child_process";
939
+ import { existsSync } from "fs";
940
+ import { delimiter, join as join2 } from "path";
945
941
  function resolveCommand(name) {
946
942
  const pathDirs = (process.env["PATH"] ?? "").split(delimiter);
947
943
  for (const dir of pathDirs) {
@@ -950,12 +946,10 @@ function resolveCommand(name) {
950
946
  }
951
947
  return name;
952
948
  }
953
- function invokeClaudeCode(issue, systemPrompt) {
954
- const prompt = systemPrompt ? `${systemPrompt}
955
-
956
- ${issue.body}` : issue.body;
949
+ function invokeClaudeCode(prompt, yolo) {
957
950
  const claudeBin = resolveCommand("claude");
958
- const result = spawnSync4(claudeBin, ["-p", prompt], { encoding: "utf8", stdio: "inherit" });
951
+ const args = yolo ? ["--dangerously-skip-permissions", "-p", prompt] : ["-p", prompt];
952
+ const result = spawnSync4(claudeBin, args, { encoding: "utf8", stdio: "inherit" });
959
953
  if (result.error) {
960
954
  const err = result.error;
961
955
  if (err.code === "ENOENT") {
@@ -972,11 +966,13 @@ ${issue.body}` : issue.body;
972
966
  process.exit(result.status ?? 1);
973
967
  }
974
968
  }
975
- var getReadyCommand = new Command3("get-ready").description("Find the next open GitHub issue matching the configured filter, claim it, and invoke Claude Code").option("--json", "Output issue details as JSON").option("--no-claude", "Skip Claude Code invocation after claiming the issue").action((options) => {
969
+
970
+ // src/commands/getReady.ts
971
+ var implementNextCommand = new Command3("implement-next").description("Find the next open GitHub issue matching the configured filter, claim it, and invoke Claude Code").option("--json", "Output issue details as JSON").option("--no-claude", "Skip Claude Code invocation after claiming the issue").option("--query-only", "Print issue content and exit without claiming or invoking Claude").option("--yolo", "Launch Claude Code with --dangerously-skip-permissions").action((options) => {
976
972
  const config = readConfig();
977
973
  if (config.remoteType !== "gh") {
978
974
  process.stderr.write(
979
- "Error: get-ready is not supported in Azure DevOps mode. Work item discovery is not available in azdo-cli. See docs/azdo-gap.md for details.\n"
975
+ "Error: implement-next is not supported in Azure DevOps mode. Work item discovery is not available in azdo-cli. See docs/azdo-gap.md for details.\n"
980
976
  );
981
977
  process.exit(1);
982
978
  }
@@ -1014,6 +1010,9 @@ URL: ${issue.url}
1014
1010
  ${issue.body}
1015
1011
  `);
1016
1012
  }
1013
+ if (options.queryOnly) {
1014
+ process.exit(0);
1015
+ }
1017
1016
  try {
1018
1017
  postComment(issue.number, "working");
1019
1018
  } catch (err) {
@@ -1022,16 +1021,27 @@ ${issue.body}
1022
1021
  process.exit(1);
1023
1022
  }
1024
1023
  if (options.claude !== false) {
1025
- invokeClaudeCode(issue, config.claudeSystemPrompt);
1024
+ const prompt = config.claudeSystemPrompt ? `${config.claudeSystemPrompt}
1025
+
1026
+ ${issue.body}` : issue.body;
1027
+ invokeClaudeCode(prompt, options.yolo ?? false);
1026
1028
  }
1027
1029
  });
1028
1030
 
1031
+ // src/commands/test.ts
1032
+ import { Command as Command4 } from "commander";
1033
+ var testClaudeCmd = new Command4("claude").description("Test Claude Code invocation with a user-supplied prompt").requiredOption("--prompt <string>", "Prompt to send to Claude Code").option("--yolo", "Launch Claude Code with --dangerously-skip-permissions").action((options) => {
1034
+ invokeClaudeCode(options.prompt, options.yolo ?? false);
1035
+ });
1036
+ var testCommand = new Command4("test").description("Test commands for verifying automata integrations").addCommand(testClaudeCmd);
1037
+
1029
1038
  // src/index.ts
1030
- var program = new Command4();
1039
+ var program = new Command5();
1031
1040
  program.name("automata").description("Automata CLI tool").version(version, "-v, --version");
1032
1041
  program.addCommand(configCommand);
1033
1042
  program.addCommand(gitCommand);
1034
- program.addCommand(getReadyCommand);
1043
+ program.addCommand(implementNextCommand);
1044
+ program.addCommand(testCommand);
1035
1045
  program.showHelpAfterError();
1036
1046
  program.parse();
1037
1047
  if (process.argv.length <= 2) {
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "automata-cli",
3
- "version": "0.1.0-007-git-publish-release.43",
3
+ "version": "0.1.0-008-test-command.60",
4
4
  "description": "Automata CLI tool",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "automata": "./dist/index.js"
8
8
  },
9
9
  "files": [
10
- "dist"
10
+ "dist",
11
+ "README.md"
11
12
  ],
12
13
  "scripts": {
13
14
  "build": "tsup",