Add agent signup and improve config-resolution diagnostics#117
Open
const-cloudinary wants to merge 4 commits into
Open
Add agent signup and improve config-resolution diagnostics#117const-cloudinary wants to merge 4 commits into
agent signup and improve config-resolution diagnostics#117const-cloudinary wants to merge 4 commits into
Conversation
Add `cld agent signup <email> <framework> <model> <goal>`: creates a Free-plan account on behalf of a human, saves the returned environment as a named config, and detects duplicate signups locally and server-side. Make config resolution report the true state instead of a blanket "No configuration found": - Commands that own or need no config (login, logout, config, agent) no longer print the banner (config_optional decorator). - Saved configs but no default set -> "No default configuration is set". - An explicitly selected but credential-less config (-c/-C) -> "incomplete". - -c/--config validates its argument up front and points to -C when given a saved config name. - The unconfigured guidance prints clean (no "warning:" prefix) and lists `agent signup`; empty `config -ls` shows it instead of an empty table. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The group banner now prints to stderr (and is suppressed for `config`, which is config-optional), so bare `cld config` on the unconfigured path reports "No Cloudinary configuration found" via its own raised ConfigurationError rather than stdout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
TestUnconfiguredBanner stripped only CLOUDINARY_URL and built the fresh SDK config as a with-statement argument evaluated before the env was cleared, so a developer's exported CLOUDINARY_URL leaked in and the "unconfigured" assertions failed. Strip every CLOUDINARY_* and call reset_config inside the patched context, matching the other suites. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The module cloudinary_cli.core.agent and its exported Group both named
`agent`, so `from .agent import agent` shadowed the submodule on the core
package. On Python 3.10, mock.patch("cloudinary_cli.core.agent.<attr>")
resolved the dotted path to the Group object instead of the module and
raised AttributeError/ModuleNotFoundError at patch time. Rename the symbol
to `agent_group` (module and CLI name unchanged), matching the module-name
!= exported-symbol convention already used by config/auth.
Also patch cloudinary.provisioning.create_agent_account at its canonical
location rather than through the core.agent chain.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the
cld agent signupcommand: for AI agents, it creates a Free-plan Cloudinary account on behalf of a human, saves the returned product environment as a named config, and detects duplicate signups both locally (from saved configs) and server-side.Flags:
--name,--set-default,--no-save,--sdk-framework,--json. Credentials are inert until the human completes the emailed verification.Also improves config-resolution UX slightly: unconfigured/no-default/incomplete states now report the true situation with clearer guidance, and commands that need no config no longer print the "no configuration found" banner.
Docs
README: added
agent signupto the important-commands list and a dedicated section documenting syntax, example, and flags.Testing
pytest test/ --ignore=test/test_modules→ 332 passed, 21 skipped.test/test_modules/*collection error is pre-existing (those modules need real credentials at import) and unrelated to this change.Manual checks
Isolate the config dir and clear Cloudinary env first so nothing touches a real account:
🤖 Generated with Claude Code