pitboard-core 0.14.0

The engine behind Pitboard: switches Claude Code, Codex and Claude Desktop between accounts by parking and restoring their logins. Its API serves Pitboard's own front ends.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Changing the label an account is enrolled under.

use super::{Result, Settled};
use crate::state::{self, Key};

/// Returns the account's email.
pub(crate) fn rename(settled: Settled, from: &Key, to: &str) -> Result<String> {
    let Settled {
        _exclusive,
        mut state,
        ctx,
        permit,
    } = settled;
    let email = state.relabel(from, to)?.email.clone();
    state::save(&ctx, permit, &state)?;
    Ok(email)
}