claude-org 0.2.2 → 0.4.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/CHANGELOG.md +18 -0
- package/LICENSE +21 -21
- package/README.md +71 -9
- package/bin/claude-org.js +21 -3
- package/lib/config.js +42 -4
- package/lib/launch.js +38 -3
- package/lib/pick.js +9 -4
- package/lib/probe.js +90 -29
- package/lib/proxy.js +419 -105
- package/lib/status.js +3 -2
- package/lib/usage.js +7 -3
- package/package.json +1 -1
package/lib/status.js
CHANGED
|
@@ -21,7 +21,8 @@ function authStatus(envExtra = {}) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
// model: passed to probe (undefined -> CLAUDE_ORG_PROBE_MODEL or Haiku).
|
|
25
|
+
async function statusAll(model) {
|
|
25
26
|
for (const name of listOrgs()) {
|
|
26
27
|
const tok = readToken(name);
|
|
27
28
|
if (tok === null) continue;
|
|
@@ -29,7 +30,7 @@ async function statusAll() {
|
|
|
29
30
|
const out = await authStatus({ CLAUDE_CODE_OAUTH_TOKEN: tok });
|
|
30
31
|
const lines = out.split('\n').filter(l => KEYS_RE.test(l));
|
|
31
32
|
console.log(lines.length ? lines.join('\n') : ' (auth status failed)');
|
|
32
|
-
const r = await probe(name);
|
|
33
|
+
const r = await probe(name, model);
|
|
33
34
|
if (r.line) console.log(` ${r.line}`);
|
|
34
35
|
}
|
|
35
36
|
console.log('== default (no env) ==');
|
package/lib/usage.js
CHANGED
|
@@ -24,11 +24,15 @@ token org alphabetically):
|
|
|
24
24
|
claude-org auto [claude args...] launch on <prefer> if usable, else default
|
|
25
25
|
(decided once at launch)
|
|
26
26
|
claude-org <name> [claude args...] e.g. claude-org work --resume
|
|
27
|
-
claude-org probe [<name>]
|
|
28
|
-
|
|
27
|
+
claude-org probe [<name>] [--model <id>]
|
|
28
|
+
print the org's 5h window state on one line
|
|
29
|
+
(exit 0 when allowed); with --model, probe with
|
|
30
|
+
that model and add model_status= (exit 1 when
|
|
31
|
+
the org refused it)
|
|
29
32
|
claude-org watch wait until <prefer> recovers, then notify
|
|
30
33
|
(terminal + optional CLAUDE_ORG_NOTIFY_CMD)
|
|
31
|
-
claude-org status
|
|
34
|
+
claude-org status [--model <id>] show \`claude auth status\` and probe for each
|
|
35
|
+
org token
|
|
32
36
|
claude-org list list saved org names
|
|
33
37
|
|
|
34
38
|
auto / <name> only read env at launch, so they cannot switch mid-session. To keep
|
package/package.json
CHANGED