lane-desk 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/NOTICE +30 -0
- package/README.ko.md +136 -0
- package/README.md +135 -2
- package/bin/lane-desk +27 -0
- package/lib/demo.js +90 -0
- package/lib/i18n.js +313 -0
- package/lib/limitreset.js +242 -0
- package/lib/model.js +238 -0
- package/lib/runout.js +160 -0
- package/lib/sources.js +495 -0
- package/main.js +392 -0
- package/package.json +55 -4
- package/preload.js +18 -0
- package/renderer/app.js +284 -0
- package/renderer/index.html +30 -0
- package/renderer/style.css +189 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rob
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Lane Desk includes code ported from Tally (https://github.com/jettoai/tally):
|
|
2
|
+
|
|
3
|
+
- lib/runout.js: the weekly consumption walk (TallyCLI/UsageAdvisorMath.swift) and the pace
|
|
4
|
+
frame (Tally/Core/FleetForecast.swift), rewritten in JavaScript.
|
|
5
|
+
- lib/limitreset.js: the /limit-reset signals follow Tally/Core/LimitReset.swift and
|
|
6
|
+
TallyCLI/LimitResetSignals.swift.
|
|
7
|
+
|
|
8
|
+
Tally is under the following license:
|
|
9
|
+
|
|
10
|
+
MIT License
|
|
11
|
+
|
|
12
|
+
Copyright (c) 2026 jetto
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
in the Software without restriction, including without limitation the rights
|
|
17
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included in all
|
|
22
|
+
copies or substantial portions of the Software.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
+
SOFTWARE.
|
package/README.ko.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# lane-desk
|
|
2
|
+
|
|
3
|
+
[English](README.md) · 한국어
|
|
4
|
+
|
|
5
|
+
Claude Code나 Codex를 계정 여러 개로 쓰는 사람을 위한 macOS 메뉴바 앱입니다. [Tally](https://github.com/jettoai/tally)가 이미 모으는 값을 읽어, 계정마다 얼마나 남았는지와 지금 속도면 언제 바닥나는지를 보여 줍니다. 같은 창에서 원하는 계정으로 새 세션을 열거나, 돌고 있는 세션으로 바로 돌아갑니다.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
<sub>스크린샷은 지어낸 계정입니다(`LANE_DESK_DEMO=1`).</sub>
|
|
10
|
+
|
|
11
|
+
- **메뉴바에 `C31 X71`이 뜹니다.** Claude와 Codex 계정 전체에서 남은 %이고, Tally가 매긴 가중치를 따릅니다.
|
|
12
|
+
- **계정별 바닥 예상.** 최근 72시간 동안 계정마다 주간 한도를 얼마나 빨리 썼는지 잽니다. 주간 리셋 전에 바닥날 계정에는 시각이 적힌 빨간 태그(「일 03:25 바닥 예상」)를 붙이고, 아니면 「리셋 전 안 바닥남」을 붙입니다. 알려 주기만 합니다. 알림을 보내거나 계정을 대신 바꾸지 않습니다.
|
|
13
|
+
- **새 세션**은 그 계정으로 tmux 세션을 열고 iTerm 새 탭에서 붙습니다.
|
|
14
|
+
- **세션 탭**은 지금 돌고 있는 Claude Code 세션을 최근 순으로 보여 줍니다. **붙기**는 그 세션의 tmux 세션을 iTerm으로 엽니다. 이미 어느 창에 붙어 있으면 iTerm만 앞으로 가져옵니다.
|
|
15
|
+
- **리셋**은 5시간 한도에 걸린 세션에 나타납니다. 확인을 받은 뒤 그 세션에 `/limit-reset`을 입력하고, Claude Code의 답을 대화 기록에서 읽어 알려 줍니다.
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
## 필요한 것
|
|
20
|
+
|
|
21
|
+
- macOS
|
|
22
|
+
- 계정을 추가해 둔 [Tally](https://github.com/jettoai/tally). 사용량 숫자는 `tally status --json`과 `~/.tally/history.jsonl`에서만 옵니다. 그 밖에 읽는 것은 [읽는 것](#읽는-것)에 있습니다.
|
|
23
|
+
- Node.js 22.12 이상
|
|
24
|
+
- 새 세션·붙기·리셋을 쓰려면 [tmux](https://github.com/tmux/tmux) 3.2 이상과 [iTerm2](https://iterm2.com)
|
|
25
|
+
|
|
26
|
+
## 설치
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
npx lane-desk # 메뉴바만
|
|
30
|
+
npx lane-desk --window # 창도 바로 열기
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`npm i -g lane-desk`로 한 번 설치한 뒤 `lane-desk`로 실행해도 됩니다. 처음 실행할 때 Electron(약 110MB)을 받습니다. npm으로 받으면 서명 없는 `.app`을 내려받을 때 뜨는 「확인되지 않은 개발자」 차단 없이 실행됩니다.
|
|
34
|
+
|
|
35
|
+
clone해서 쓸 때:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
git clone https://github.com/robfold/lane-desk.git
|
|
39
|
+
cd lane-desk
|
|
40
|
+
npm install
|
|
41
|
+
bin/lane-desk --window
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
메뉴바 글자를 누르면 팝오버가 열립니다. 오른쪽 클릭 메뉴에 「창으로 열기」가 있습니다. 창에서 `⌘N`은 새 창, `⌘T`는 새 탭입니다.
|
|
45
|
+
|
|
46
|
+
연결하기 전에 먼저 보고 싶다면 `LANE_DESK_DEMO=1 npx lane-desk --window`로 지어낸 계정 화면을 엽니다.
|
|
47
|
+
|
|
48
|
+
## 세션을 여는 명령
|
|
49
|
+
|
|
50
|
+
기본은 계정의 CLI를 그 계정 폴더로 실행하는 것입니다.
|
|
51
|
+
|
|
52
|
+
| 계정 폴더(Tally 기준) | tmux에서 실행하는 것 |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `~/.claude` | `claude` |
|
|
55
|
+
| `~/.claude-work` | `CLAUDE_CONFIG_DIR=~/.claude-work`로 `claude` |
|
|
56
|
+
| `~/.codex` | `codex` |
|
|
57
|
+
| `~/.codex-work` | `CODEX_HOME=~/.codex-work`로 `codex` |
|
|
58
|
+
|
|
59
|
+
계정마다 따로 만든 실행 명령이 이미 있다면 `~/.config/lane-desk/config.json`에 폴더와 명령을 짝지어 둡니다.
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"lanes": {
|
|
64
|
+
"~/.claude-work": "claude-work",
|
|
65
|
+
"~/.codex-work": "codex-work"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
값은 `PATH`에 있는 명령 이름 하나여야 합니다. 그 밖의 값은 무시합니다. 창은 계정 ID만 보내고, 실행할 명령은 main 프로세스가 이 파일에서 고릅니다.
|
|
71
|
+
|
|
72
|
+
## 바닥 예상 계산
|
|
73
|
+
|
|
74
|
+
Tally는 계정 사용량이 바뀔 때마다 `~/.tally/history.jsonl`에 한 줄을 붙입니다. Lane Desk는 그 끝 512KB(약 일주일)를 읽습니다.
|
|
75
|
+
|
|
76
|
+
1. **쓴 양.** 계정의 주간 창에서 최근 72시간 동안 `used`가 오른 만큼을 더합니다. Tally의 소모량 계산(`UsageAdvisorMath.consumption`)을 JavaScript로 옮겼습니다. 리셋 시각이 1분씩 흔들리는 것, 지난 주기 값이 한 번 끼는 것, 리셋 시각은 그대로인데 카운터가 다시 시작하는 것을 거릅니다.
|
|
77
|
+
2. **속도.** 쓴 양 ÷ 기록이 덮은 시간(72시간, 기록 전체가 짧으면 그만큼). Tally처럼 시간은 계정의 첫 줄이 아니라 기록 전체의 시작부터 셉니다. Tally는 값이 바뀔 때만 한 줄을 쓰므로, 조용한 계정의 첫 줄은 그 계정이 언제 시작했는지 알려 주지 않기 때문입니다. 그래서 한 시간 전에 추가한 계정은 며칠이 쌓일 때까지 느리게 보입니다. 기록이 6시간 미만이면 「바닥 예상 측정 중」입니다. Tally의 전체 예측(`FleetForecast.weeklyRates`) 틀을 계정 단위로 적용했습니다.
|
|
78
|
+
3. **바닥 시각.** 지금 + 남은 % ÷ 속도. 주간 리셋보다 이르면 빨간 태그를 붙입니다.
|
|
79
|
+
|
|
80
|
+
예상은 "지금까지처럼 쓰면"의 값입니다. Tally가 새 세션을 한 계정에 몰아주면 그 계정은 빨라지고 다른 계정은 느려집니다.
|
|
81
|
+
|
|
82
|
+
## 리셋(`/limit-reset`)
|
|
83
|
+
|
|
84
|
+
Claude Code는 `/limit-reset`으로 세션의 5시간 한도를 주 1회 풀어 줍니다. 주간 한도는 그대로입니다. API가 없어서 Lane Desk는 Claude Code가 대화 기록에 직접 쓴 것만 읽습니다. 명령 출력과 한도 안내입니다. 대화 본문은 그 문장을 인용할 수 있어 읽지 않습니다.
|
|
85
|
+
|
|
86
|
+
- 계정에 `리셋 ?`(아직 관찰 없음), `리셋 남음`, `리셋 씀 · 2d 4h 뒤`, `리셋 없음`(Claude Code가 Unknown command로 답함) 중 하나를 붙입니다.
|
|
87
|
+
- 버튼은 세 조건을 모두 만족할 때만 눌립니다. 세션이 대기 상태, 이번 주 리셋을 썼다고 확인되지 않음(`리셋 ?`도 포함), 주간 잔량 20% 이상입니다. 20%는 Tally와 같은 기준입니다. 그 아래면 곧 주간 한도에 걸립니다.
|
|
88
|
+
- tmux 창이 스크롤 모드면 입력하지 않습니다. 입력 직전에 세션 상태를 한 번 더 봅니다.
|
|
89
|
+
- 아직 관찰하지 못한 것: 성공 문장. 지금까지 본 실제 답은 한도에 걸리지 않은 세션에서 나온 "A 5-hour limit reset isn't available right now." 하나입니다.
|
|
90
|
+
|
|
91
|
+
## 읽는 것
|
|
92
|
+
|
|
93
|
+
- `tally status --json`과 `~/.tally/history.jsonl`
|
|
94
|
+
- 있으면 `~/.config/lane-desk/config.json`
|
|
95
|
+
- Tally가 아는 Claude 계정 폴더마다: `sessions/<pid>.json`(pid·이름·폴더·상태·tmux 창만 남김), `/limit-reset` 답과 한도 안내를 찾기 위한 최근 8일 대화 기록(`projects/*/*.jsonl`), `.claude.json`에 캐시된 롤아웃 값 하나
|
|
96
|
+
|
|
97
|
+
Keychain, 토큰, 세션 `.key` 파일, 프로세스 인자는 읽지 않고, 네트워크 요청도 하지 않습니다. 계정 정보를 공유하거나 묶어 쓰지 않습니다. 계정을 어떻게 쓰는지는 각 서비스 약관을 따르세요.
|
|
98
|
+
|
|
99
|
+
## 설정
|
|
100
|
+
|
|
101
|
+
| 변수 | 하는 일 |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `LANE_DESK_LANG=en` 또는 `ko` | 언어. 기본은 시스템 언어(한국어면 한국어, 아니면 영어) |
|
|
104
|
+
| `LANE_DESK_CONFIG` | `config.json`의 다른 경로 |
|
|
105
|
+
| `TALLY_BIN` | `tally` CLI 경로. 기본은 `PATH`의 `tally`, 없으면 `/Applications/Tally.app/Contents/Helpers/tally` |
|
|
106
|
+
| `LANE_DESK_HISTORY` | Tally `history.jsonl`의 다른 경로 |
|
|
107
|
+
| `LANE_DESK_DEMO=1` | Tally 대신 지어낸 계정 |
|
|
108
|
+
| `LANE_DESK_CAPTURE=<폴더>` | 팝오버·사용량 창·세션 창을 띄우지 않고 PNG로 찍은 뒤 끝냄 |
|
|
109
|
+
|
|
110
|
+
## 이번 판에 없는 것
|
|
111
|
+
|
|
112
|
+
- 세션 탭의 Codex 세션. Codex는 프로세스별 세션 파일을 남기지 않아 찾을 근거가 없습니다.
|
|
113
|
+
- 서명된 `.app`. `npx lane-desk`나 clone한 폴더에서 실행합니다.
|
|
114
|
+
|
|
115
|
+
## 다른 도구가 나은 경우
|
|
116
|
+
|
|
117
|
+
- **가장 좋은 계정을 골라 바로 실행만 하면 될 때:** Tally가 혼자 합니다(`tally claude`, `tally codex`). Lane Desk는 계정별 바닥 예상과 세션 목록을 더합니다.
|
|
118
|
+
- **Tally 없이 여러 서비스를 볼 때:** [CodexBar](https://github.com/steipete/CodexBar)가 Claude·Codex 등의 사용량을 메뉴바에 보여 줍니다.
|
|
119
|
+
|
|
120
|
+
## 개발
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
npm test
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
배포는 GitHub Actions가 합니다. `package.json` 버전과 같은 태그를 push하면(`git tag v0.1.1 && git push origin v0.1.1`) [`publish.yml`](.github/workflows/publish.yml)이 테스트한 뒤 npm 신뢰 배포(OIDC)로 올립니다. npm 토큰은 어디에도 저장하지 않습니다.
|
|
127
|
+
|
|
128
|
+
테스트는 순수 함수 부분(실행 명령, 화면 값, 바닥 예상, `/limit-reset` 답 읽기)을 다룹니다. tmux·iTerm·화면에 닿는 부분은 손으로 확인했습니다.
|
|
129
|
+
|
|
130
|
+
## 출처
|
|
131
|
+
|
|
132
|
+
jetto의 [Tally](https://github.com/jettoai/tally)(MIT) 위에 만들었습니다. 바닥 예상과 `/limit-reset` 신호는 Tally 소스를 따릅니다. [NOTICE](NOTICE)를 보세요.
|
|
133
|
+
|
|
134
|
+
## 라이선스
|
|
135
|
+
|
|
136
|
+
[MIT](LICENSE)
|
package/README.md
CHANGED
|
@@ -1,3 +1,136 @@
|
|
|
1
|
-
#
|
|
1
|
+
# lane-desk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
English · [한국어](README.ko.md)
|
|
4
|
+
|
|
5
|
+
A macOS menu bar app for people who use Claude Code or Codex on more than one account. It reads what [Tally](https://github.com/jettoai/tally) already tracks and shows, per account, how much is left and when it runs out at your current pace. From the same window you start a session on any account, or jump back into one that is running.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
<sub>Screenshots use made-up accounts (`LANE_DESK_DEMO=1`).</sub>
|
|
10
|
+
|
|
11
|
+
- **The menu bar shows `C31 X71`**: Claude and Codex, percent left across all your accounts, as Tally weighs them.
|
|
12
|
+
- **Run-out forecast per account.** It measures how fast each account spent its weekly limit over the last 72 hours. If the account will run out before its weekly reset, it gets a red tag with the time ("Runs out Sun 03:25"). Otherwise the tag says "Lasts until reset". It only tells you. It sends no notification and never switches accounts for you.
|
|
13
|
+
- **New session** opens a tmux session on that account and attaches to it in a new iTerm tab.
|
|
14
|
+
- **Sessions tab** lists the Claude Code sessions running now, newest first. **Attach** opens the session's tmux session in iTerm, or brings iTerm forward if a window is already attached.
|
|
15
|
+
- **Reset** appears on a session stuck at its 5-hour limit. It types `/limit-reset` into that session after you confirm, then reads Claude Code's answer from the transcript.
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
## Requirements
|
|
20
|
+
|
|
21
|
+
- macOS
|
|
22
|
+
- [Tally](https://github.com/jettoai/tally) running, with your accounts added. Usage numbers come only from `tally status --json` and `~/.tally/history.jsonl`; see [What it reads](#what-it-reads) for the rest.
|
|
23
|
+
- Node.js 22.12 or later
|
|
24
|
+
- For New session, Attach, and Reset: [tmux](https://github.com/tmux/tmux) 3.2 or later and [iTerm2](https://iterm2.com)
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
npx lane-desk # menu bar only
|
|
30
|
+
npx lane-desk --window # also open a window
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or install it once with `npm i -g lane-desk` and run `lane-desk`. The first run downloads Electron (about 110 MB). Installed from npm, it runs without the "unidentified developer" prompt that an unsigned `.app` download gets.
|
|
34
|
+
|
|
35
|
+
From a clone:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
git clone https://github.com/robfold/lane-desk.git
|
|
39
|
+
cd lane-desk
|
|
40
|
+
npm install
|
|
41
|
+
bin/lane-desk --window
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Click the menu bar title for the popover. Right-click it for "Open as Window". In a window, `⌘N` opens a new window and `⌘T` a new tab.
|
|
45
|
+
|
|
46
|
+
Want to look before you connect anything? `LANE_DESK_DEMO=1 npx lane-desk --window` opens the window with made-up accounts.
|
|
47
|
+
|
|
48
|
+
## Starting sessions
|
|
49
|
+
|
|
50
|
+
By default, New session runs the account's own CLI with its folder:
|
|
51
|
+
|
|
52
|
+
| Account folder (from Tally) | What runs in tmux |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `~/.claude` | `claude` |
|
|
55
|
+
| `~/.claude-work` | `claude` with `CLAUDE_CONFIG_DIR=~/.claude-work` |
|
|
56
|
+
| `~/.codex` | `codex` |
|
|
57
|
+
| `~/.codex-work` | `codex` with `CODEX_HOME=~/.codex-work` |
|
|
58
|
+
|
|
59
|
+
If you already have one wrapper command per account, map folders to commands in `~/.config/lane-desk/config.json`:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"lanes": {
|
|
64
|
+
"~/.claude-work": "claude-work",
|
|
65
|
+
"~/.codex-work": "codex-work"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
A value must be a bare command name on your `PATH`. Anything else is ignored. The window only sends an account ID; the command is picked in the main process from this file.
|
|
71
|
+
|
|
72
|
+
## How the forecast works
|
|
73
|
+
|
|
74
|
+
Tally appends a line to `~/.tally/history.jsonl` each time an account's usage moves. Lane Desk reads the last 512 KB (about a week).
|
|
75
|
+
|
|
76
|
+
1. **Spent.** For each account's weekly window, it adds up how much `used` went up in the last 72 hours. This is a JavaScript port of Tally's own consumption walk (`UsageAdvisorMath.consumption`). It ignores reset times that drift by a minute, a one-poll reading from the previous cycle, and a counter that restarts without its reset time moving.
|
|
77
|
+
2. **Pace.** Spent ÷ hours covered (72, or less when the whole history is shorter). Like Tally, the hours count from the start of the history, not from an account's first line: Tally writes a line only when a value moves, so a quiet account's first line says nothing about when it started. An account added an hour ago therefore reads slow until it has a few days behind it. With under 6 hours of history it says "Measuring pace". This is the frame of Tally's fleet forecast (`FleetForecast.weeklyRates`), done per account instead of for the whole fleet.
|
|
78
|
+
3. **Run-out time.** Now + percent left ÷ pace. If that comes before the weekly reset, the account gets the red tag.
|
|
79
|
+
|
|
80
|
+
The forecast assumes you keep using each account the way you did. If Tally starts sending all new sessions to one account, that account speeds up and the others slow down.
|
|
81
|
+
|
|
82
|
+
## About Reset (`/limit-reset`)
|
|
83
|
+
|
|
84
|
+
Claude Code can lift a session's 5-hour limit once a week with `/limit-reset`. The weekly limit stays. There is no API for it, so Lane Desk only reads what Claude Code itself writes to the transcript: the command's output and limit notices. It does not read the conversation, which can quote those sentences.
|
|
85
|
+
|
|
86
|
+
- Accounts get a tag: `Reset ?` (not seen yet), `Reset left`, `Reset used · 2d 4h`, or `No reset` (Claude Code answered "Unknown command").
|
|
87
|
+
- The button works only when the session is idle, this week's reset is not known to be used (`Reset ?` counts), and the account has at least 20% weekly left (Tally's rule: below that, the weekly wall comes soon anyway).
|
|
88
|
+
- It does not type into a tmux pane in scroll mode, and it checks the session again right before typing.
|
|
89
|
+
- Not seen yet: the success sentence. The only real answer observed so far is "A 5-hour limit reset isn't available right now." from a session that was not at its limit.
|
|
90
|
+
|
|
91
|
+
## What it reads
|
|
92
|
+
|
|
93
|
+
- `tally status --json` and `~/.tally/history.jsonl`
|
|
94
|
+
- `~/.config/lane-desk/config.json`, if present
|
|
95
|
+
- For each Claude account folder Tally knows: `sessions/<pid>.json` (pid, name, folder, status, tmux pane; nothing else is kept), the last 8 days of transcripts (`projects/*/*.jsonl`) for `/limit-reset` answers and limit notices, and one cached rollout value in `.claude.json`
|
|
96
|
+
|
|
97
|
+
It does not read Keychain, tokens, session `.key` files, or process arguments, and it makes no network requests. It never shares or pools credentials; how you use your accounts is between you and your providers' terms.
|
|
98
|
+
|
|
99
|
+
## Settings
|
|
100
|
+
|
|
101
|
+
| Variable | What it does |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `LANE_DESK_LANG=en` or `ko` | Language. Default: your system language (Korean if it is Korean, otherwise English) |
|
|
104
|
+
| `LANE_DESK_CONFIG` | Another path for `config.json` |
|
|
105
|
+
| `TALLY_BIN` | Path to the `tally` CLI. Default: `tally` on `PATH`, then `/Applications/Tally.app/Contents/Helpers/tally` |
|
|
106
|
+
| `LANE_DESK_HISTORY` | Another path for Tally's `history.jsonl` |
|
|
107
|
+
| `LANE_DESK_DEMO=1` | Made-up accounts instead of Tally |
|
|
108
|
+
| `LANE_DESK_CAPTURE=<folder>` | Render the popover, the Usage window, and the Sessions window to PNG without showing them, then quit |
|
|
109
|
+
|
|
110
|
+
## Not in this version
|
|
111
|
+
|
|
112
|
+
- Codex sessions in the Sessions tab. Codex writes no per-process session file to find them by.
|
|
113
|
+
- A signed `.app`. Run it with `npx lane-desk` or from a clone.
|
|
114
|
+
|
|
115
|
+
## When to use something else
|
|
116
|
+
|
|
117
|
+
- **Just picking the best account and launching on it:** Tally does that on its own (`tally claude`, `tally codex`). Lane Desk adds the per-account forecast and the session list.
|
|
118
|
+
- **Many providers, without Tally:** [CodexBar](https://github.com/steipete/CodexBar) shows usage for Claude, Codex, and others in the menu bar.
|
|
119
|
+
|
|
120
|
+
## Development
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
npm test
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Releases go out from GitHub Actions: push a tag that matches `package.json` (`git tag v0.1.1 && git push origin v0.1.1`) and [`publish.yml`](.github/workflows/publish.yml) tests and publishes with npm trusted publishing. No npm token is stored.
|
|
127
|
+
|
|
128
|
+
The tests cover the pure parts: lanes, the view, the forecast, and reading `/limit-reset` answers. Anything that touches tmux, iTerm, or the screen was checked by hand.
|
|
129
|
+
|
|
130
|
+
## Credits
|
|
131
|
+
|
|
132
|
+
Built on top of [Tally](https://github.com/jettoai/tally) by jetto (MIT). The forecast and the `/limit-reset` signals follow Tally's source; see [NOTICE](NOTICE).
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
[MIT](LICENSE)
|
package/bin/lane-desk
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
// Start Lane Desk in the menu bar and return to the shell. Pass --window to open a window right away.
|
|
4
|
+
// Works from a clone (bin/lane-desk) and from npm (npx lane-desk, npm i -g lane-desk).
|
|
5
|
+
|
|
6
|
+
const path = require('node:path');
|
|
7
|
+
const { spawn } = require('node:child_process');
|
|
8
|
+
|
|
9
|
+
let electron;
|
|
10
|
+
try {
|
|
11
|
+
// The electron package gives the path to its binary, downloading it on first use.
|
|
12
|
+
electron = require('electron');
|
|
13
|
+
} catch (e) {
|
|
14
|
+
console.error(`Could not load Electron: ${e.message}`);
|
|
15
|
+
console.error('From a clone, run `npm install` first.');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const root = path.join(__dirname, '..');
|
|
20
|
+
const capture = Boolean(process.env.LANE_DESK_CAPTURE);
|
|
21
|
+
const child = spawn(electron, [root, ...process.argv.slice(2)], {
|
|
22
|
+
// A capture run renders PNGs and quits, so wait for it. A normal run stays in the menu bar on its own.
|
|
23
|
+
detached: !capture,
|
|
24
|
+
stdio: 'ignore',
|
|
25
|
+
});
|
|
26
|
+
if (capture) child.on('exit', (code) => process.exit(code ?? 0));
|
|
27
|
+
else child.unref();
|
package/lib/demo.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// Made-up accounts for screenshots (LANE_DESK_DEMO=1). Nothing here is read from the machine
|
|
3
|
+
// except the home folder path, so paths draw as "~/.claude-work".
|
|
4
|
+
|
|
5
|
+
const os = require('node:os');
|
|
6
|
+
const path = require('node:path');
|
|
7
|
+
|
|
8
|
+
const HOME = os.homedir();
|
|
9
|
+
const H = 3600 * 1000;
|
|
10
|
+
const at = (now, hours) => new Date(now + hours * H).toISOString();
|
|
11
|
+
|
|
12
|
+
const ACCOUNTS = [
|
|
13
|
+
// provider, folder, label, weekly left, hours to weekly reset, model left, pace (% per hour), best
|
|
14
|
+
['claude', '.claude', 'me@example.com', 9, 93, 90, 1.3, false],
|
|
15
|
+
['claude', '.claude-work', 'me@work.example', 85, 89, 100, 0.2, true],
|
|
16
|
+
['claude', '.claude-side', 'side@example.com', 0, 41, 54, 0.9, false],
|
|
17
|
+
['codex', '.codex', 'me@example.com', 94, 164, null, 0.15, false],
|
|
18
|
+
['codex', '.codex-work', 'me@work.example', 48, 109, null, 0.35, true],
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
const id = (provider, dir) => `${provider}:${dir}`;
|
|
22
|
+
|
|
23
|
+
function status(now) {
|
|
24
|
+
const accounts = ACCOUNTS.map(([provider, dir, label, weekly, resetH, model, , best]) => ({
|
|
25
|
+
id: id(provider, dir),
|
|
26
|
+
provider,
|
|
27
|
+
label,
|
|
28
|
+
launchHome: path.join(HOME, dir),
|
|
29
|
+
weeklyRemaining: weekly,
|
|
30
|
+
weeklyResetsAt: at(now, resetH),
|
|
31
|
+
modelRemaining: model,
|
|
32
|
+
modelWindowName: model === null ? undefined : 'Opus',
|
|
33
|
+
modelResetsAt: model === null ? undefined : at(now, resetH),
|
|
34
|
+
best,
|
|
35
|
+
isStale: false,
|
|
36
|
+
lastRefreshFailed: false,
|
|
37
|
+
}));
|
|
38
|
+
return {
|
|
39
|
+
version: 1,
|
|
40
|
+
generatedAt: new Date(now).toISOString(),
|
|
41
|
+
stale: false,
|
|
42
|
+
accounts,
|
|
43
|
+
fleet: { claude: { sustainable: true }, codex: { sustainable: true } },
|
|
44
|
+
fleetWeighted: { claude: { remainingPercent: 31 }, codex: { remainingPercent: 71 } },
|
|
45
|
+
advisor: {
|
|
46
|
+
claude: { headline: 'near capacity: 3.1 accounts a week over 4 weeks, 3 owned' },
|
|
47
|
+
codex: { headline: 'current accounts are sufficient' },
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** A straight-line burn over the last 80 hours that ends at each account's current value. */
|
|
53
|
+
function history(now) {
|
|
54
|
+
const rows = {};
|
|
55
|
+
for (const [provider, dir, , weekly, resetH, , pace] of ACCOUNTS) {
|
|
56
|
+
const resetAt = now + resetH * H;
|
|
57
|
+
const end = 100 - weekly;
|
|
58
|
+
const list = [];
|
|
59
|
+
for (let h = 80; h >= 0; h -= 2) {
|
|
60
|
+
const used = Math.max(0, Math.round(end - pace * h));
|
|
61
|
+
if (!list.length || list[list.length - 1].used !== used) list.push({ ts: now - h * H, used, resetAt });
|
|
62
|
+
}
|
|
63
|
+
rows[id(provider, dir)] = list;
|
|
64
|
+
}
|
|
65
|
+
return { rows, firstAt: now - 80 * H };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function sessions(now) {
|
|
69
|
+
const s = (pid, dir, name, cwd, status, mins, wall) => ({
|
|
70
|
+
pid,
|
|
71
|
+
home: path.join(HOME, dir),
|
|
72
|
+
name,
|
|
73
|
+
cwd: path.join(HOME, cwd),
|
|
74
|
+
status,
|
|
75
|
+
tmux: `${name}:@1.%1`,
|
|
76
|
+
updatedAt: now - mins * 60000,
|
|
77
|
+
wall,
|
|
78
|
+
});
|
|
79
|
+
return [
|
|
80
|
+
s(41201, '.claude-work', 'billing-refunds', 'code/billing-service', 'idle', 0, 'session'),
|
|
81
|
+
s(41388, '.claude-work', 'docs-site', 'code/docs', 'busy', 1, null),
|
|
82
|
+
s(40977, '.claude', 'api-migration', 'code/api', 'waiting', 6, null),
|
|
83
|
+
s(39812, '.claude', 'release-notes', 'code/api', 'idle', 48, null),
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** One account uses its own wrapper command, to show what config.json lanes look like. */
|
|
88
|
+
const config = { lanes: { '~/.claude-work': 'claude-work' } };
|
|
89
|
+
|
|
90
|
+
module.exports = { status, history, sessions, config };
|