Multiple accounts via suffixed env vars - #4
Merged
Conversation
thepeak99
force-pushed
the
feat/multi-account
branch
from
July 9, 2026 07:40
c1e2c27 to
2f2e37a
Compare
Configure several accounts at once with MAILCLI_*_<N> env vars and select
one per invocation with a global --account flag. Omitting --account uses
the bare, un-suffixed vars (the "default" account), so existing setups are
unchanged.
- config.rs: Env{suffix} resolver (name-building at the boundary), strict
no-fallback reads, from_env(&Env). Add scan_accounts()/AccountInfo for
discovery (never exposes the password value).
- main.rs: global --account flag (flag > MAILCLI_ACCOUNT env > default),
new `accounts` subcommand; thread &Env into connecting commands.
- output.rs: accounts_human table (ok/incomplete status, no secrets).
- Docs: README "Multiple accounts" section + accounts cmd; AGENTS.md rule.
- Skill: SKILL.md + reference.md (AccountInfo schema) + 2 new evals;
install-skill output verified byte-identical to skill/.
- plans/: local git-ignored dir for working design docs (kept in the repo
by its own tracked .gitignore); the ACCOUNTS-PLAN doc lives here.
Tests: +11 config unit tests (name resolution, empty-token reject,
suffixed-error naming, scanner + no-leak + sort). 45 tests pass; clippy
-D warnings clean; fmt clean.
Co-authored by PeakBot!
thepeak99
force-pushed
the
feat/multi-account
branch
from
July 9, 2026 07:42
2f2e37a to
edd72d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds multiple-account support to
mail-cli, staying fully env-only and stateless. Each account is a set ofMAILCLI_*env vars sharing a suffix (_1,_2, …); a single run targets one account.Design
--account <TOKEN>(global flag) >MAILCLI_ACCOUNTenv > none.--account→ the default account = the bare, un-suffixed vars → zero breakage for existing setups.*_N; a miss fails naming the exact var (e.g.required environment variable MAILCLI_PASSWORD_2 is not set).config.rs.Changes
config.rs—Env { suffix }resolver (name-building at the boundary) +from_env(&Env);scan_accounts()/AccountInfofor discovery (emitshas_passwordpresence only, never the value).main.rs— global--accountflag; newaccountssubcommand;&Envthreaded into connecting commands.install-skilluntouched.output.rs—accounts_humantable (ok/incomplete, no secrets).accounts; AGENTS.md security rule.SKILL.md+references/reference.md(AccountInfoschema) + 2 new evals; verifiedinstall-skill --forceoutput is byte-identical toskill/.ACCOUNTS-PLAN.md— locked design doc (mirrors the repo's plan-doc convention).Tests / CI
config.rsunit tests: name resolution, empty-token reject, suffixed-error naming, scanner (default+numeric, incomplete-no-leak, sort order, empty-value skip).cargo fmt --all -- --check,cargo clippy --all-targets --locked -- -D warnings,cargo test --locked— all green.Co-authored by PeakBot!