gearbox-code 0.1.18 → 0.1.20

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/dist/cli.mjs +18 -10
  2. package/install.sh +23 -17
  3. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -147867,7 +147867,7 @@ init_permission();
147867
147867
  var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
147868
147868
  process.env.LANG = process.env.LANG || "en_US.UTF-8";
147869
147869
  process.env.LC_ALL = process.env.LC_ALL || "en_US.UTF-8";
147870
- var VERSION16 = "0.1.18";
147870
+ var VERSION16 = "0.1.20";
147871
147871
  var args = process.argv.slice(2);
147872
147872
  var supportsAnsi = process.env.FORCE_COLOR === "1" || process.env.TERM !== "dumb" && process.env.NO_COLOR !== "1" && process.stdout.isTTY;
147873
147873
  var ansi = (code) => supportsAnsi ? `\x1B[${code}m` : "";
@@ -147906,10 +147906,17 @@ function ghostLines(cells, pad3 = " ") {
147906
147906
  return line;
147907
147907
  });
147908
147908
  }
147909
- function onboardingBoo() {
147910
- return ghostLines(renderGhost({ palette: "default", face: "happy", scale: 1 })).join(`
147909
+ function onboardingBoo(termWidth) {
147910
+ const cells = renderGhost({ palette: "default", face: "happy", scale: 1 });
147911
+ const ghostW = cells[0]?.length ?? 20;
147912
+ const leftPad = Math.max(2, Math.floor((termWidth - ghostW) / 2));
147913
+ return ghostLines(cells, " ".repeat(leftPad)).join(`
147911
147914
  `);
147912
147915
  }
147916
+ var centerStr = (text2, width) => {
147917
+ const pad3 = Math.max(0, Math.floor((width - visibleLength(text2)) / 2));
147918
+ return " ".repeat(pad3) + text2;
147919
+ };
147913
147920
  function box(title, lines) {
147914
147921
  const width = Math.min(78, Math.max(title.length + 4, ...lines.map((l) => visibleLength(l) + 4)));
147915
147922
  const rule = "─".repeat(width - 2);
@@ -147971,12 +147978,13 @@ async function runCliOnboarding() {
147971
147978
  return true;
147972
147979
  };
147973
147980
  try {
147981
+ const termWidth = Math.min(process.stdout.columns || 80, 100);
147974
147982
  console.log("");
147975
- console.log(onboardingBoo());
147983
+ console.log(onboardingBoo(termWidth));
147976
147984
  console.log("");
147977
- console.log(bold("Gearbox setup"));
147978
- console.log("Boo needs one model account before the coding app opens.");
147979
- console.log(dim("Your credentials stay local. API keys are stored in Gearbox's credential store; subscription sign-ins stay inside the vendor CLI."));
147985
+ console.log(centerStr(bold("gearbox"), termWidth));
147986
+ console.log(centerStr("set up one account Gearbox routes from there", termWidth));
147987
+ console.log(centerStr(dim("keys stay local, never sent anywhere"), termWidth));
147980
147988
  console.log("");
147981
147989
  while (!anyProviderAvailable()) {
147982
147990
  const env3 = importableEnvCreds2();
@@ -148131,8 +148139,8 @@ Options:
148131
148139
  --model <name> e.g. sonnet-4.6, haiku, gemini-flash, deepseek
148132
148140
  -c, --continue resume the most recent session here (/resume to pick one)
148133
148141
  --yolo auto-approve writes/edits/shell (no permission prompts)
148134
- --inline use terminal scrollback instead of the fullscreen app frame
148135
- --fullscreen fullscreen app frame (default when stdout is a TTY)
148142
+ --fullscreen fullscreen app frame with fixed footer (alt-screen)
148143
+ --inline terminal scrollback mode (default)
148136
148144
  -v, --version print version
148137
148145
  -h, --help this help
148138
148146
 
@@ -148284,7 +148292,7 @@ if (process.stdout.isTTY && imageMode === "kitty")
148284
148292
  var uiPrefs = loadPrefs();
148285
148293
  var explicitInline = args.includes("--inline") || process.env.GEARBOX_INLINE === "1" || process.env.GEARBOX_FULLSCREEN === "0";
148286
148294
  var explicitFullscreen = args.includes("--fullscreen") || process.env.GEARBOX_FULLSCREEN === "1";
148287
- var wantsInline = explicitInline || !explicitFullscreen && uiPrefs.fullscreen === false;
148295
+ var wantsInline = !explicitFullscreen && (explicitInline || uiPrefs.fullscreen !== true);
148288
148296
  var wantsFullscreen = !wantsInline;
148289
148297
  var fullscreen = Boolean(process.stdout.isTTY) && wantsFullscreen;
148290
148298
  var mouse = Boolean(process.stdout.isTTY) && process.env.GEARBOX_MOUSE !== "0";
package/install.sh CHANGED
@@ -11,6 +11,13 @@
11
11
  # directory is not on PATH.
12
12
  set -euo pipefail
13
13
 
14
+ # ANSI helpers (no-op when stdout is not a TTY or NO_COLOR is set)
15
+ if [[ -t 1 && "${NO_COLOR:-}" == "" ]]; then
16
+ R=$'\033[0m' B=$'\033[1m' D=$'\033[2m' C=$'\033[36m' G=$'\033[32m' Y=$'\033[33m'
17
+ else
18
+ R='' B='' D='' C='' G='' Y=''
19
+ fi
20
+
14
21
  PACKAGE_NAME="${GEARBOX_PACKAGE:-gearbox-code}"
15
22
  VERSION="${GEARBOX_VERSION:-latest}"
16
23
  INSTALL_ROOT="${GEARBOX_INSTALL_DIR:-${HOME}/.local/share/gearbox}"
@@ -73,7 +80,7 @@ trap cleanup EXIT
73
80
  meta_url="https://registry.npmjs.org/${PACKAGE_NAME}/${VERSION}"
74
81
  meta_file="${tmp}/meta.json"
75
82
 
76
- echo "-> Fetching ${PACKAGE_NAME}@${VERSION}"
83
+ printf "${D} → fetching ${PACKAGE_NAME}@${VERSION}${R}\n"
77
84
  curl -fsSL "$meta_url" -o "$meta_file"
78
85
 
79
86
  resolved_version="$(node -e 'const fs=require("fs"); const j=JSON.parse(fs.readFileSync(process.argv[1],"utf8")); console.log(j.version || "")' "$meta_file")"
@@ -88,7 +95,7 @@ target_dir="${INSTALL_ROOT}/${resolved_version}"
88
95
  archive="${tmp}/package.tgz"
89
96
  extract_dir="${tmp}/extract"
90
97
 
91
- echo "-> Downloading ${PACKAGE_NAME}@${resolved_version}"
98
+ printf "${D} → downloading ${PACKAGE_NAME}@${resolved_version}${R}\n"
92
99
  curl -fsSL "$tarball_url" -o "$archive"
93
100
  mkdir -p "$extract_dir" "$target_dir" "$BIN_DIR"
94
101
  tar -xzf "$archive" -C "$extract_dir"
@@ -111,37 +118,36 @@ exec node "${target_dir}/cli.mjs" "\$@"
111
118
  EOF
112
119
  chmod 0755 "${BIN_DIR}/gearbox"
113
120
 
114
- echo ""
115
- echo "Installed Gearbox ${resolved_version}"
116
- echo " ${BIN_DIR}/gearbox"
117
- echo ""
121
+ printf "\n"
122
+ printf "${G} ✓${R} ${B}gearbox ${resolved_version}${R} installed\n"
123
+ printf "${D} ${BIN_DIR}/gearbox${R}\n"
124
+ printf "\n"
118
125
 
119
126
  case ":${PATH}:" in
120
127
  *":${BIN_DIR}:"*)
121
- echo "Run it with: gearbox"
128
+ printf " run ${C}gearbox${R} to start\n"
122
129
  ;;
123
130
  *)
124
131
  shell_name="$(basename "${SHELL:-sh}")"
125
132
  rc_file="${HOME}/.profile"
126
133
  if [[ "$shell_name" == "zsh" ]]; then rc_file="${HOME}/.zshrc"; fi
127
134
  if [[ "$shell_name" == "bash" ]]; then rc_file="${HOME}/.bashrc"; fi
128
- echo "${BIN_DIR} is not on PATH yet."
129
- echo "Add it with:"
130
- echo " echo 'export PATH=\"${BIN_DIR}:\$PATH\"' >> ${rc_file}"
131
- echo " source ${rc_file}"
132
- echo ""
133
- echo "Then run: gearbox"
135
+ printf "${Y} ! ${BIN_DIR} is not on PATH${R}\n"
136
+ printf " echo 'export PATH=\"${BIN_DIR}:\$PATH\"' >> ${rc_file}\n"
137
+ printf " source ${rc_file}\n"
138
+ printf "\n"
139
+ printf " then run ${C}gearbox${R}\n"
134
140
  ;;
135
141
  esac
136
142
 
137
143
  if [[ "${GEARBOX_SKIP_ONBOARD:-}" != "1" ]]; then
138
- echo ""
139
- echo "Starting setup..."
144
+ printf "\n"
145
+ printf "${D} setting up …${R}\n"
140
146
  if [[ -t 1 && -e /dev/tty && -r /dev/tty && -w /dev/tty ]]; then
141
147
  if ! "${BIN_DIR}/gearbox" onboard < /dev/tty > /dev/tty; then
142
- echo "Setup did not complete. Run: ${BIN_DIR}/gearbox onboard"
148
+ printf "${Y} setup incomplete run: ${C}gearbox onboard${R}\n"
143
149
  fi
144
150
  else
145
- echo "No interactive terminal detected. Run: ${BIN_DIR}/gearbox onboard"
151
+ printf "${D} no interactive terminal run: ${C}gearbox onboard${R}\n"
146
152
  fi
147
153
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gearbox-code",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "description": "A beautiful multi-provider coding harness for the terminal. (Intelligent model routing lands on top of this soon.)",
5
5
  "type": "module",
6
6
  "license": "MIT",