Skip to content

squads auth login --instance — wrangler-style instance auth; the door for devs AND their code agents #874

@kokevidaurre

Description

@kokevidaurre

Founder direction 2026-06-12 (completes the three-door architecture on hq#418): technical users command the platform from their favorite code agent (Claude Code, Codex, OpenCode, Gemini). Their door is the CLI + MCP — authenticated like wrangler/gws.

Design

  • squads auth login [--instance <url>]: OAuth browser/device-code flow against the instance's auth (ws1: api#102 sessions/roles; machine plane = OAuth client-credentials per the identity memo on hq#458). Token cached per-instance in ~/.squads (extend the existing named-environment config: squads config use <env> already exists; instances become environments).
  • squads auth whoami/logout per instance. Existing cloud-pointed /auth/cli + /auth/cli/verify flows in squads-api are the starting scaffold — generalize to instance-scoped.
  • Code agents inherit the human's identity: anything driving the CLI (shell) or squads mcp serve (squads mcp serve — MCP server exposing the platform to code agents (Claude Code, OpenCode, Cursor) #871) operates as the logged-in principal — role+scopes enforced API-side, every action audited as that user. No agent-special credentials for interactive use; unattended automation graduates to a scoped service client (OAuth-CC, admin-issued).
  • Premium endpoints = plan-gating by principal at the API (tier_definitions exists) — not separate URLs.

Why this shape

One identity model serves all three doors (web Chief, CLI human, code agent) — privilege separation and audit stay coherent, and the dev-funnel pitch becomes: "log in once; your code agent now runs your company's platform."

Sequencing: post-Stage-A with #871 (same identity work feeds both). Part of hq#458 / hq#418.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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