feat(sdk): add band-register-agent command bundling register-agent.sh#367
Draft
nir-singher-band wants to merge 1 commit into
Draft
feat(sdk): add band-register-agent command bundling register-agent.sh#367nir-singher-band wants to merge 1 commit into
nir-singher-band wants to merge 1 commit into
Conversation
Share the agent-registration setup script across integration repos by shipping it inside the SDK as the `band-register-agent` console entry point, instead of vendoring or curl|bash. Consumers pin the script by pinning band-sdk, so it can't drift from the API version installed. The shell script is bundled verbatim as package data; a thin Python wrapper resolves it via importlib.resources and runs it with bash, mirroring its exit code. An optional positional API key populates BAND_USER_API_KEY for the script; omitting it falls back to the env var (preferred, keeps the key out of the process list). The script's own argv-free key handling is unchanged. ✌️
12ca0b5 to
05717ad
Compare
Collaborator
Author
|
Heads-up: a downstream consumer is waiting on this command.
When this lands + publishes, please ping so we can: bump the plugin's |
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
Share the agent-registration setup script across integration repos by shipping it inside the SDK as the
band-register-agentconsole entry point — instead of vendoring it or pipingcurl | bash. Because the script now rides along withband-sdk, consumers pin it by pinning the SDK version, so it can't drift from the API version they install. Sharing collapses to:uv add band-sdkthenband-register-agent.This mirrors the existing
band-acp/band-triggerentry-point pattern.Changes
band-register-agentconsole entry point (band.cli.register_agent:main) inpyproject.toml.register-agent.shverbatim as package data ([tool.setuptools.package-data] "band.cli" = ["*.sh"]).src/band/cli/register_agent.py) resolves the script viaimportlib.resourcesand runs it withbash, mirroring its exit code (127 ifbashis missing). stdout is passed through so the output stayseval-able.api_keypopulatesBAND_USER_API_KEYfor the script; omitting it falls back to the env var. The bundled script's own argv-free key handling is unchanged.tests/cli/test_register_agent.py.Related Issues
None.
Testing
uv run pytest tests/ --ignore=tests/integration/ --ignore=tests/e2e/) — 7 new tests added. Full suite green except pre-existing, unrelated failures: Codex-ACP@pytest.mark.e2etests that spawnnpx @zed-industries/codex-acp, and live-credentialtests/integration/tests.ruff check,ruff format --check, andpyrefly checkall clean.Additional verification:
band/cli/register-agent.shis bundled in the artifact (the real proof that "bundle as is" survives distribution).band-register-agent --helpworks; a no-key run exits 1 via the script's ownBAND_USER_API_KEYguard.Reviewer notes
$BAND_USER_API_KEY(neverargv) so it never appears inps. The optional CLI arg is a convenience implemented in the wrapper — when used, the key is visible in the wrapper's process list. The env var stays the documented default, and--helpspells out the tradeoff. The.shitself is unchanged, so its stdin-only handling is preserved on the env path.Checklist
band-register-agentinCLAUDE.mdalongsideband-acp/band-trigger.✌️