@backburner/cli 0.1.2 → 0.1.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.
- package/README.md +1 -1
- package/dist/src/cli/init.js +1 -1
- package/dist/src/onboarding/steps/select-repos.js +39 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,7 +124,7 @@ Useful `init` flags:
|
|
|
124
124
|
|
|
125
125
|
If either file already exists, onboarding asks before overwriting it. With `--yes`, defaults are accepted non-interactively, including selecting existing discovered repositories, enabling every discovered provider, creating strong and cheap agents for each one, and creating or updating labels on selected repositories. `--yes` does not create a private demo repository.
|
|
126
126
|
|
|
127
|
-
Repository setup first asks whether to
|
|
127
|
+
Repository setup first asks whether to create a private Backburner demo repository, select existing repositories, or skip repository setup for now. When GitHub authentication is available, the private demo repository is the interactive default. Before choosing existing repositories, onboarding tells you that Backburner will create or update its labels on those repositories. In an interactive terminal, repository and provider selection use a checkbox picker: arrow keys move, space toggles, and enter confirms. Non-TTY sessions fall back to text input and accept comma-separated numbers. If you are authenticated with GitHub but do not want to onboard an existing local clone yet, onboarding can explicitly create a private `backburner-demo` repository and clone it under the configured code root.
|
|
128
128
|
|
|
129
129
|
Label creation is best-effort. If GitHub rejects a label write because of permissions or repository policy, onboarding continues and prints the repository labels URL plus the exact label names to create manually. The final summary prints the next `backburner run` command, a prefilled GitHub issue URL for the first configured repository, and a terminal QR code for opening that repository's issues page from a phone.
|
|
130
130
|
|
package/dist/src/cli/init.js
CHANGED
|
@@ -58,7 +58,7 @@ export async function runInit(options) {
|
|
|
58
58
|
new CheckRequirementsStep(commandRunner),
|
|
59
59
|
new CheckGitHubAuthStep(commandRunner),
|
|
60
60
|
new DiscoverReposStep(commandRunner, ctx.codeRoot),
|
|
61
|
-
new SelectReposStep(new DemoRepoCreator(commandRunner)),
|
|
61
|
+
new SelectReposStep(new DemoRepoCreator(commandRunner), nonInteractive ? "existing" : "demo"),
|
|
62
62
|
new ConfigurePathsStep(),
|
|
63
63
|
new DiscoverProvidersStep(commandRunner),
|
|
64
64
|
new ConfigureModelsStep(),
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { defaultDemoRepoName } from "../services/demo-repo.js";
|
|
2
2
|
export class SelectReposStep {
|
|
3
3
|
demoRepoCreator;
|
|
4
|
+
defaultSetupChoice;
|
|
4
5
|
name = "select-repos";
|
|
5
6
|
description = "Select repositories to manage";
|
|
6
|
-
constructor(demoRepoCreator) {
|
|
7
|
+
constructor(demoRepoCreator, defaultSetupChoice = "demo") {
|
|
7
8
|
this.demoRepoCreator = demoRepoCreator;
|
|
9
|
+
this.defaultSetupChoice = defaultSetupChoice;
|
|
8
10
|
}
|
|
9
11
|
async run(ctx, prompter) {
|
|
10
12
|
const { discoveredRepos } = ctx;
|
|
@@ -55,36 +57,52 @@ export class SelectReposStep {
|
|
|
55
57
|
}
|
|
56
58
|
async promptSetupChoice(ctx, prompter) {
|
|
57
59
|
const hasDiscoveredRepos = ctx.discoveredRepos.length > 0;
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"Skip repository setup for now"
|
|
64
|
-
|
|
65
|
-
const
|
|
60
|
+
const existingLabel = hasDiscoveredRepos
|
|
61
|
+
? "Select existing repositories (Backburner will create/update its labels on them)"
|
|
62
|
+
: "Enter an existing repository manually";
|
|
63
|
+
const hasDemoOption = ctx.githubUser !== undefined;
|
|
64
|
+
const options = hasDemoOption
|
|
65
|
+
? ["Create a private Backburner demo repo", existingLabel, "Skip repository setup for now"]
|
|
66
|
+
: [existingLabel, "Skip repository setup for now"];
|
|
67
|
+
const defaultIndex = hasDemoOption && this.defaultSetupChoice === "existing" ? 1 : 0;
|
|
68
|
+
const choice = await prompter.choose("How do you want to set up repositories?", options, defaultIndex);
|
|
69
|
+
if (hasDemoOption) {
|
|
70
|
+
if (choice === 0) {
|
|
71
|
+
return "demo";
|
|
72
|
+
}
|
|
73
|
+
if (choice === 1) {
|
|
74
|
+
return "existing";
|
|
75
|
+
}
|
|
76
|
+
return "skip";
|
|
77
|
+
}
|
|
66
78
|
if (choice === 0) {
|
|
67
79
|
return "existing";
|
|
68
80
|
}
|
|
69
|
-
if (ctx.githubUser !== undefined && choice === 1) {
|
|
70
|
-
return "demo";
|
|
71
|
-
}
|
|
72
81
|
return "skip";
|
|
73
82
|
}
|
|
74
83
|
async promptNoSelection(ctx, prompter) {
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
const hasDemoOption = ctx.githubUser !== undefined;
|
|
85
|
+
const options = hasDemoOption
|
|
86
|
+
? [
|
|
87
|
+
"Create a private Backburner demo repo",
|
|
88
|
+
"Add an existing repository manually",
|
|
89
|
+
"Skip repository setup for now"
|
|
90
|
+
]
|
|
91
|
+
: ["Add an existing repository manually", "Skip repository setup for now"];
|
|
80
92
|
const defaultIndex = 0;
|
|
81
93
|
const choice = await prompter.choose("No repositories selected. How do you want to continue?", options, defaultIndex);
|
|
94
|
+
if (hasDemoOption) {
|
|
95
|
+
if (choice === 0) {
|
|
96
|
+
return await this.promptCreateDemoRepo(ctx, prompter);
|
|
97
|
+
}
|
|
98
|
+
if (choice === 1) {
|
|
99
|
+
return await this.promptManualEntry(ctx, prompter);
|
|
100
|
+
}
|
|
101
|
+
return this.noRepositoryWarning();
|
|
102
|
+
}
|
|
82
103
|
if (choice === 0) {
|
|
83
104
|
return await this.promptManualEntry(ctx, prompter);
|
|
84
105
|
}
|
|
85
|
-
if (ctx.githubUser !== undefined && choice === 1) {
|
|
86
|
-
return await this.promptCreateDemoRepo(ctx, prompter);
|
|
87
|
-
}
|
|
88
106
|
return this.noRepositoryWarning();
|
|
89
107
|
}
|
|
90
108
|
async promptCreateDemoRepo(ctx, prompter) {
|
|
@@ -106,7 +124,7 @@ export class SelectReposStep {
|
|
|
106
124
|
details: ["Repository names can contain letters, numbers, dots, underscores, and hyphens."]
|
|
107
125
|
};
|
|
108
126
|
}
|
|
109
|
-
const confirmed = await prompter.confirm(`Create private GitHub repository ${ctx.githubUser}/${repoName} and clone it under ${ctx.codeRoot}?`,
|
|
127
|
+
const confirmed = await prompter.confirm(`Create private GitHub repository ${ctx.githubUser}/${repoName} and clone it under ${ctx.codeRoot}?`, true);
|
|
110
128
|
if (!confirmed) {
|
|
111
129
|
return this.noRepositoryWarning();
|
|
112
130
|
}
|