@tiens.nguyen/gu-cli 1.0.898 → 1.0.899
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/gu-repl.mjs +0 -86
- package/package.json +1 -1
package/gu-repl.mjs
CHANGED
|
@@ -1053,7 +1053,6 @@ const COMMANDS = [
|
|
|
1053
1053
|
// already has for exactly this — /quit, /rag-local.
|
|
1054
1054
|
// /host-mode is gone (owner, 11-07): modes are chosen at setup; `gu clear` sets up again.
|
|
1055
1055
|
// /undo is HIDDEN_COMMANDS now — still works when typed.
|
|
1056
|
-
{ name: "/server", desc: "pick a deployment server (host/user) for this session" },
|
|
1057
1056
|
{ name: "/proxy", usage: "/proxy [show|set|on|off|clear|test]", desc: "route MODEL calls through an HTTP proxy (local calls always go direct)" },
|
|
1058
1057
|
{ name: "/s3", usage: "/s3 [test]", desc: "set up YOUR S3 bucket (RAG index, and the PDFs/downloads gu makes) and check the AWS keys work — without it, files are saved on this computer" },
|
|
1059
1058
|
{ name: "/context-window", usage: "/context-window [tokens|auto]", desc: "tell gu how big the coding model's context is — hosted models cannot be probed" },
|
|
@@ -9827,39 +9826,6 @@ async function agentModelOnServer({ back = false, start = "menu" } = {}) {
|
|
|
9827
9826
|
console.log(dim(" takes effect on your next question.\n"));
|
|
9828
9827
|
}
|
|
9829
9828
|
|
|
9830
|
-
// Probe whether SSH KEY auth already works for a server (so we can tell the user to run
|
|
9831
|
-
// ssh-copy-id if not). BatchMode=yes = never prompt for a password → exit!=0 if no key.
|
|
9832
|
-
async function checkServerKeyAuth(s) {
|
|
9833
|
-
try {
|
|
9834
|
-
const ok = await new Promise((resolve) => {
|
|
9835
|
-
const p = spawn(
|
|
9836
|
-
"ssh",
|
|
9837
|
-
[
|
|
9838
|
-
"-o", "BatchMode=yes",
|
|
9839
|
-
"-o", "ConnectTimeout=6",
|
|
9840
|
-
"-o", "StrictHostKeyChecking=accept-new",
|
|
9841
|
-
`${s.user}@${s.host}`,
|
|
9842
|
-
"true",
|
|
9843
|
-
],
|
|
9844
|
-
{ stdio: "ignore" }
|
|
9845
|
-
);
|
|
9846
|
-
p.on("exit", (code) => resolve(code === 0));
|
|
9847
|
-
p.on("error", () => resolve(false));
|
|
9848
|
-
});
|
|
9849
|
-
if (ok) console.log(dim(" ✓ key auth works — deploys will connect without a password."));
|
|
9850
|
-
else
|
|
9851
|
-
console.log(
|
|
9852
|
-
yellow(" key auth not set up yet.") +
|
|
9853
|
-
dim(` Run once in your terminal: `) +
|
|
9854
|
-
`ssh-copy-id ${s.user}@${s.host}`
|
|
9855
|
-
);
|
|
9856
|
-
} catch {
|
|
9857
|
-
/* best-effort check — never block the picker */
|
|
9858
|
-
}
|
|
9859
|
-
}
|
|
9860
|
-
|
|
9861
|
-
// /server — pick a deployment target (from the web app's Servers registry) for this
|
|
9862
|
-
// session. Host/user only, never a secret; the agent deploys here with KEY auth (#69).
|
|
9863
9829
|
/**
|
|
9864
9830
|
* `/proxy` — configure the outbound proxy for MODEL calls (task #160).
|
|
9865
9831
|
*
|
|
@@ -10248,53 +10214,6 @@ async function runProxyCommand(line) {
|
|
|
10248
10214
|
}
|
|
10249
10215
|
}
|
|
10250
10216
|
|
|
10251
|
-
async function chooseServer() {
|
|
10252
|
-
let servers;
|
|
10253
|
-
try {
|
|
10254
|
-
const res = await withPendingStatus("loading servers", () =>
|
|
10255
|
-
fetch(`${apiBase}/api/worker/deploy-servers`, {
|
|
10256
|
-
headers: { "X-Worker-Key": workerKey },
|
|
10257
|
-
signal: AbortSignal.timeout(API_CALL_TIMEOUT_MS),
|
|
10258
|
-
})
|
|
10259
|
-
);
|
|
10260
|
-
const data = await res.json().catch(() => ({}));
|
|
10261
|
-
if (!res.ok) {
|
|
10262
|
-
console.log(red(` couldn't load servers: ${data?.error || `HTTP ${res.status}`}\n`));
|
|
10263
|
-
return;
|
|
10264
|
-
}
|
|
10265
|
-
servers = Array.isArray(data?.servers) ? data.servers : [];
|
|
10266
|
-
} catch (err) {
|
|
10267
|
-
console.log(red(` ${describeApiFailure(err, "couldn't load servers")}\n`));
|
|
10268
|
-
return;
|
|
10269
|
-
}
|
|
10270
|
-
if (servers.length === 0) {
|
|
10271
|
-
console.log(dim(" No deployment servers yet — add them in the web app → Servers.\n"));
|
|
10272
|
-
return;
|
|
10273
|
-
}
|
|
10274
|
-
// Arrow-key picker: ↑/↓ to move, Enter to choose (no number typing). The list ends with
|
|
10275
|
-
// a "none" row to clear the selection. Pre-highlight the current pick if there is one.
|
|
10276
|
-
const labels = servers.map((s) => `${s.name} (${s.user}@${s.host})`);
|
|
10277
|
-
labels.push("none (clear selection)");
|
|
10278
|
-
const activeIdx = servers.findIndex((s) => s.host === selectedServer?.host);
|
|
10279
|
-
console.log(dim(` Choose a deployment server (${PICK_HINT}):`));
|
|
10280
|
-
const idx = await pickFromList(labels, activeIdx >= 0 ? activeIdx : 0);
|
|
10281
|
-
if (idx < 0) {
|
|
10282
|
-
console.log(dim(" (cancelled)\n"));
|
|
10283
|
-
return;
|
|
10284
|
-
}
|
|
10285
|
-
if (idx === servers.length) {
|
|
10286
|
-
// the trailing "none" row
|
|
10287
|
-
selectedServer = null;
|
|
10288
|
-
console.log(dim(" ✓ deployment server cleared.\n"));
|
|
10289
|
-
return;
|
|
10290
|
-
}
|
|
10291
|
-
const s = servers[idx];
|
|
10292
|
-
selectedServer = { name: s.name, host: s.host, user: s.user };
|
|
10293
|
-
console.log(accent(` ✓ deploy target → ${s.name} (${s.user}@${s.host})`));
|
|
10294
|
-
await checkServerKeyAuth(selectedServer);
|
|
10295
|
-
console.log("");
|
|
10296
|
-
}
|
|
10297
|
-
|
|
10298
10217
|
/**
|
|
10299
10218
|
* Ask for the coding model's API key if the resolved coder needs one and none is stored.
|
|
10300
10219
|
*
|
|
@@ -15479,11 +15398,6 @@ async function main() {
|
|
|
15479
15398
|
await syncEmbedWarning({ repair: false });
|
|
15480
15399
|
continue;
|
|
15481
15400
|
}
|
|
15482
|
-
if (line === "/server") {
|
|
15483
|
-
await chooseServer();
|
|
15484
|
-
await saveSession(cwd, history); // remember the pick for this folder
|
|
15485
|
-
continue;
|
|
15486
|
-
}
|
|
15487
15401
|
if (line === "/full-log" || line.startsWith("/full-log ")) {
|
|
15488
15402
|
await runFullLogCommand(line);
|
|
15489
15403
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiens.nguyen/gu-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.899",
|
|
4
4
|
"description": "gu: the coding agent in your terminal. It reads your repo, makes the change and runs the tests, with your own models (Ollama or any OpenAI-compatible provider). Free installs keep the agent, its API and its database on your machine. macOS, Linux and Windows.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|