@devboxer/cli 0.1.21 → 0.2.0
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 +5 -5
- package/dist/index.js +47 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# DevBoxer CLI
|
|
2
2
|
|
|
3
|
-
 [![npm]](https://www.npmjs.com/package/@
|
|
3
|
+
 [![npm]](https://www.npmjs.com/package/@devboxer/cli)
|
|
4
4
|
|
|
5
|
-
[npm]: https://img.shields.io/npm/v/@
|
|
5
|
+
[npm]: https://img.shields.io/npm/v/@devboxer/cli.svg?style=flat-square
|
|
6
6
|
|
|
7
7
|
The official CLI for DevBoxer - your AI-powered coding assistant.
|
|
8
8
|
|
|
@@ -10,13 +10,13 @@ The official CLI for DevBoxer - your AI-powered coding assistant.
|
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
# Using npm
|
|
13
|
-
npm install -g @
|
|
13
|
+
npm install -g @devboxer/cli
|
|
14
14
|
|
|
15
15
|
# Using pnpm
|
|
16
|
-
pnpm add -g @
|
|
16
|
+
pnpm add -g @devboxer/cli
|
|
17
17
|
|
|
18
18
|
# Using yarn
|
|
19
|
-
yarn global add @
|
|
19
|
+
yarn global add @devboxer/cli
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Commands
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import React9 from "react";
|
|
|
7
7
|
import { readFile } from "fs/promises";
|
|
8
8
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
9
9
|
import { dirname as dirname2, join as join4 } from "path";
|
|
10
|
+
import { createInterface } from "readline";
|
|
10
11
|
|
|
11
12
|
// src/commands/auth.tsx
|
|
12
13
|
import React, { useState, useEffect } from "react";
|
|
@@ -647,7 +648,7 @@ function PullCommand({
|
|
|
647
648
|
|
|
648
649
|
// src/commands/create.tsx
|
|
649
650
|
import React4, { useState as useState4, useEffect as useEffect3 } from "react";
|
|
650
|
-
import { Box as Box4, Text as Text4 } from "ink";
|
|
651
|
+
import { Box as Box4, Text as Text4, useApp } from "ink";
|
|
651
652
|
import Spinner3 from "ink-spinner";
|
|
652
653
|
import { useMutation as useMutation2 } from "@tanstack/react-query";
|
|
653
654
|
function CreateCommand({
|
|
@@ -658,6 +659,7 @@ function CreateCommand({
|
|
|
658
659
|
mode = "execute",
|
|
659
660
|
model
|
|
660
661
|
}) {
|
|
662
|
+
const { exit } = useApp();
|
|
661
663
|
const [error, setError] = useState4(null);
|
|
662
664
|
const gitInfo = useGitInfo();
|
|
663
665
|
const createMutation = useMutation2({
|
|
@@ -690,6 +692,16 @@ function CreateCommand({
|
|
|
690
692
|
createMutation.mutate();
|
|
691
693
|
}
|
|
692
694
|
}, [gitInfo.isLoading]);
|
|
695
|
+
useEffect3(() => {
|
|
696
|
+
if (createMutation.isSuccess) {
|
|
697
|
+
exit();
|
|
698
|
+
}
|
|
699
|
+
}, [createMutation.isSuccess, exit]);
|
|
700
|
+
useEffect3(() => {
|
|
701
|
+
if (createMutation.isError || error) {
|
|
702
|
+
exit();
|
|
703
|
+
}
|
|
704
|
+
}, [createMutation.isError, error, exit]);
|
|
693
705
|
if (gitInfo.isLoading || createMutation.isPending) {
|
|
694
706
|
return /* @__PURE__ */ React4.createElement(Box4, { flexDirection: "column" }, /* @__PURE__ */ React4.createElement(Text4, null, /* @__PURE__ */ React4.createElement(Spinner3, { type: "dots" }), " ", gitInfo.isLoading ? "Detecting repository..." : "Creating new task..."));
|
|
695
707
|
}
|
|
@@ -705,9 +717,9 @@ function CreateCommand({
|
|
|
705
717
|
|
|
706
718
|
// src/commands/list.tsx
|
|
707
719
|
import React5, { useEffect as useEffect4, useState as useState5 } from "react";
|
|
708
|
-
import { Box as Box5, Text as Text5, useApp } from "ink";
|
|
720
|
+
import { Box as Box5, Text as Text5, useApp as useApp2 } from "ink";
|
|
709
721
|
function ListCommand() {
|
|
710
|
-
const { exit } =
|
|
722
|
+
const { exit } = useApp2();
|
|
711
723
|
const repoQuery = useCurrentGitHubRepo();
|
|
712
724
|
const currentRepo = repoQuery.data;
|
|
713
725
|
const {
|
|
@@ -783,7 +795,7 @@ import updateNotifier from "update-notifier";
|
|
|
783
795
|
// package.json
|
|
784
796
|
var package_default = {
|
|
785
797
|
name: "@devboxer/cli",
|
|
786
|
-
version: "0.
|
|
798
|
+
version: "0.2.0",
|
|
787
799
|
type: "module",
|
|
788
800
|
bin: {
|
|
789
801
|
devboxer: "./dist/index.js"
|
|
@@ -885,7 +897,7 @@ function UpdateNotifier() {
|
|
|
885
897
|
if (!updateInfo) {
|
|
886
898
|
return null;
|
|
887
899
|
}
|
|
888
|
-
return /* @__PURE__ */ React7.createElement(Box6, { marginBottom: 1, borderStyle: "round", borderColor: "yellow", paddingX: 1 }, /* @__PURE__ */ React7.createElement(Text6, { color: "yellow" }, "Update available: ", updateInfo.current, " \u2192 ", updateInfo.latest), /* @__PURE__ */ React7.createElement(Text6, { color: "gray" }, " Run "), /* @__PURE__ */ React7.createElement(Text6, { color: "cyan" }, "npm install -g @
|
|
900
|
+
return /* @__PURE__ */ React7.createElement(Box6, { marginBottom: 1, borderStyle: "round", borderColor: "yellow", paddingX: 1 }, /* @__PURE__ */ React7.createElement(Text6, { color: "yellow" }, "Update available: ", updateInfo.current, " \u2192 ", updateInfo.latest), /* @__PURE__ */ React7.createElement(Text6, { color: "gray" }, " Run "), /* @__PURE__ */ React7.createElement(Text6, { color: "cyan" }, "npm install -g @devboxer/cli"), /* @__PURE__ */ React7.createElement(Text6, { color: "gray" }, " to update"));
|
|
889
901
|
}
|
|
890
902
|
|
|
891
903
|
// src/components/RootLayout.tsx
|
|
@@ -1113,6 +1125,22 @@ var __dirname2 = dirname2(__filename2);
|
|
|
1113
1125
|
var packageJson = JSON.parse(
|
|
1114
1126
|
await readFile(join4(__dirname2, "../package.json"), "utf-8")
|
|
1115
1127
|
);
|
|
1128
|
+
async function readStdin() {
|
|
1129
|
+
return new Promise((resolve2, reject) => {
|
|
1130
|
+
let data = "";
|
|
1131
|
+
const rl = createInterface({
|
|
1132
|
+
input: process.stdin,
|
|
1133
|
+
terminal: false
|
|
1134
|
+
});
|
|
1135
|
+
rl.on("line", (line) => {
|
|
1136
|
+
data += (data ? "\n" : "") + line;
|
|
1137
|
+
});
|
|
1138
|
+
rl.on("close", () => {
|
|
1139
|
+
resolve2(data.trim());
|
|
1140
|
+
});
|
|
1141
|
+
rl.on("error", reject);
|
|
1142
|
+
});
|
|
1143
|
+
}
|
|
1116
1144
|
program.name("devboxer").description("DevBoxer CLI - AI-powered coding assistant").version(packageJson.version);
|
|
1117
1145
|
program.command("auth [apiKey]").description("Authenticate with your DevBoxer API key").action((apiKey) => {
|
|
1118
1146
|
render(
|
|
@@ -1166,11 +1194,23 @@ var CLI_MODEL_OPTIONS = [
|
|
|
1166
1194
|
"gemini-3-pro",
|
|
1167
1195
|
"gemini-2.5-pro"
|
|
1168
1196
|
];
|
|
1169
|
-
program.command("create
|
|
1197
|
+
program.command("create [message]").description(
|
|
1198
|
+
"Create a new task with the given message. Message can also be piped via stdin."
|
|
1199
|
+
).option(
|
|
1170
1200
|
"-r, --repo <repo>",
|
|
1171
1201
|
"GitHub repository (default: current repository)"
|
|
1172
1202
|
).option("-b, --branch <branch>", "Base branch name (default: current branch)").option("--no-new-branch", "Don't create a new branch").option("-m, --model <model>", `AI model: ${CLI_MODEL_OPTIONS.join(", ")}`).option("-M, --mode <mode>", "Task mode: plan or execute (default: execute)").action(
|
|
1173
|
-
(
|
|
1203
|
+
async (messageArg, options) => {
|
|
1204
|
+
let message = messageArg;
|
|
1205
|
+
if (!message && !process.stdin.isTTY) {
|
|
1206
|
+
message = await readStdin();
|
|
1207
|
+
}
|
|
1208
|
+
if (!message) {
|
|
1209
|
+
console.error(
|
|
1210
|
+
"Error: Message is required. Provide as argument or pipe via stdin."
|
|
1211
|
+
);
|
|
1212
|
+
process.exit(1);
|
|
1213
|
+
}
|
|
1174
1214
|
const mode = options.mode === "plan" ? "plan" : "execute";
|
|
1175
1215
|
let model;
|
|
1176
1216
|
if (options.model) {
|