Skip to content

Surface persisted org identity (whoami, agent-context, repo references) #200

@AlephNotation

Description

@AlephNotation

PR #199 persists org_name and org_id from the login/signup API response into ~/.versrc. This unblocks three small follow-ups that surface identity in places where it's currently invisible.

Today

After login, the CLI prints the org name in the success banner once, then forgets it. There's no way to ask the CLI "what org am I in?" without re-running login or hitting the API.

vers repo get pi-agent returns:

{
  "name": "pi-agent",
  "is_public": true,
  "repo_id": "...",
  ...
}

But vers repo fork requires <org>/<repo>:<tag> form. So as the author of a public repo you can't easily look up your own canonical reference without consulting the public discovery endpoint (which uses a different SDK type, PublicRepositoryInfo, that does include org_name).

Target

Three related changes, any of which is a tiny PR on its own.

1. vers whoami (new command)

$ vers whoami
org:   acme
email: alice@example.com

$ vers whoami --json
{
  "org_name": "acme",
  "org_id": "...",
  "email": "alice@example.com"
}

Pure local read from ~/.versrc — no API call. Single source of truth for "who am I as far as this CLI is concerned." Useful for agents that need to compose references.

2. cli.org_name in vers agent-context

{
  "schema_version": "1",
  "cli": {
    "name": "vers",
    "version": "v0.11.2",
    "description": "...",
    "org_name": "acme",
    "org_id": "..."
  },
  ...
}

So introspecting agents can build canonical references without an additional whoami call. Sister of issue #193 (which tracks feedback/jobs blocks specifically).

3. full_name synthesized in vers repo get

{
  "name": "pi-agent",
  "full_name": "acme/pi-agent",
  "is_public": true,
  ...
}

Composed client-side from the persisted org_name. Only emit full_name when is_public: true (private repos have no public reference). When org_name isn't persisted yet (e.g., old config), omit the field gracefully.

Same shape could apply to vers repo tag get ("reference": "acme/pi-agent:latest").

Out of scope

  • Upstream fix to include org_name directly in RepositoryInfo — that's the cleaner long-term answer (no client-side synthesis needed), but requires API work. Worth filing on vers-api / chelsea separately.
  • Profile system ((DRAFT) Added Custom Rootfs Support #16-style multi-org switching) — that's its own design conversation.

Why now

PR #199 just landed the storage. None of the three above is more than ~50 LOC. Could ship as one PR or three; one is fine since they share a theme.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions