Skip to content

feat(login): reuse the last org and add --org - #243

Merged
finalerock44 merged 3 commits into
devfrom
feat/login-last-org
Oct 21, 2026
Merged

finalerock44 merged 3 commits into
devfrom
feat/login-last-org

Conversation

@finalerock44

Copy link
Copy Markdown
Contributor

dcd login no longer hangs where nobody can answer a prompt, such as a script, CI, or a shell an agent runs.

  • The org picker starts on the org from the last login, so Enter keeps it.
  • Without a TTY, the last login's org is used and one line says so. With no last org, or one that is gone, login fails with an error that names --org and lists the available orgs.
  • --org <name|id> picks the org without the picker, and fails if the user isn't a member.
  • Without a TTY, the "already logged in" confirm takes its default and signs in again. The old session stays until the new login succeeds.
  • The last org only counts when the last login was to the same API, because org ids differ between environments.
  • A bare dcd switch-org without a TTY now fails with the org names instead of hanging the same way.

Closes #241

What & why

Type of change

  • fix — bug fix
  • feat — new feature
  • perf — performance improvement
  • refactor — code change that's neither a fix nor a feature
  • docs — documentation only
  • chore / ci / build / test — tooling, no user-facing change
  • Breaking change (title has ! or PR notes a BREAKING CHANGE:)

Checklist

  • PR title follows the Conventional Commits format (see comment above)
  • pnpm lint passes
  • pnpm typecheck passes
  • pnpm build passes
  • I have not bumped the version or edited CHANGELOG.md (release-please handles this)
  • I have signed the CLA (the bot will prompt on first contribution)
  • Docs / README.md / STYLE_GUIDE.md updated if behaviour or output changed

How to test

dcd login no longer hangs where nobody can answer a prompt, such as a
script, CI, or a shell an agent runs.

- The org picker starts on the org from the last login, so Enter keeps it.
- Without a TTY, the last login's org is used and one line says so. With
  no last org, or one that is gone, login fails with an error that names
  --org and lists the available orgs.
- --org <name|id> picks the org without the picker, and fails if the user
  isn't a member.
- Without a TTY, the "already logged in" confirm takes its default and
  signs in again. The old session stays until the new login succeeds.
- The last org only counts when the last login was to the same API,
  because org ids differ between environments.
- A bare dcd switch-org without a TTY now fails with the org names instead
  of hanging the same way.

Closes #241
@finalerock44 finalerock44 self-assigned this Oct 21, 2026
@claude

claude Bot commented Oct 21, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

finalerock44 and others added 2 commits October 21, 2026 16:44
pnpm audit flagged GHSA-5r4p-p66f-jhc7 (moderate) on hono >=4.12.4
<4.13.11, which comes in through @modelcontextprotocol/sdk. In those
versions serveStatic decodes the request path twice. The advisory was
published on 2026-10-20, after dev's last green run, so the
lint-and-test audit step now fails on every branch. Dependabot opened an
alert but no fix PR, because the exact-pin override holds hono at
4.13.7.

4.13.11 is the lowest patched version, as with the earlier pins. The
audit passes apart from the advisory that was already ignored. Lint,
typecheck, unit tests and build pass, and dcd-mcp answers initialize
and tools/list over stdio with all five tools.
chore(deps): bump hono override to 4.13.11 to clear audit
@finalerock44
finalerock44 merged commit 5f710d5 into dev Oct 21, 2026
9 checks passed
@finalerock44
finalerock44 deleted the feat/login-last-org branch October 21, 2026 16:03
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.

dcd login: reuse the last selected org instead of always asking

1 participant