accounts: switch to the next account with room, or the one with the most left (#4532)
StringKe (#4532), comparing magpie with cswap 0.29.0: there was no "switch to the next account", and when every account was past its line the automatic switch stayed on the spent one, where cswap moves to the account with the most room left. - `magpie accounts switch <claude|codex> next` (provider.NextInOrder) takes the other accounts that are on in magpie, from the one after the account the agent is on, wrapping round: the first whose allowance is known and has room, else the one with the most room left, and says it is past its line. A saved Claude account not read yet is read first (readSpare), as the automatic switch's spares are. With no reading of any it refuses rather than guess; for any other agent it asks for the account by name. - NextLogin (shared by Codex and Claude Code): when the account the agent is on is spent and every spare is past its line too, it moves to the spare with the most room left (roomLeft: the fullest stopping window's distance below the switch share, or the account's own cap when lower), when that has at least roomMargin (1 point) more than the one it is on, so two all but even accounts don't trade the agent each look. A held, failed or unknown reading is never moved to. One model's own window still counts for nothing, as before. - docs: reference.md (the automatic switch and `next`; its "a Claude account magpie knows nothing of is not moved to" was stale since readSpare), providers-accounts.md's Used-up switch row, the en/zh/ja start pages' command table, `magpie help`. Run (on mote, sandbox HOME through the packages' TestMain): - go test -timeout 45m -count=1 ./internal/provider ./internal/cli: ok (144s, 44s), at this change's tree before the next commit's edits. - TestNextLoginTakesTheMostRoomWhenAllArePast and TestNextInOrder, each over codex and claude with three accounts: green; red with the fallback taken out of NextLogin (the two "most room" cases, both agents) and with NextInOrder not starting after the signed-in account ("the one after it", both agents). The "none has more by the margin" case fails without roomMargin. - Built the nogui binary and ran in a fresh sandbox HOME on mote: `accounts switch claude next --help` (prints the accounts help), `switch claude next` and `switch codex next` with no accounts ("has no other account that is on"), `switch gemini next` (asks for a name), `switch claude nxt` (no such account), `switch claude` (usage). - gofmt -l clean. Cross-OS vet: run at the head of this stack. Not tried: a real switch between real Claude or Codex accounts; the CLI `next` with real saved accounts (the provider tests cover the choice).
This commit is contained in:
+7
-1
@@ -1847,7 +1847,13 @@ in to a minute after it starts and every 5 minutes after: once it has used
|
||||
98% of a window (100% In order), or reached its usage cap, magpie signs
|
||||
the agent in to the next ticked account, in their order, whose allowance
|
||||
is known and under that share. A saved Claude account magpie knows
|
||||
nothing of yet (see below) is not moved to. Once the account it moved the
|
||||
nothing of yet (see below) is read first. When every other account is
|
||||
past that share too, magpie moves the agent to the one with the most room
|
||||
left, if it has at least a point more than the account it is on; else the
|
||||
agent stays. `magpie accounts switch claude next` (or `codex next`) does
|
||||
the same by hand: the next ticked account after the one the agent is on,
|
||||
in their order and wrapping round, that has room, or the one with the most
|
||||
room left when none has. Once the account it moved the
|
||||
agent off has every window under 90% again, it signs the agent back in to
|
||||
it. *Keep … signed in to* turns this off: the agent stays on the first
|
||||
account, or on the account you picked, whatever it has left. It changes nothing in the gateway's routing.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -21,7 +21,7 @@ import (
|
||||
)
|
||||
|
||||
// accountsCmd: `magpie accounts [agent] [--json]`, `magpie accounts add <agent>`,
|
||||
// `magpie accounts switch|forget <agent> <email>`,
|
||||
// `magpie accounts switch|forget <agent> <email>`, `magpie accounts switch <claude|codex> next`,
|
||||
// `magpie accounts project <gemini|antigravity> <email> <project>`,
|
||||
// `magpie accounts alias <agent> <email> [<name>|--clear]`
|
||||
// `magpie accounts switch-only <codex|claude> [on|off]`
|
||||
@@ -31,7 +31,7 @@ func accountsCmd(args []string) error {
|
||||
if len(args) > 1 && args[1] == "discovery" {
|
||||
return accountsDiscoveryCmd(args[2:])
|
||||
}
|
||||
const usage = "usage: magpie accounts [claude|codex|grok|copilot|gemini|antigravity|zed|factory|mimo|<plugin>] [--json] | magpie accounts add <claude|codex|gemini|antigravity|zed|factory|mimo|<plugin>> | magpie accounts add copilot [--host <name>.ghe.com] | magpie accounts import <codex|claude|antigravity|factory> <file>... [--yes] | magpie accounts refresh [--json] | magpie accounts checkin [--json] | magpie accounts switch|forget <claude|codex|gemini|antigravity|zed|factory|mimo|<plugin>> <email> | magpie accounts switch|forget copilot <login>[@<name>.ghe.com] [--host <name>.ghe.com] | magpie accounts project <gemini|antigravity> <email> <gcp-project-id> | magpie accounts alias <agent|<plugin>> <email> [<name>|--clear] | magpie accounts switch-only <codex|claude> [on|off]"
|
||||
const usage = "usage: magpie accounts [claude|codex|grok|copilot|gemini|antigravity|zed|factory|mimo|<plugin>] [--json] | magpie accounts add <claude|codex|gemini|antigravity|zed|factory|mimo|<plugin>> | magpie accounts add copilot [--host <name>.ghe.com] | magpie accounts import <codex|claude|antigravity|factory> <file>... [--yes] | magpie accounts refresh [--json] | magpie accounts checkin [--json] | magpie accounts switch|forget <claude|codex|gemini|antigravity|zed|factory|mimo|<plugin>> <email> | magpie accounts switch <claude|codex> next | magpie accounts switch|forget copilot <login>[@<name>.ghe.com] [--host <name>.ghe.com] | magpie accounts project <gemini|antigravity> <email> <gcp-project-id> | magpie accounts alias <agent|<plugin>> <email> [<name>|--clear] | magpie accounts switch-only <codex|claude> [on|off]"
|
||||
agentID := func(s string) (string, error) {
|
||||
switch strings.ToLower(s) {
|
||||
case "claude", "cc":
|
||||
@@ -190,9 +190,19 @@ func accountsCmd(args []string) error {
|
||||
login, _, _ := strings.Cut(args[3], "@")
|
||||
args[3] = provider.CopilotAccountName(login, h)
|
||||
}
|
||||
if args[3], err = accountNamed(id, args[3]); err != nil {
|
||||
over := false
|
||||
if args[1] == "switch" && strings.EqualFold(args[3], "next") {
|
||||
// the next account in order with room, or the one with the most
|
||||
// room left when every one is past its line
|
||||
if args[3], over, err = provider.NextInOrder(context.Background(), id); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if args[3], err = accountNamed(id, args[3]); err != nil {
|
||||
return err
|
||||
}
|
||||
if over {
|
||||
fmt.Println(muted.Render("every other account is past its line; " + args[3] + " has the most room left"))
|
||||
}
|
||||
if args[1] == "forget" {
|
||||
moved, err := agent.Reseat(func() error { return provider.ForgetLogin(id, args[3]) })
|
||||
if err != nil {
|
||||
|
||||
@@ -97,6 +97,7 @@ const usage = `magpie — one place to pick every agent's model
|
||||
magpie accounts discovery [on|off] read agents' sign-ins (default on; MAGPIE_NO_ACCOUNTS=1 disables too)
|
||||
magpie accounts import <codex|claude|antigravity|factory> <file>... [--yes] bring in accounts from other tools' files (Codex's auth.json, Cockpit Tools, CLIProxyAPI, Sub2API); the tool a ChatGPT or Claude file came from is signed out of it
|
||||
magpie accounts switch <agent> <email> sign the agent in to another of them
|
||||
magpie accounts switch <claude|codex> next to the next account in order with room, or the one with the most left
|
||||
magpie accounts refresh renew the saved ChatGPT and Claude sign-ins now (the gateway does it every 8 days)
|
||||
magpie accounts checkin WorkBuddy's daily check-in (签到) for each WorkBuddy account, now (Settings can do it daily)
|
||||
magpie accounts project <gemini|antigravity> <email> <project> the Google Cloud project a Google account's requests go to
|
||||
|
||||
@@ -32,7 +32,9 @@ package provider
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"math"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
@@ -202,8 +204,10 @@ func usedPast(q SubscriptionQuota, share float64, now time.Time) bool {
|
||||
// one it is on: the account magpie moved it off, once that has room again
|
||||
// (back); else, when the one it is on is spent, the first of its other
|
||||
// accounts that are on in magpie, in the order they were saved, whose
|
||||
// allowance is known and not spent. A saved Claude account not read yet is
|
||||
// read then (readSpare). ok is false when the agent should stay.
|
||||
// allowance is known and not spent, or, when every one is past its line
|
||||
// too, the one with the most room left (roomLeft). A saved Claude account
|
||||
// not read yet is read then (readSpare). ok is false when the agent should
|
||||
// stay.
|
||||
func NextLogin(ctx context.Context, agent string) (from, to string, back, ok bool) {
|
||||
if leftAlone(agent) {
|
||||
return "", "", false, false // magpie has no say in its sign-in, or was told to leave it be
|
||||
@@ -282,6 +286,13 @@ func NextLogin(ctx context.Context, agent string) (from, to string, back, ok boo
|
||||
for user, q := range someLoginUsage(ctx, agent, users...) {
|
||||
u[user] = q
|
||||
}
|
||||
// every spare past its line too: the one with the most room left, when
|
||||
// it has more than the one it is on by roomMargin, so that the agent
|
||||
// isn't moved to and fro between two all but even; else it stays
|
||||
best, most := "", math.Inf(-1)
|
||||
if !q.Held {
|
||||
most = roomLeft(q, share, AccountCapsOf(agent, from), now) + roomMargin
|
||||
}
|
||||
for _, l := range spares {
|
||||
q, known := u[l.User]
|
||||
if agent == "claude" && (!known || unreadSpare(q)) {
|
||||
@@ -290,13 +301,98 @@ func NextLogin(ctx context.Context, agent string) (from, to string, back, ok boo
|
||||
// a time and only till one has room
|
||||
q, known = readSpare(ctx, l)
|
||||
}
|
||||
if known && q.Error == "" && !q.Held && !usedPast(q, share, now) && !capped(l.User, q) {
|
||||
if !known || q.Error != "" || q.Held {
|
||||
continue
|
||||
}
|
||||
if !usedPast(q, share, now) && !capped(l.User, q) {
|
||||
return from, l.User, false, true
|
||||
}
|
||||
if r := roomLeft(q, share, AccountCapsOf(agent, l.User), now); r > most {
|
||||
best, most = l.User, r
|
||||
}
|
||||
}
|
||||
if best != "" {
|
||||
return from, best, false, true
|
||||
}
|
||||
return "", "", false, false
|
||||
}
|
||||
|
||||
// roomMargin is how much more room (roomLeft) an account past its line
|
||||
// needs than the one the agent is on, past its line too, to be moved to.
|
||||
const roomMargin = 1
|
||||
|
||||
// roomLeft is how far the fullest of q's windows that stop the account for
|
||||
// every model is below the line it is moved off at: its own usage cap
|
||||
// (account_caps.go) when that is lower, else share. Below zero when it is
|
||||
// past the line; a window renewed since it was read, or none, leaves the
|
||||
// whole line.
|
||||
func roomLeft(q SubscriptionQuota, share float64, caps WindowCaps, now time.Time) float64 {
|
||||
room := share
|
||||
for _, w := range q.Windows {
|
||||
if w.Aside || w.Model != "" || w.Unlimited || resetPassed(w, now) {
|
||||
continue
|
||||
}
|
||||
line := share
|
||||
if c, _ := caps.Of(w.Name); c > 0 && float64(c) < line {
|
||||
line = float64(c)
|
||||
}
|
||||
room = min(room, line-w.Used)
|
||||
}
|
||||
return room
|
||||
}
|
||||
|
||||
// NextInOrder is the account `magpie accounts switch <agent> next` signs
|
||||
// agent in to: of its other accounts that are on in magpie, taken in their
|
||||
// order from the one after the account it is on, the first whose allowance
|
||||
// is known and has room; when none has, the one with the most room left
|
||||
// (roomLeft), and over says so. A saved Claude account not read yet is read
|
||||
// then, as NextLogin's spares are.
|
||||
func NextInOrder(ctx context.Context, agent string) (to string, over bool, err error) {
|
||||
if !slices.Contains(loginAgents, agent) {
|
||||
return "", false, fmt.Errorf("next switches Claude Code's and Codex's accounts; name the %s account to switch to", agent)
|
||||
}
|
||||
ls := Logins(agent)
|
||||
at := slices.IndexFunc(ls, func(l Login) bool { return l.Active })
|
||||
var order []Login
|
||||
for i := range ls {
|
||||
l := ls[(at+1+i)%len(ls)]
|
||||
if !l.Active && l.On && l.Lapsed == "" && l.home == "" && !l.Token {
|
||||
order = append(order, l)
|
||||
}
|
||||
}
|
||||
if len(order) == 0 {
|
||||
return "", false, fmt.Errorf("%s has no other account that is on in magpie to switch to", agent)
|
||||
}
|
||||
users := make([]string, 0, len(order))
|
||||
for _, l := range order {
|
||||
users = append(users, l.User)
|
||||
}
|
||||
share, _ := loginSwitching(agent)
|
||||
u := someLoginUsage(ctx, agent, users...)
|
||||
now := time.Now()
|
||||
best, most := "", math.Inf(-1)
|
||||
for _, l := range order {
|
||||
q, known := u[l.User]
|
||||
if agent == "claude" && (!known || unreadSpare(q)) {
|
||||
q, known = readSpare(ctx, l)
|
||||
}
|
||||
if !known || q.Error != "" || q.Held {
|
||||
continue
|
||||
}
|
||||
caps := AccountCapsOf(agent, l.User)
|
||||
if !usedPast(q, share, now) && !capReached(q, caps, now) {
|
||||
return l.User, false, nil
|
||||
}
|
||||
if r := roomLeft(q, share, caps, now); r > most {
|
||||
best, most = l.User, r
|
||||
}
|
||||
}
|
||||
if best == "" {
|
||||
return "", false, fmt.Errorf("magpie has no reading of %s's other accounts' usage: name the one to switch to (magpie accounts switch %s <email>)", agent, agent)
|
||||
}
|
||||
return best, true, nil
|
||||
}
|
||||
|
||||
// unreadSpare says q, a saved Claude account's reading, has nothing to go
|
||||
// by: never read (a /usage not run), or a read that failed for a reason
|
||||
// not the account's own. Its /usage is then run (readSpare).
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"slices"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
// threeAccounts signs agent in to three accounts in a sandbox HOME, all on
|
||||
// in magpie, and answers them as `next` takes them: the two the agent
|
||||
// isn't on, from the one after the account it is on in their order,
|
||||
// wrapping round, then that account.
|
||||
func threeAccounts(t *testing.T, agent string) []string {
|
||||
t.Helper()
|
||||
if agent == "codex" {
|
||||
home := signIn(t) // me@example.com
|
||||
rememberLogins(true)
|
||||
codexSignIn(t, home, "work@example.com", "r-work")
|
||||
rememberLogins(true)
|
||||
codexSignIn(t, home, "third@example.com", "r-third")
|
||||
rememberLogins(true)
|
||||
} else {
|
||||
claudeThree(t)
|
||||
}
|
||||
ls := Logins(agent)
|
||||
at := slices.IndexFunc(ls, func(l Login) bool { return l.Active })
|
||||
if len(ls) != 3 || at < 0 {
|
||||
t.Fatalf("not three accounts, one signed in: %+v", ls)
|
||||
}
|
||||
if at == 2 {
|
||||
t.Fatalf("the one signed in is the last, so nothing wraps round: %+v", ls)
|
||||
}
|
||||
var users []string
|
||||
for i := range ls {
|
||||
l := ls[(at+1+i)%3]
|
||||
if err := SetLoginOn(agent, l.User, true); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
users = append(users, l.User)
|
||||
}
|
||||
return users
|
||||
}
|
||||
|
||||
func usedAt(agent string, used map[string]float64) func(context.Context, string) map[string]SubscriptionQuota {
|
||||
at := time.Now().Add(time.Hour)
|
||||
return func(context.Context, string) map[string]SubscriptionQuota {
|
||||
out := map[string]SubscriptionQuota{}
|
||||
for u, v := range used {
|
||||
out[u] = SubscriptionQuota{Provider: agent, User: u, Windows: []QuotaWindow{
|
||||
{Name: "5 hours", Used: v, ResetsAt: &at, Span: 5 * time.Hour},
|
||||
{Name: "Fable", Used: 100, Model: "fable", ResetsAt: &at}, // one model's own: never counted
|
||||
}}
|
||||
}
|
||||
return out
|
||||
}
|
||||
}
|
||||
|
||||
// StringKe (#4532): when the account the agent is on is spent and every
|
||||
// other is past its line too, the switch moves to the one with the most
|
||||
// room left, as cswap does, and stays when none has more than the one it
|
||||
// is on by roomMargin. Codex shares the switch, so it is held to it too.
|
||||
func TestNextLoginTakesTheMostRoomWhenAllArePast(t *testing.T) {
|
||||
for _, agent := range []string{"codex", "claude"} {
|
||||
t.Run(agent, func(t *testing.T) {
|
||||
u := threeAccounts(t, agent)
|
||||
on := u[2]
|
||||
t.Cleanup(func() { LoginUsageVia(nil) })
|
||||
for _, c := range []struct {
|
||||
name string
|
||||
used []float64 // u[0], u[1], on
|
||||
to string
|
||||
}{
|
||||
{"the first has room", []float64{50, 99, 100}, u[0]},
|
||||
{"the second has the most room", []float64{99.5, 98.5, 100}, u[1]},
|
||||
{"the first has the most room", []float64{98.2, 99.9, 100}, u[0]},
|
||||
{"none has more by the margin", []float64{99.5, 99.5, 100}, ""},
|
||||
{"the one it is on has the most", []float64{100, 100, 99}, ""},
|
||||
} {
|
||||
LoginUsageVia(usedAt(agent, map[string]float64{u[0]: c.used[0], u[1]: c.used[1], on: c.used[2]}))
|
||||
from, to, back, ok := NextLogin(context.Background(), agent)
|
||||
if c.to == "" {
|
||||
if ok {
|
||||
t.Errorf("%s: moved %q→%q, want it to stay", c.name, from, to)
|
||||
}
|
||||
continue
|
||||
}
|
||||
if !ok || back || from != on || to != c.to {
|
||||
t.Errorf("%s: got %q→%q back=%v ok=%v, want %q→%q", c.name, from, to, back, ok, on, c.to)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// `magpie accounts switch <agent> next` takes the accounts in order from
|
||||
// the one after the account the agent is on, wrapping round: the first
|
||||
// with room, else the one with the most room left, said to be past its
|
||||
// line; one off in magpie is never taken.
|
||||
func TestNextInOrder(t *testing.T) {
|
||||
for _, agent := range []string{"codex", "claude"} {
|
||||
t.Run(agent, func(t *testing.T) {
|
||||
u := threeAccounts(t, agent)
|
||||
on := u[2]
|
||||
t.Cleanup(func() { LoginUsageVia(nil) })
|
||||
for _, c := range []struct {
|
||||
name string
|
||||
used []float64
|
||||
off int // 1-based index of an account turned off, 0 none
|
||||
to string
|
||||
over bool
|
||||
}{
|
||||
{"the one after it", []float64{10, 10, 10}, 0, u[0], false},
|
||||
{"the first spent, the second has room", []float64{99, 10, 10}, 0, u[1], false},
|
||||
{"every one past, the second has the most", []float64{99.5, 98.5, 10}, 0, u[1], true},
|
||||
{"every one past, the first has the most", []float64{98.5, 100, 10}, 0, u[0], true},
|
||||
{"the first off", []float64{10, 10, 10}, 1, u[1], false},
|
||||
} {
|
||||
LoginUsageVia(usedAt(agent, map[string]float64{u[0]: c.used[0], u[1]: c.used[1], on: c.used[2]}))
|
||||
if c.off > 0 {
|
||||
if err := SetLoginOn(agent, u[c.off-1], false); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
to, over, err := NextInOrder(context.Background(), agent)
|
||||
if err != nil || !strings.EqualFold(to, c.to) || over != c.over {
|
||||
t.Errorf("%s: got %q over=%v err=%v, want %q over=%v", c.name, to, over, err, c.to, c.over)
|
||||
}
|
||||
if c.off > 0 {
|
||||
if err := SetLoginOn(agent, u[c.off-1], true); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
// none read: magpie says so rather than guess
|
||||
LoginUsageVia(func(context.Context, string) map[string]SubscriptionQuota { return map[string]SubscriptionQuota{} })
|
||||
if to, _, err := NextInOrder(context.Background(), agent); err == nil {
|
||||
t.Errorf("no readings: got %q, want an error", to)
|
||||
}
|
||||
})
|
||||
}
|
||||
if _, _, err := NextInOrder(context.Background(), "gemini"); err == nil {
|
||||
t.Error("next for Gemini CLI: want an error")
|
||||
}
|
||||
}
|
||||
@@ -258,6 +258,7 @@ magpie claude group/opus-anywhere <span class="c"># これを使う</span></p
|
||||
<tr><td><code>magpie presets</code></td><td>magpie が知っているベンダー</td></tr>
|
||||
<tr><td><code>magpie provider add deepseek sk-…</code></td><td>プリセットをキー付きで追加</td></tr>
|
||||
<tr><td><code>magpie accounts add codex</code></td><td>Claude または ChatGPT のサブスクリプションをもう 1 つサインイン</td></tr>
|
||||
<tr><td><code>magpie accounts switch claude next</code></td><td>Claude Code(または <code>codex</code>)を、まだ余裕のある次のアカウントに切り替え。どれも上限近くなら、残りが最も多いアカウントへ</td></tr>
|
||||
<tr><td><code>magpie accounts discovery off</code></td><td>エージェントのサインイン(Claude Code と Codex のファイル、キーチェーン)を読み取らない。<code>on</code> で再び読み取る</td></tr>
|
||||
<tr><td><code>magpie providers</code></td><td>プロバイダ一覧:ホスト、キー、モデル、使っているエージェント</td></tr>
|
||||
<tr><td><code>magpie models</code></td><td>エージェントが選べるすべてのモデル(<code>provider/model</code> 形式)</td></tr>
|
||||
|
||||
@@ -258,6 +258,7 @@ magpie claude group/opus-anywhere <span class="c"># use it</span></pre>
|
||||
<tr><td><code>magpie presets</code></td><td>The vendors magpie knows</td></tr>
|
||||
<tr><td><code>magpie provider add deepseek sk-…</code></td><td>Add a preset with its key</td></tr>
|
||||
<tr><td><code>magpie accounts add codex</code></td><td>Sign in to one more Claude or ChatGPT subscription</td></tr>
|
||||
<tr><td><code>magpie accounts switch claude next</code></td><td>Sign Claude Code (or <code>codex</code>) in to the next of your accounts that has room, or the one with the most left when none has</td></tr>
|
||||
<tr><td><code>magpie accounts discovery off</code></td><td>Never read your agents’ sign-ins (Claude Code’s and Codex’s files, the Keychain); <code>on</code> reads them again</td></tr>
|
||||
<tr><td><code>magpie providers</code></td><td>Your providers: host, key, models, who uses them</td></tr>
|
||||
<tr><td><code>magpie models</code></td><td>Every model agents can pick, as <code>provider/model</code></td></tr>
|
||||
|
||||
@@ -258,6 +258,7 @@ magpie claude group/opus-anywhere <span class="c"># 使用它</span></pre>
|
||||
<tr><td><code>magpie presets</code></td><td>magpie 内置的厂商预设</td></tr>
|
||||
<tr><td><code>magpie provider add deepseek sk-…</code></td><td>用密钥添加一个预设</td></tr>
|
||||
<tr><td><code>magpie accounts add codex</code></td><td>再登录一个 Claude 或 ChatGPT 订阅</td></tr>
|
||||
<tr><td><code>magpie accounts switch claude next</code></td><td>把 Claude Code(或 <code>codex</code>)切到下一个还有额度的账号;都已过切换线时,切到剩得最多的那个</td></tr>
|
||||
<tr><td><code>magpie accounts discovery off</code></td><td>不读取智能体的登录信息(Claude Code 和 Codex 的文件、钥匙串);<code>on</code> 重新读取</td></tr>
|
||||
<tr><td><code>magpie providers</code></td><td>你的供应商:地址、密钥、模型、谁在用</td></tr>
|
||||
<tr><td><code>magpie models</code></td><td>Agent 能选的所有模型,写作 <code>provider/model</code></td></tr>
|
||||
|
||||
Reference in New Issue
Block a user