Skip to content

feat: OnepinClient() with credential auto-resolution#77

Merged
sbpodonos merged 2 commits into
mainfrom
sb/sdk-onepinclient
Jul 9, 2026
Merged

feat: OnepinClient() with credential auto-resolution#77
sbpodonos merged 2 commits into
mainfrom
sb/sdk-onepinclient

Conversation

@sbpodonos

Copy link
Copy Markdown
Contributor

What

  • OnepinClient() / AsyncOnepinClient() that resolve the API key from api_key=ONEPIN_API_KEY~/.onepin/credentials (written by onepin login). One onepin login now authenticates both the CLI and the SDK. The version-gate response hook is applied; OnepinAuthError is raised when no key is found. base_url resolves independently (argONEPIN_BASE_URL → file).
  • Hand-rolled (_client.py, _auth_resolve.py), preserved via .fernignore and re-exported from the package __init__; also wired into fern/generators.yml additional_init_exports so a future regen keeps them.
  • Reuses the CLI's tested resolver (onepin._cli.auth.resolver), which has no click/typer deps — import onepin stays lightweight.
  • Copy: "24 TTS models" everywhere (README, pyproject, bundled skill) — was "100+"/"30".

Tests

9 new unit tests (resolution chain + offline client construction). Full unit + CLI suite green.

Notes

  • The Fern-generated class stays OnePinClient; OnepinClient is an additive credential-resolving subclass, so this matches the public docs (from onepin import OnepinClient) without a regen rename. make_client() is unchanged.
  • After merge → release (release-please picks up the feat: as a minor bump).
  • Part of a coordinated launch across be / fe / sdk / docs. No users yet.

🤖 Generated with Claude Code

@sbpodonos sbpodonos requested a review from kj-podonos as a code owner July 9, 2026 00:08
sbpodonos and others added 2 commits July 8, 2026 17:11
Add hand-rolled OnepinClient / AsyncOnepinClient (preserved via
.fernignore, re-exported from the package __init__) that subclass the
Fern-generated clients and resolve the API key the same way the CLI
does — explicit api_key=, then ONEPIN_API_KEY, then ~/.onepin/credentials
(written by `onepin login`) — so one login authenticates both the CLI
and the SDK. The version-gate response hook is applied, matching
make_client; base_url resolves independently (arg > ONEPIN_BASE_URL >
file). Raises OnepinAuthError when no key is found anywhere.

Reuses the CLI's tested resolver (onepin._cli.auth.resolver), which has
no click/typer deps, so `import onepin` stays lightweight.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
README, pyproject description, and the bundled agent skill said
'100+'/'30'; the live catalog is 24 (Added + P1). One number everywhere.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sbpodonos sbpodonos force-pushed the sb/sdk-onepinclient branch from 17e3561 to 5b4ea6f Compare July 9, 2026 00:12
@sbpodonos sbpodonos merged commit 174685b into main Jul 9, 2026
22 checks passed
@sbpodonos sbpodonos deleted the sb/sdk-onepinclient branch July 9, 2026 01:19
kj-podonos added a commit that referenced this pull request Jul 9, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.9.0](v0.8.3...v0.9.0)
(2026-07-09)


### Features

* OnepinClient() with credential auto-resolution
([#77](#77))
([174685b](174685b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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