qatools-cli 1.2.34 → 1.2.35
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/package.json +1 -1
- package/qatools.js +27 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qatools-cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.35",
|
|
4
4
|
"description": "CLI for QA Tools — requirements, epics, sprints, sessions, App Context sync, project agenda. The companion to qa-tools.com.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"release": "npm version patch --no-git-tag-version && npm publish",
|
package/qatools.js
CHANGED
|
@@ -962,7 +962,8 @@ program
|
|
|
962
962
|
|
|
963
963
|
program
|
|
964
964
|
.command("setup")
|
|
965
|
-
.description("Select default project (login first with 'qatools login')")
|
|
965
|
+
.description("Select default project (login first with 'qatools login'). With --project the project is chosen without a prompt, so Claude can run it")
|
|
966
|
+
.option("--project <id>", "Project ID to select without a prompt")
|
|
966
967
|
.option("-e, --email <email>", "Login email")
|
|
967
968
|
.option("-p, --password <password>", "Login password")
|
|
968
969
|
.action(async (options) => {
|
|
@@ -978,22 +979,32 @@ program
|
|
|
978
979
|
process.exit(1);
|
|
979
980
|
}
|
|
980
981
|
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
console.
|
|
993
|
-
|
|
982
|
+
let selected;
|
|
983
|
+
if (options.project) {
|
|
984
|
+
// projects.existing-repo-start: no prompt, so a Claude session can select the project itself
|
|
985
|
+
selected = projects.find(p => p.id === options.project);
|
|
986
|
+
if (!selected) {
|
|
987
|
+
console.error(`Project ${options.project} is not one of yours. Your projects:`);
|
|
988
|
+
projects.forEach(p => console.error(` ${p.name} (${p.id})`));
|
|
989
|
+
process.exit(1);
|
|
990
|
+
}
|
|
991
|
+
} else {
|
|
992
|
+
console.log("Your projects:");
|
|
993
|
+
projects.forEach((p, i) => console.log(` ${i + 1}. ${p.name} ${p.claudeEnabled ? '🤖' : ''} (${p.id})`));
|
|
994
|
+
|
|
995
|
+
// Use readline for selection
|
|
996
|
+
const readline = require("readline");
|
|
997
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
998
|
+
const answer = await new Promise(resolve => rl.question(`\nSelect project (1-${projects.length}): `, resolve));
|
|
999
|
+
rl.close();
|
|
1000
|
+
|
|
1001
|
+
const idx = parseInt(answer, 10) - 1;
|
|
1002
|
+
if (idx < 0 || idx >= projects.length) {
|
|
1003
|
+
console.error("Invalid selection.");
|
|
1004
|
+
process.exit(1);
|
|
1005
|
+
}
|
|
1006
|
+
selected = projects[idx];
|
|
994
1007
|
}
|
|
995
|
-
|
|
996
|
-
const selected = projects[idx];
|
|
997
1008
|
const configPath = path.join(process.env.HOME || process.env.USERPROFILE, ".qatools");
|
|
998
1009
|
// Preserve existing credentials
|
|
999
1010
|
let existing = {};
|