Skip to content

feat: multi-profile support with per-project credentials#50

Merged
SachaMorard merged 1 commit intomainfrom
feat/multi-profile
Apr 8, 2026
Merged

feat: multi-profile support with per-project credentials#50
SachaMorard merged 1 commit intomainfrom
feat/multi-profile

Conversation

@SachaMorard
Copy link
Copy Markdown
Member

@SachaMorard SachaMorard commented Apr 8, 2026

Summary

  • Named profiles stored in ~/.config/edgee/credentials.toml under [profiles.<name>] TOML tables (v4 format); existing v1/v2/v3 files migrate transparently to profiles.default
  • Per-project credentials: if .edgee/credentials.toml exists in the current directory it takes precedence over the global file, enabling repo-level isolation
  • Profile resolution order: --profile flag → active_profile in the effective credentials file → "default"
  • URL overrides per profile: console_url, console_api_url, gateway_url fields inside each profile node let a dev profile point at local servers independently of other profiles

New commands:

  • edgee auth list — list all profiles, active one marked with *
  • edgee auth switch [<name>] — switch global active profile; opens an interactive TUI selector when <name> is omitted

Updated commands:

  • edgee auth login [--profile <name>] — authenticates into the named profile slot
  • edgee auth status — now shows the active profile name
  • All commands accept a global -p / --profile flag

Test plan

  • cargo test passes (9 tests)
  • edgee auth login migrates an existing v3 credentials file to v4 transparently
  • edgee auth login --profile work creates a second profile alongside default
  • edgee auth list shows both profiles with * on the active one
  • edgee auth switch (no arg) opens interactive selector
  • edgee auth switch work switches and persists active_profile = "work"
  • edgee --profile work launch claude uses the work profile for the session
  • Placing .edgee/credentials.toml in a project dir causes all commands run there to use that file
  • console_url / console_api_url / gateway_url in a profile override the corresponding endpoints

🤖 Generated with Claude Code

Adds named profile management so users can maintain separate Edgee
sessions (e.g. personal vs. work org) and switch between them.

Credentials file is bumped to v4 with `[profiles.<name>]` TOML tables;
existing v1/v2/v3 files are migrated transparently to `profiles.default`.

Profile resolution order (highest to lowest):
  1. `--profile` flag / `EDGEE_PROFILE` env var
  2. `active_profile` in the effective credentials file
  3. Fallback: "default"

Local project credentials: if `.edgee/credentials.toml` exists in the
current directory it is used instead of the global file, enabling
per-repo credential isolation without touching global config.

URL overrides (`console_url`, `console_api_url`, `gateway_url`) are now
per-profile fields, letting a dev profile point at local servers while
a production profile uses the real endpoints.

New commands:
  edgee auth list             — list all profiles (active one marked *)
  edgee auth switch [<name>]  — switch global active profile, with
                                interactive TUI selector when name is omitted

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@SachaMorard SachaMorard requested a review from a team as a code owner April 8, 2026 04:56
@SachaMorard SachaMorard mentioned this pull request Apr 8, 2026
@CLEMENTINATOR
Copy link
Copy Markdown
Member

CLEMENTINATOR commented Apr 8, 2026

small idea, why not store the url directly within a profile ?

so we dont have to swithc profiles and env vars

CLEMENTINATOR

This comment was marked as outdated.

CLEMENTINATOR

This comment was marked as outdated.

Copy link
Copy Markdown
Member

@CLEMENTINATOR CLEMENTINATOR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm otherwise

@CLEMENTINATOR CLEMENTINATOR dismissed their stale review April 8, 2026 05:13

error on my part sorry

@SachaMorard
Copy link
Copy Markdown
Member Author

small idea, why not store the url directly within a profile ?

so we dont have to swithc profiles and env vars

Is it not what you expect here? https://github.com/edgee-ai/edgee/pull/50/changes#diff-2080f14271bdf5a9a6db4a6fda702edf6f59fda4b73d7d08ab93468a63fdb1b3R23-R24

@SachaMorard SachaMorard merged commit 68c8f6e into main Apr 8, 2026
4 checks passed
@SachaMorard SachaMorard deleted the feat/multi-profile branch April 8, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants