ai-battery 0.2.2 → 0.2.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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Codex · Claude · Gemini의 상태와 남은 사용량을 터미널과 데스크톱에서 한눈에.**
4
4
 
5
- 모델·추론 수준·작업 디렉터리·브랜치·context 잔량을 같은 순서로 표시하고, 배터리 행에서 5h 잔량과 리셋 시각, 7d 잔량을 함께 확인합니다. `agy` CLI는 화면에서 **Gemini**로 표시합니다.
5
+ 모델·추론 수준·작업 디렉터리·브랜치·context 잔량을 같은 순서로 표시하고, 배터리 행에서 5h 잔량과 리셋 시각, 7d 잔량을 함께 확인합니다.
6
6
 
7
7
  ![npm](https://img.shields.io/npm/v/ai-battery)
8
8
  ![Node](https://img.shields.io/badge/node-%3E%3D18-339933)
@@ -11,7 +11,7 @@
11
11
 
12
12
  [설치·시작](#설치시작) · [터미널 표시](#터미널-표시) · [운영체제별 UI](#운영체제별-ui) · [HUD](#hud) · [표시 설정](#표시-설정) · [설정 복원](#설정-복원)
13
13
 
14
- [한국어](README.md) · [English](docs/i18n/en/) · [日本語](docs/i18n/ja/) · [中文](docs/i18n/zh/) · [Español](docs/i18n/es/)
14
+ [한국어](README.md) · [English](docs/i18n/en/) · [日本語](docs/i18n/ja/) · [Español](docs/i18n/es/)
15
15
 
16
16
  ## 설치·시작
17
17
 
@@ -72,7 +72,7 @@ Gemini(agy)는 기본 인라인 모드와 `/config`의 전체 화면 모드 모
72
72
  Windows Terminal에서는 Windows·WSL에서 `ai-battery setup` 후 **분할 화면에서 AI(`codex`·`claude`·`agy`)가 하나라도 실행 중이면 창 전체 가장자리에 통합 바가 자동으로 표시**됩니다. 반대쪽 분할 pane이 일반 셸이거나 Windows와 WSL을 함께 사용해도 창 전체 기준으로 깔끔하게 통합되며, 실행 중인 AI를 모두 종료하거나 분할을 닫아 단일 화면으로 돌아가면 통합 바가 자동으로 닫히고 입력 포커스와 개별 표시를 복원합니다.
73
73
 
74
74
  ```bash
75
- ai-battery config --position right # 상태바 위치: bottom / top / left / right
75
+ ai-battery config --position right # 상태바 위치: off / bottom / top / left / right
76
76
  ai-battery split # 분할 화면 통합 바 상태 확인
77
77
  ai-battery split top # 통합 바 위치만 별도 지정
78
78
  ai-battery split manual # 자동 표시 끄기 (수동 전환)
@@ -132,10 +132,10 @@ ai-battery setup claude gemini
132
132
  tmux
133
133
  ```
134
134
 
135
- 터미널 배터리 행을 접고 HUD만 함께 사용할 수도 있습니다.
135
+ 터미널 배터리 상태바를 끄고 HUD만 함께 사용할 수도 있습니다. `ai-battery config`의 상태바 위치에서 `표시 안 함 (off)`을 선택하거나 아래 명령을 실행하세요.
136
136
 
137
137
  ```bash
138
- ai-battery setup claude gemini --no-usage-row
138
+ ai-battery config --position off
139
139
  ai-battery hud
140
140
  ```
141
141
 
@@ -164,7 +164,7 @@ ai-battery setup
164
164
  ai-battery reset
165
165
  ```
166
166
 
167
- AI Battery가 추가한 연동을 복원하고 전용 캐시를 정리합니다. 일부만 해제하려면 `reset claude`, `reset gemini`, `reset codex`, `reset hud`, `reset tmux`, `reset wt`처럼 대상을 지정합니다. 사용자가 수정한 설정과 관련 없는 파일은 보존합니다.
167
+ AI Battery가 추가한 연동을 복원하고 전용 캐시를 정리합니다. 일부만 해제하려면 `reset claude`, `reset gemini`, `reset codex`, `reset hud`, `reset tmux`, `reset split`처럼 대상을 지정합니다. 사용자가 수정한 설정과 관련 없는 파일은 보존합니다.
168
168
 
169
169
  패키지까지 삭제하려면 복원이 완료된 뒤 실행하세요.
170
170
 
@@ -250,6 +250,8 @@ def slice_ansi(text, start_col, width):
250
250
 
251
251
  def normalize_bar_position(pos):
252
252
  val = str(pos or "").strip().lower()
253
+ if val in ("off", "none", "hidden", "hide"):
254
+ return "off"
253
255
  if val in ("top", "up", "t"):
254
256
  return "top"
255
257
  if val in ("left", "l"):
@@ -925,6 +927,10 @@ def main():
925
927
  if tmux_status_bar_active():
926
928
  os.execvp(command[0], command)
927
929
 
930
+ bar_position = read_bar_position()
931
+ if bar_position == "off":
932
+ os.execvp(command[0], command)
933
+
928
934
  if not os.isatty(sys.stdin.fileno()) or not os.isatty(sys.stdout.fileno()):
929
935
  print(
930
936
  "ai-battery-run: stdin/stdout is not a real terminal.\n"
@@ -934,7 +940,6 @@ def main():
934
940
  raise SystemExit(2)
935
941
 
936
942
  active_provider = command_provider if command_provider in ("codex", "claude", "antigravity") else None
937
- bar_position = read_bar_position()
938
943
  sidebar_width = read_sidebar_width()
939
944
  shared_bar = SharedBarBridge(active_provider, os.getpid())
940
945
  cols, rows = term_size()
package/docs/RELEASING.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # npm release
2
2
 
3
- The prepared version is **0.2.2**, following the published 0.2.1. Preparing or pushing this patch does not publish it to npm.
3
+ The prepared version is **0.2.3**, following the published 0.2.2. Preparing or pushing this patch does not publish it to npm.
4
+
5
+ ## Fixes in 0.2.3
6
+
7
+ - Add **Off (`off`)** as the first option in `ai-battery config`'s bar position tab (`표시 안 함 (off)` / `Off`, plus `--position off` on `config` and `setup`) to hide terminal battery status bars across Windows, WSL, Linux, and macOS while keeping the shared first header row (`model · dir · branch · changes · context`) and live HUD quota caching intact.
8
+ - Bypass PTY/compositor wrapping for Codex (`ai-battery-run`, `codex-runner.js`), hide Claude/Gemini battery rows while preserving cache capture and headers, suppress/auto-close Windows Terminal shared split bars, and fold tmux battery rows automatically when `barPosition` is set to `off`, without changing `bottom`/`auto` setup defaults or `ai-battery split off` behavior.
4
9
 
5
10
  ## Fixes in 0.2.2
6
11
 
@@ -64,16 +69,16 @@ The active runner keeps its Python code until the next launch. Updating the CLI
64
69
  ```text
65
70
  npm run check
66
71
  npm run smoke:linux
67
- mkdir -p .cache/releases/0.2.2
72
+ mkdir -p .cache/releases/0.2.3
68
73
  npm pack --dry-run --json
69
- npm pack --pack-destination .cache/releases/0.2.2 --json
74
+ npm pack --pack-destination .cache/releases/0.2.3 --json
70
75
  ```
71
76
 
72
77
  The regression suite includes real PTYs: an already-running wrapped Codex remains interactive during setup, the same Bash command cache launches it again, a fresh shell displays the usage row, and an attached tmux client displays the bar after live setup. An open wrapper reader retains its old bytes, compatibility command paths and recovery backups survive, and user Codex/shell/tmux settings are compared exactly.
73
78
 
74
79
  POSIX screen regressions replay actual output into a terminal emulator and inspect the rendered rows, cursor and scrollback. They cover repeated Korean error rows, narrow widths, wide/combining characters, control sequences, shorter replacement text, resize and keyboard input through a live PTY.
75
80
 
76
- Install the published 0.2.1 into an isolated npm prefix, open the PTY fixture, upgrade that prefix to the exact 0.2.2 tarball, and run default setup while the original terminal remains open. Codex's managed first-row fields should update while unrelated settings, the original recovery snapshot, shell integration and running sessions remain intact. The same fixture can cover legacy 0.1.24 and 0.1.27 upgrades. Save the lifecycle report, package manifest, SHA256 checksum, installed-package smoke report and publish dry-run under `.cache/releases/0.2.2/`.
81
+ Install the published 0.2.2 into an isolated npm prefix, open the PTY fixture, upgrade that prefix to the exact 0.2.3 tarball, and run default setup while the original terminal remains open. Codex's managed first-row fields should update while unrelated settings, the original recovery snapshot, shell integration and running sessions remain intact. The same fixture can cover legacy 0.1.24 and 0.1.27 upgrades. Save the lifecycle report, package manifest, SHA256 checksum, installed-package smoke report and publish dry-run under `.cache/releases/0.2.3/`.
77
82
 
78
83
  The Linux GUI smoke test opens the actual popup in an isolated GNOME 50.1 Wayland session, verifies zero border width for the content and box pointer, and saves a screenshot. It also checks shared macOS SVG size, provider visibility, extension fallback/reconnect and shutdown. Native Windows/macOS runtime tests require their respective environments; platform-neutral regressions still run here.
79
84
 
@@ -85,16 +90,16 @@ Inspect the tarball for runtime modules, stable bin entrypoints and required pla
85
90
 
86
91
  ```text
87
92
  npm whoami
88
- npm publish .cache/releases/0.2.2/ai-battery-0.2.2.tgz --access public --tag latest
93
+ npm publish .cache/releases/0.2.3/ai-battery-0.2.3.tgz --access public --tag latest
89
94
  npm view ai-battery version dist-tags --json
90
95
  ```
91
96
 
92
- Authenticate with `npm login` if required, and complete npm 2FA when requested. If 0.2.2 is already published, increment the version and repeat verification. Tag the tested commit `v0.2.2` after publication.
97
+ Authenticate with `npm login` if required, and complete npm 2FA when requested. If 0.2.3 is already published, increment the version and repeat verification. Tag the tested commit `v0.2.3` after publication.
93
98
 
94
99
  ## Update and enable terminal display
95
100
 
96
101
  ```text
97
- npm install -g ai-battery@0.2.2
102
+ npm install -g ai-battery@0.2.3
98
103
  ai-battery setup
99
104
  ai-battery setup tmux
100
105
  tmux
package/lib/cli.js CHANGED
@@ -21,7 +21,7 @@ import { cliError, cliText, helpText, invalidChoice, requiredValue } from "./cor
21
21
  import { errorText, messageText as cliMessageText } from "./core/cli-messages.js";
22
22
  import { formatClaudeResult, formatDoctorResult, formatResetResult, formatSetupResult, formatSplitBarModeResult, formatSplitBarStatus, formatVisibilityResult } from "./core/cli-output.js";
23
23
  import { codexTerminalDisplay, claudeTerminalDisplay } from "./core/diagnostics.js";
24
- import { BAR_POSITIONS, DEFAULT_SIDEBAR_WIDTH, PROVIDERS, SPLIT_BAR_MODES, STATUS_LINE_ITEMS, defaultDisplayConfig, isDisplayConfig, normalizeBarPosition, normalizeOrder, normalizeSidebarWidth, normalizeSplitBarMode, parseOrder, orderResults, providerId, providerLabel } from "./core/display-config.js";
24
+ import { BAR_POSITIONS, DEFAULT_SIDEBAR_WIDTH, PROVIDERS, SPLIT_BAR_MODES, SPLIT_BAR_POSITIONS, STATUS_LINE_ITEMS, defaultDisplayConfig, isDisplayConfig, normalizeBarPosition, normalizeOrder, normalizeSidebarWidth, normalizeSplitBarMode, normalizeSplitBarPosition, parseOrder, orderResults, providerId, providerLabel } from "./core/display-config.js";
25
25
  import { canEditConfig, editDisplayConfig } from "./core/config-editor.js";
26
26
  import { installCliPositionWrappers, posixCliWrapperDir, uninstallCliPositionWrappers } from "./core/cli-wrappers.js";
27
27
  import { branchChanges, readGitBranchFast } from "./core/statusline-git.js";
@@ -177,8 +177,8 @@ function parseArgs(argv) {
177
177
  resetAliasSeen = true;
178
178
  } else if (!arg.startsWith("-") && args.command === "split") {
179
179
  if (args.subcommand === "position" && !args.barPosition) {
180
- const nextPos = normalizeBarPosition(arg, null);
181
- if (!nextPos) throw invalidChoice("position", BAR_POSITIONS.join(", "), "split");
180
+ const nextPos = normalizeSplitBarPosition(arg, null);
181
+ if (!nextPos) throw invalidChoice("position", SPLIT_BAR_POSITIONS.join(", "), "split");
182
182
  args.barPosition = nextPos;
183
183
  } else if (args.subcommand) {
184
184
  throw cliError(`Unexpected argument: ${arg}.`, `불필요한 인자: ${arg}.`, "split");
@@ -222,8 +222,9 @@ function parseArgs(argv) {
222
222
  i += 1;
223
223
  } else if (arg === "--position") {
224
224
  const value = requiredValue(argv, i, args.command);
225
- const nextPos = normalizeBarPosition(value, null);
226
- if (!nextPos) throw invalidChoice("--position", BAR_POSITIONS.join(", "), args.command);
225
+ const isSplit = args.command === "split";
226
+ const nextPos = isSplit ? normalizeSplitBarPosition(value, null) : normalizeBarPosition(value, null);
227
+ if (!nextPos) throw invalidChoice("--position", (isSplit ? SPLIT_BAR_POSITIONS : BAR_POSITIONS).join(", "), args.command);
227
228
  args.barPosition = nextPos;
228
229
  i += 1;
229
230
  } else if (arg === "--interval") {
@@ -347,7 +348,7 @@ function parseArgs(argv) {
347
348
  throw invalidChoice("subcommand", SPLIT_SUBCOMMANDS.join(", "), "split");
348
349
  }
349
350
  if (args.subcommand === "position" && !args.barPosition) {
350
- throw invalidChoice("position", BAR_POSITIONS.join(", "), "split");
351
+ throw invalidChoice("position", SPLIT_BAR_POSITIONS.join(", "), "split");
351
352
  }
352
353
  }
353
354
  if (args.targets.length) {
@@ -564,7 +565,7 @@ function normalizeDisplayConfig(stored) {
564
565
  providerOrder: normalizeOrder(stored?.providerOrder, defaults.providerOrder),
565
566
  splitBar: normalizeSplitBarMode(stored?.splitBar, defaults.splitBar),
566
567
  barPosition: normalizeBarPosition(stored?.barPosition, defaults.barPosition),
567
- splitBarPosition: stored?.splitBarPosition ? normalizeBarPosition(stored.splitBarPosition, null) : null,
568
+ splitBarPosition: stored?.splitBarPosition ? normalizeSplitBarPosition(stored.splitBarPosition, null) : null,
568
569
  sidebarWidth: normalizeSidebarWidth(stored?.sidebarWidth, defaults.sidebarWidth)
569
570
  };
570
571
  }
@@ -629,7 +630,7 @@ function updateDisplayConfig({ providerOrder, providers, splitBar, barPosition,
629
630
  ? normalizeBarPosition(barPosition, latest.barPosition)
630
631
  : latest.barPosition,
631
632
  splitBarPosition: splitBarPosition !== undefined
632
- ? (splitBarPosition === null ? null : normalizeBarPosition(splitBarPosition, latest.splitBarPosition || latest.barPosition))
633
+ ? (splitBarPosition === null ? null : normalizeSplitBarPosition(splitBarPosition, latest.splitBarPosition || normalizeSplitBarPosition(latest.barPosition, "bottom")))
633
634
  : latest.splitBarPosition,
634
635
  sidebarWidth: sidebarWidth !== undefined
635
636
  ? normalizeSidebarWidth(sidebarWidth, latest.sidebarWidth)
@@ -1263,6 +1264,7 @@ function claudeUsageRowVisible(args) {
1263
1264
  const envValue = booleanEnvValue(process.env.AI_BATTERY_CLAUDE_USAGE_ROW ?? process.env.CLAUDEX_BATTERY_CLAUDE_USAGE_ROW);
1264
1265
  if (envValue !== null) return envValue;
1265
1266
  if (process.platform === "win32" && args.attachHud) return false;
1267
+ if (readConfiguredBarPosition(process.env) === "off") return false;
1266
1268
  return !tmuxStatusBarActive();
1267
1269
  }
1268
1270
 
@@ -2609,7 +2611,7 @@ function runSetup(args) {
2609
2611
  ...(args.providerOrder ? { providerOrder: args.providerOrder } : {}),
2610
2612
  ...(args.barPosition ? { barPosition: args.barPosition } : {})
2611
2613
  });
2612
- if (args.barPosition && !updatedDisplay.splitBarPosition && (process.platform === "win32" || isWsl())) {
2614
+ if (args.barPosition && updatedDisplay.barPosition !== "off" && !updatedDisplay.splitBarPosition && (process.platform === "win32" || isWsl())) {
2613
2615
  updateWtFragmentPosition({ position: updatedDisplay.barPosition, sidebarWidth: updatedDisplay.sidebarWidth });
2614
2616
  }
2615
2617
  }
@@ -5830,22 +5832,23 @@ async function main() {
5830
5832
  });
5831
5833
  if ((saveBarPosition || edited.sidebarWidthChanged) && (process.platform === "win32" || isWsl())) {
5832
5834
  const effectiveWtPos = latest.splitBarPosition || latest.barPosition;
5833
- if (!latest.splitBarPosition || edited.sidebarWidthChanged) {
5835
+ if (effectiveWtPos !== "off" && (!latest.splitBarPosition || edited.sidebarWidthChanged)) {
5834
5836
  updateWtFragmentPosition({ position: effectiveWtPos, sidebarWidth: latest.sidebarWidth });
5835
5837
  }
5836
5838
  }
5837
- if (latest.barPosition !== "bottom") {
5839
+ if (["top", "left", "right"].includes(latest.barPosition)) {
5838
5840
  ensureCliPositionWrappers(["claude", "antigravity"], { updateShellPath: true });
5839
5841
  }
5840
5842
  const visible = latest.providerOrder.filter(provider => latest.providers[provider] !== false).map(providerLabel);
5841
5843
  console.log(`${cliText("Display settings saved", "표시 설정 저장")}: ${visible.join(" → ") || cliText("All hidden", "모두 숨김")}`);
5842
5844
  const posLabel = ({
5845
+ off: cliText("off", "표시 안 함 (off)"),
5843
5846
  bottom: cliText("bottom", "하단 (bottom)"),
5844
5847
  top: cliText("top", "상단 (top)"),
5845
5848
  left: cliText("left", "좌측 (left)"),
5846
5849
  right: cliText("right", "우측 (right)")
5847
5850
  })[latest.barPosition] || latest.barPosition;
5848
- console.log(`${cliText("Bar position", "상태바 위치")}: ${posLabel}${latest.splitBarPosition && latest.splitBarPosition !== latest.barPosition ? ` (${cliText("split", "통합 바")}: ${latest.splitBarPosition})` : ""}`);
5851
+ console.log(`${cliText("Bar position", "상태바 위치")}: ${posLabel}${latest.barPosition !== "off" && latest.splitBarPosition && latest.splitBarPosition !== latest.barPosition ? ` (${cliText("split", "통합 바")}: ${latest.splitBarPosition})` : ""}`);
5849
5852
  return;
5850
5853
  }
5851
5854
  const current = (args.providerOrder || args.barPosition)
@@ -5854,10 +5857,10 @@ async function main() {
5854
5857
  ...(args.barPosition ? { barPosition: args.barPosition } : {})
5855
5858
  })
5856
5859
  : display;
5857
- if (args.barPosition && !current.splitBarPosition && (process.platform === "win32" || isWsl())) {
5860
+ if (args.barPosition && current.barPosition !== "off" && !current.splitBarPosition && (process.platform === "win32" || isWsl())) {
5858
5861
  updateWtFragmentPosition({ position: current.barPosition, sidebarWidth: current.sidebarWidth });
5859
5862
  }
5860
- if (args.barPosition && current.barPosition !== "bottom") {
5863
+ if (args.barPosition && ["top", "left", "right"].includes(current.barPosition)) {
5861
5864
  ensureCliPositionWrappers(["claude", "antigravity"], { updateShellPath: true });
5862
5865
  }
5863
5866
  const result = {
@@ -5866,13 +5869,13 @@ async function main() {
5866
5869
  providerOrder: normalizeOrder(current.providerOrder, PROVIDERS),
5867
5870
  providers: Object.fromEntries(PROVIDERS.map(provider => [provider, current.providers[provider] !== false])),
5868
5871
  barPosition: current.barPosition,
5869
- splitBarPosition: current.splitBarPosition || current.barPosition,
5872
+ splitBarPosition: current.barPosition === "off" ? "off" : (current.splitBarPosition || current.barPosition),
5870
5873
  sidebarWidth: current.sidebarWidth
5871
5874
  };
5872
5875
  if (args.json) console.log(JSON.stringify(result, null, 2));
5873
5876
  else {
5874
5877
  console.log(`${cliText("Display settings", "표시 설정")}: ${result.providerOrder.map(provider => `${providerLabel(provider)}${result.providers[provider] ? "" : cliText(" (hidden)", " (숨김)")}`).join(" → ")}`);
5875
- console.log(`${cliText("Bar position", "상태바 위치")}: ${result.barPosition}${current.splitBarPosition && current.splitBarPosition !== result.barPosition ? ` (${cliText("split", "통합 바")}: ${current.splitBarPosition})` : ""}`);
5878
+ console.log(`${cliText("Bar position", "상태바 위치")}: ${result.barPosition}${result.barPosition !== "off" && current.splitBarPosition && current.splitBarPosition !== result.barPosition ? ` (${cliText("split", "통합 바")}: ${current.splitBarPosition})` : ""}`);
5876
5879
  if (!args.providerOrder && !args.barPosition) {
5877
5880
  console.log(cliText("Run ai-battery config in a terminal: arrows reorder, Space shows/hides, Tab switches to bar position, Enter saves, Esc cancels.", "터미널에서 ai-battery config를 실행하세요: 방향키 순서 이동 · Space 표시/숨김 · Tab 상태바 위치 전환 · Enter 저장 · Esc 취소"));
5878
5881
  console.log(`${cliText("Or use", "명령으로 변경")}: ai-battery config --provider-order ${result.providerOrder.map(provider => provider === "antigravity" ? "gemini" : provider).join(",")} --position ${result.barPosition}`);
@@ -5979,8 +5982,8 @@ async function main() {
5979
5982
 
5980
5983
  if (args.command === "split") {
5981
5984
  const action = args.subcommand || (args.barPosition ? "position" : "status");
5982
- if (BAR_POSITIONS.includes(action) || action === "position") {
5983
- const targetPos = action === "position" ? args.barPosition : normalizeBarPosition(action);
5985
+ if (SPLIT_BAR_POSITIONS.includes(action) || action === "position") {
5986
+ const targetPos = action === "position" ? args.barPosition : normalizeSplitBarPosition(action);
5984
5987
  const updated = updateDisplayConfig({ splitBarPosition: targetPos });
5985
5988
  const fragmentUpdate = (process.platform === "win32" || isWsl())
5986
5989
  ? updateWtFragmentPosition({ position: targetPos, sidebarWidth: updated.sidebarWidth })
@@ -6018,7 +6021,7 @@ async function main() {
6018
6021
  action,
6019
6022
  mode: resolved.mode,
6020
6023
  configuredMode: updated.splitBar,
6021
- position: updated.splitBarPosition || updated.barPosition,
6024
+ position: updated.splitBarPosition || normalizeSplitBarPosition(updated.barPosition, "bottom"),
6022
6025
  envOverride: resolved.envOverride,
6023
6026
  displayConfigPath: displayConfigPath()
6024
6027
  };
@@ -6086,8 +6089,9 @@ async function main() {
6086
6089
  );
6087
6090
  }
6088
6091
  if (!args.silent) {
6092
+ const barHidden = readConfiguredBarPosition(process.env) === "off";
6089
6093
  const usageRowRequested = activeProvider === "antigravity"
6090
- ? (typeof args.usageRow === "boolean" ? args.usageRow : booleanEnvValue(process.env.AI_BATTERY_ANTIGRAVITY_USAGE_ROW) ?? !tmuxStatusBarActive())
6094
+ ? (typeof args.usageRow === "boolean" ? args.usageRow : booleanEnvValue(process.env.AI_BATTERY_ANTIGRAVITY_USAGE_ROW) ?? (!barHidden && !tmuxStatusBarActive()))
6091
6095
  : claudeUsageRowVisible(args);
6092
6096
  const externalBarActive = process.env.AI_BATTERY_EXTERNAL_BAR === "1";
6093
6097
  const participate = usageRowRequested && !args.attachHud && !externalBarActive;
@@ -126,7 +126,7 @@ export function helpText(command = "", { env = process.env, platform = process.p
126
126
  t("↑↓ select · ←→ reorder · Space show/hide · Enter save · Esc cancel", "↑↓ 선택 · ←→ 순서 이동 · Space 표시/숨김 · Enter 저장 · Esc 취소"),
127
127
  options([
128
128
  ["--provider-order LIST", "Set order directly, comma separated", "순서를 명령으로 지정 (쉼표로 구분)"],
129
- ["--position EDGE", "Set bar placement: bottom, top, left, right", "상태바 위치 설정: bottom, top, left, right"],
129
+ ["--position EDGE", "Set bar placement: off, bottom, top, left, right", "상태바 위치 설정: off, bottom, top, left, right"],
130
130
  json
131
131
  ]),
132
132
  examples(["ai-battery config", "ai-battery config --provider-order antigravity,codex,claude"])].join("\n\n");
@@ -22,6 +22,7 @@ export function editDisplayConfig(initialConfig, { input = process.stdin, output
22
22
  let positionTabVisited = false;
23
23
  const t = (english, korean) => language === "ko" ? korean : english;
24
24
  const positionLabel = pos => ({
25
+ off: t("Off", "표시 안 함 (off)"),
25
26
  bottom: t("Bottom", "하단 (bottom)"),
26
27
  top: t("Top", "상단 (top)"),
27
28
  left: t("Left", "좌측 (left)"),
@@ -132,6 +133,28 @@ export function editDisplayConfig(initialConfig, { input = process.stdin, output
132
133
  };
133
134
  const border = s => color ? `\x1b[2m${s}\x1b[0m` : s;
134
135
  const v = border("│");
136
+ if (barPosition === "off") {
137
+ const innerW = Math.max(12, frameW - 2);
138
+ const centerRow = (raw) => {
139
+ const clipped = truncateMiddleVisible(raw, innerW);
140
+ const len = visibleWidth(clipped);
141
+ const l = Math.floor(Math.max(0, innerW - len) / 2);
142
+ const r = Math.max(0, innerW - len - l);
143
+ return `${v}${" ".repeat(l)}${clipped}${" ".repeat(r)}${v}`;
144
+ };
145
+ const hiddenNote = t("Status bar hidden", "상태바 표시 안 함");
146
+ const top = border(`┌${"─".repeat(innerW)}┐`);
147
+ const bottom = border(`└${"─".repeat(innerW)}┘`);
148
+ return [
149
+ top,
150
+ `${v}${padCell(color ? "\x1b[2m $ codex\x1b[0m" : " $ codex", innerW)}${v}`,
151
+ `${v}${" ".repeat(innerW)}${v}`,
152
+ centerRow(color ? `\x1b[2m${hiddenNote}\x1b[0m` : hiddenNote),
153
+ `${v}${" ".repeat(innerW)}${v}`,
154
+ `${v}${" ".repeat(innerW)}${v}`,
155
+ bottom
156
+ ];
157
+ }
135
158
  if (barPosition === "top" || barPosition === "bottom") {
136
159
  const innerW = Math.max(12, frameW - 2);
137
160
  const barRaw = color
@@ -1,7 +1,8 @@
1
1
  export const PROVIDERS = ["codex", "claude", "antigravity"];
2
2
  export const STATUS_LINE_ITEMS = ["model-with-reasoning", "current-dir", "git-branch", "branch-changes", "context-remaining"];
3
3
  export const SPLIT_BAR_MODES = ["auto", "manual", "off"];
4
- export const BAR_POSITIONS = ["bottom", "top", "left", "right"];
4
+ export const SPLIT_BAR_POSITIONS = ["bottom", "top", "left", "right"];
5
+ export const BAR_POSITIONS = ["off", ...SPLIT_BAR_POSITIONS];
5
6
  export const DEFAULT_SIDEBAR_WIDTH = 5;
6
7
  export const MIN_SIDEBAR_WIDTH = 5;
7
8
  export const MAX_SIDEBAR_WIDTH = 5;
@@ -19,14 +20,22 @@ export function normalizeSplitBarMode(value, fallback = "auto") {
19
20
  return SPLIT_BAR_MODES.includes(normalized) ? normalized : fallback;
20
21
  }
21
22
 
22
- export function normalizeBarPosition(value, fallback = "bottom") {
23
+ export function normalizeSplitBarPosition(value, fallback = "bottom") {
23
24
  if (typeof value !== "string") return fallback;
24
25
  const normalized = value.trim().toLowerCase();
25
26
  if (normalized === "down" || normalized === "b") return "bottom";
26
27
  if (normalized === "up" || normalized === "t") return "top";
27
28
  if (normalized === "l") return "left";
28
29
  if (normalized === "r") return "right";
29
- return BAR_POSITIONS.includes(normalized) ? normalized : fallback;
30
+ return SPLIT_BAR_POSITIONS.includes(normalized) ? normalized : fallback;
31
+ }
32
+
33
+ export function normalizeBarPosition(value, fallback = "bottom") {
34
+ if (typeof value !== "string") return fallback;
35
+ const normalized = value.trim().toLowerCase();
36
+ if (normalized === "off" || normalized === "none" || normalized === "hidden" || normalized === "hide") return "off";
37
+ const edge = normalizeSplitBarPosition(normalized, null);
38
+ return edge || fallback;
30
39
  }
31
40
 
32
41
  export function providerId(value) {
@@ -89,7 +89,7 @@ export function updateTmuxStatus({ socket, action = "tick", token, script, match
89
89
  const sessionLines = run("list-sessions", "-F", "#{session_id}\t#{session_width}").split("\n").filter(Boolean);
90
90
  const paneLines = run("list-panes", "-a", "-F", "#{session_id}\t#{pane_pid}\t#{pane_dead}").split("\n");
91
91
  const panes = paneLines.map(line => { const [session, pid, dead] = line.split("\t"); return { session, pid: Number(pid), dead: dead === "1" }; });
92
- const active = action === "stop" ? new Map() : paneProviders(panes, processTree(), matches);
92
+ const active = (action === "stop" || position === "off") ? new Map() : paneProviders(panes, processTree(), matches);
93
93
  const readFormats = (session, global = false) => {
94
94
  const flags = global ? ["-g"] : ["-t", session];
95
95
  const listing = get(...flags, "status-format");
@@ -770,8 +770,8 @@ async function runFullscreenCompositor(args, activeProvider) {
770
770
  cols: size.cols,
771
771
  rows: size.rows
772
772
  });
773
- const statusVisible = Boolean(initialDecision.showUsage) && !initialDecision.attaching;
774
773
  const statusPosition = readConfiguredBarPosition(process.env);
774
+ const statusVisible = statusPosition !== "off" && Boolean(initialDecision.showUsage) && !initialDecision.attaching;
775
775
  const sidebarWidth = readConfiguredSidebarWidth(process.env);
776
776
  const isSidePosition = statusPosition === "left" || statusPosition === "right";
777
777
  const effectiveArgs = isSidePosition
@@ -1486,6 +1486,10 @@ async function main() {
1486
1486
  }
1487
1487
 
1488
1488
  const args = parseArgs(process.argv.slice(2));
1489
+ if (readConfiguredBarPosition(process.env) === "off") {
1490
+ const exitCode = await runPlain(args);
1491
+ process.exit(exitCode);
1492
+ }
1489
1493
  if (["composite", "auto"].includes(args.layout) && process.stdin.isTTY && process.stdout.isTTY
1490
1494
  && !supportsWindowsVtInput()) {
1491
1495
  try {
@@ -5,7 +5,7 @@ import crypto from "node:crypto";
5
5
  import { spawn, spawnSync } from "node:child_process";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import { atomicRename } from "../../core/atomic-rename.js";
8
- import { DEFAULT_SIDEBAR_WIDTH, isDisplayConfig, normalizeBarPosition, normalizeSidebarWidth, normalizeSplitBarMode } from "../../core/display-config.js";
8
+ import { DEFAULT_SIDEBAR_WIDTH, isDisplayConfig, normalizeBarPosition, normalizeSidebarWidth, normalizeSplitBarMode, normalizeSplitBarPosition } from "../../core/display-config.js";
9
9
  import { claimAutoAttachTrigger, isAutoAttachPending, isSharedBarActive, listActiveAiSessions, registerAiSession, selectSharedBarEdgeGroup, unregisterAiSession } from "../../core/shared-bar.js";
10
10
  import { isWsl } from "../runtime.js";
11
11
  import { isWtFragmentValid, readWtTriggerKeybinding, resolveWindowsLocalAppData, updateWtFragmentPosition } from "./wt-fragment.js";
@@ -168,10 +168,10 @@ export function readConfiguredBarPosition(env = process.env) {
168
168
 
169
169
  export function readConfiguredSplitBarPosition(env = process.env) {
170
170
  const override = String(env.AI_BATTERY_SPLIT_BAR_POSITION || env.AI_BATTERY_BAR_POSITION || "").trim();
171
- if (override) return normalizeBarPosition(override, "bottom");
171
+ if (override) return normalizeSplitBarPosition(override, "bottom");
172
172
  const parsed = readFirstDisplayConfig(env);
173
- if (parsed?.splitBarPosition) return normalizeBarPosition(parsed.splitBarPosition, "bottom");
174
- if (parsed?.barPosition) return normalizeBarPosition(parsed.barPosition, "bottom");
173
+ if (parsed?.splitBarPosition) return normalizeSplitBarPosition(parsed.splitBarPosition, "bottom");
174
+ if (parsed?.barPosition) return normalizeSplitBarPosition(parsed.barPosition, "bottom");
175
175
  return "bottom";
176
176
  }
177
177
 
@@ -832,6 +832,9 @@ export function paneUsageDecision(provider, {
832
832
  isAlive = undefined
833
833
  } = {}) {
834
834
  if (!participate) return { showUsage: false, coordinated: false, sharedBar: false, columns: null, root: null, context: null };
835
+ if (readConfiguredBarPosition(env) === "off") {
836
+ return { showUsage: false, coordinated: false, sharedBar: false, columns: null, root: null, context: null };
837
+ }
835
838
  const wslWt = isWslWtContext(env, platform);
836
839
  if (platform !== "win32" && !wslWt) {
837
840
  return { showUsage: true, coordinated: false, sharedBar: false, columns: null, root: null, context: null };
@@ -219,8 +219,9 @@ class HeadlessTerminalCompositor {
219
219
  constructor(options = {}) {
220
220
  this.columns = clampInteger(options.columns, 2, 1000, 80);
221
221
  this.rows = clampInteger(options.rows, 2, 1000, 24);
222
- this.statusVisible = options.statusVisible !== false;
223
- this.statusPosition = normalizeBarPosition(options.statusPosition || "bottom", "bottom");
222
+ const normalizedPos = normalizeBarPosition(options.statusPosition || "bottom", "bottom");
223
+ this.statusVisible = normalizedPos === "off" ? false : options.statusVisible !== false;
224
+ this.statusPosition = normalizedPos === "off" ? "bottom" : normalizedPos;
224
225
  this.sidebarWidth = clampInteger(options.sidebarWidth, 5, 5, 5);
225
226
  this.statusSliceOffset = options.statusSlice && Number(options.statusSlice.total) > 0
226
227
  ? Math.max(0, Math.trunc(Number(options.statusSlice.offset) || 0))
@@ -502,6 +503,7 @@ class HeadlessTerminalCompositor {
502
503
 
503
504
  setStatusPosition(position) {
504
505
  const next = normalizeBarPosition(position, "bottom");
506
+ if (next === "off") return this.setStatusVisible(false);
505
507
  if (this.statusPosition === next) return Promise.resolve();
506
508
  this.statusPosition = next;
507
509
  return this.resize(this.columns, this.rows);
@@ -1,6 +1,6 @@
1
1
  import { spawn } from "node:child_process";
2
2
  import { claimSharedBar, clearAutoAttachTrigger, clearTabAiSessions, heartbeatSharedBar, listActiveAiSessions, markSharedBarDismissed, releaseSharedBar } from "../../core/shared-bar.js";
3
- import { createCrossOsSessionAlive, nativeTabState, readConfiguredSidebarWidth, readConfiguredSplitBarPosition, resolveCurrentPaneContext, scheduleNativeFocusRestore, sharedBarRoot } from "./shared-bar-platform.js";
3
+ import { createCrossOsSessionAlive, nativeTabState, readConfiguredBarPosition, readConfiguredSidebarWidth, readConfiguredSplitBarPosition, resolveCurrentPaneContext, scheduleNativeFocusRestore, sharedBarRoot } from "./shared-bar-platform.js";
4
4
  import { readWtProfileColorMap } from "./wt-fragment.js";
5
5
  import { charWidth, stripAnsi, visibleWidth } from "../../core/terminal.js";
6
6
 
@@ -410,6 +410,9 @@ export function runSharedBar({
410
410
  const root = sharedBarRoot(env);
411
411
  const customResolver = resolveContext !== undefined;
412
412
  const getContext = resolveContext || (() => resolveCurrentPaneContext("direct", { ownerPid: process.pid, env, forceTab: true, includePaneCount: true }));
413
+ if (!customResolver && readConfiguredBarPosition(env) === "off") {
414
+ return { reason: "bar-off", active: false };
415
+ }
413
416
  const barPosition = readConfiguredSplitBarPosition(env);
414
417
  const initialSidebarWidth = readConfiguredSidebarWidth(env);
415
418
  const isVerticalPosition = barPosition === "left" || barPosition === "right";
@@ -681,6 +684,10 @@ export function runSharedBar({
681
684
  if (closed || !autoExitEnabled || !context?.window) return;
682
685
  try {
683
686
  if (!customResolver) {
687
+ if (readConfiguredBarPosition(env) === "off") {
688
+ stop("config-changed");
689
+ return;
690
+ }
684
691
  const nextPos = readConfiguredSplitBarPosition(env);
685
692
  const nextSideW = readConfiguredSidebarWidth(env);
686
693
  if (nextPos !== barPosition || (isVerticalPosition && nextSideW !== initialSidebarWidth)) {
@@ -4,7 +4,7 @@ import path from "node:path";
4
4
  import crypto from "node:crypto";
5
5
  import { spawnSync } from "node:child_process";
6
6
  import { atomicRename } from "../../core/atomic-rename.js";
7
- import { DEFAULT_SIDEBAR_WIDTH, normalizeBarPosition, normalizeSidebarWidth } from "../../core/display-config.js";
7
+ import { DEFAULT_SIDEBAR_WIDTH, normalizeSidebarWidth, normalizeSplitBarPosition } from "../../core/display-config.js";
8
8
  import { isWsl } from "../runtime.js";
9
9
  import { ensureTriggerBinding, readTriggerBinding, removeTriggerBinding } from "./wt-keybinding.js";
10
10
  export { TRIGGER_KEY_CANDIDATES } from "./wt-keybinding.js";
@@ -356,7 +356,7 @@ export function buildWtFragment({
356
356
  splitSize = null,
357
357
  resizeSteps = null
358
358
  }) {
359
- const normalizedPos = normalizeBarPosition(position, "bottom");
359
+ const normalizedPos = normalizeSplitBarPosition(position, "bottom");
360
360
  const normalizedSidebarWidth = normalizeSidebarWidth(sidebarWidth, DEFAULT_SIDEBAR_WIDTH);
361
361
  const splitDirection = normalizedPos === "top" ? "up"
362
362
  : normalizedPos === "left" ? "left"
@@ -494,7 +494,7 @@ export function installWtFragment({ env = process.env, nodePath = process.execPa
494
494
  }
495
495
  const settingsPath = findWtSettingsPath(env);
496
496
  const appearance = readDefaultProfileAppearance(settingsPath);
497
- const effectivePosition = normalizeBarPosition(position, "bottom");
497
+ const effectivePosition = normalizeSplitBarPosition(position, "bottom");
498
498
  const effectiveWidth = normalizeSidebarWidth(sidebarWidth, DEFAULT_SIDEBAR_WIDTH);
499
499
  const fragment = managedFragment(buildWtFragment({ nodePath, cliPath, appearance, position: effectivePosition, sidebarWidth: effectiveWidth }));
500
500
  let backupPath = null;
@@ -572,7 +572,7 @@ export function updateWtFragmentPosition({ env = process.env, position = "bottom
572
572
  const cliPath = unquote(match[2]);
573
573
  const settingsPath = findWtSettingsPath(env);
574
574
  const appearance = readDefaultProfileAppearance(settingsPath);
575
- const nextPos = normalizeBarPosition(position, "bottom");
575
+ const nextPos = normalizeSplitBarPosition(position, "bottom");
576
576
  const nextWidth = normalizeSidebarWidth(sidebarWidth, DEFAULT_SIDEBAR_WIDTH);
577
577
  const built = buildWtFragment({ nodePath, cliPath, appearance, position: nextPos, sidebarWidth: nextWidth, windowClientWidth, windowDpi });
578
578
  // Avoid triggering a WT settings reload right before F24 when the existing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-battery",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Tiny terminal battery meter for local Codex, Claude Code and Gemini CLI usage.",
5
5
  "type": "module",
6
6
  "keywords": [