Add autonomous credential login - #74
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a headless “credential login” path to the put.io CLI (auth login --from-env) intended for unattended, authorized profiles. It introduces local RFC 6238 TOTP generation, loads a redacted credential bundle from five PUTIO_CLI_LOGIN_* environment variables, and updates CLI metadata/docs/consumer skill guidance accordingly.
Changes:
- Add
auth login --from-envflow that requires--profile, rejects device-only flags, performs SDK credential login + TOTP verification, and persists only the OAuth token. - Introduce an internal TOTP generator (
src/internal/totp.ts) with RFC 6238 SHA-1 vector tests. - Extend CLI metadata, i18n terminal rendering, and consumer-facing docs/skill prompts to reflect the new automation-friendly login option.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test-support/command-path-mocks.ts | Extends command-path mocks to cover credential login + TOTP generation. |
| src/internal/totp.ts | Adds local RFC 6238 TOTP generation implementation. |
| src/internal/totp.test.ts | Adds unit tests covering RFC vectors, invalid secrets, and grouped secrets. |
| src/internal/terminal/auth-terminal.ts | Extends login success terminal output with an auth “method” field. |
| src/internal/terminal/auth-terminal.test.ts | Updates terminal rendering test to assert the new “method” line. |
| src/internal/metadata.ts | Exposes the five credential-login env var names in describe metadata. |
| src/internal/metadata.test.ts | Validates auth login flag metadata and credential env mapping in tests. |
| src/internal/env.ts | Defines ENV_CLI_LOGIN_* constants for credential login env vars. |
| src/internal/config.ts | Adds redacted credential auth config resolution via resolveCliCredentialAuthConfig. |
| src/internal/config.test.ts | Adds tests for resolving credential config (redacted) and failing closed when incomplete. |
| src/i18n/catalog/en.ts | Adds i18n string for the login success “method” line. |
| src/commands/auth.ts | Implements auth login --from-env flow and wires it into command specs/output. |
| src/command-paths.test.ts | Adds command-path test coverage for credential login behavior and validation errors. |
| skills/putio-cli/SKILL.md | Narrows and updates consumer skill guidance, including the new headless login flow. |
| skills/putio-cli/references/auth.md | Updates auth reference docs to prefer --from-env for unattended credential payloads. |
| skills/putio-cli/agents/openai.yaml | Simplifies the agent default prompt to a minimal directive. |
| README.md | Documents unattended credential login usage and the new recommended headless flow. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
## [1.7.0](v1.6.4...v1.7.0) (2026-08-26) ### Features * add autonomous credential login ([#74](#74)) ([5fd5415](5fd5415))
|
🎉 This PR is included in version 1.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5c1585299
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Adds a headless credential flow for authorized unattended profiles.
PUTIO_CLI_LOGIN_*environment values behindauth login --from-envVerified with
pnpm exec vp run verify: 34 files and 352 tests pass.