Skip to content

fix: add --quiet to create-operator-key for scripting - #80

Merged
Sirajmx merged 1 commit into
IABTechLab:mainfrom
aleksUIX:fix/79-create-operator-key-quiet
Sep 15, 2026
Merged

Sirajmx merged 1 commit into
IABTechLab:mainfrom
aleksUIX:fix/79-create-operator-key-quiet

Conversation

@aleksUIX

Copy link
Copy Markdown
Contributor

Summary

Fixes #79. ad-seller create-operator-key had no machine-readable mode, so bootstrap scripts had to scrape the minted key out of the rich panel. ad-buyer create-operator-key already has --quiet / -q.

This adds the same flag: print only response.api_key and return before the panel. Stdout is flushed so the value survives command substitution.

KEY=$(ad-seller create-operator-key --label ci --quiet)

Default interactive output is unchanged.

Test plan

  • uv run --locked pytest tests/unit/test_operator_auth.py::TestCliBootstrap -q (7 passed)
  • uv run --locked ruff check / ruff format on the touched files

Mirror the buyer-agent flag so KEY=$(ad-seller create-operator-key --quiet)
prints only the minted key. Fixes IABTechLab#79.

@Sirajmx Sirajmx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: unit + integration passed (0 failed), merged onto current main. Small,
exactly matches the buyer-agent's existing --quiet pattern, default interactive output
unchanged. No conflicts merging onto main.

@atc964 atc964 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Thanks for turning this around so quickly.

Verified the implementation matches the buyer agent's --quiet behaviour: bare key
to stdout, flush=True so it survives command substitution, early return before the
panel, and the default interactive output untouched. The test asserting stdout is
exactly the key and stderr is empty is the right assertion for this.

Two non-blocking nits, neither worth holding the merge for:

  1. if quiet is True: can just be if quiet:.
  2. In docs/api/authentication.md the two commands now sit in one block and read as a
    sequence to run in order, which would mint two separate operator keys. Splitting
    them, or showing the --quiet form as an alternative rather than a follow-on, would
    read more clearly.

Happy for this to merge as-is.

@Sirajmx
Sirajmx merged commit 986a30c into IABTechLab:main Sep 15, 2026
5 checks passed
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.

CLI: add --quiet to create-operator-key, matching the buyer agent

3 participants