fix(version): metadata drift + agent-flag hardening (0.1.4)#7
Merged
Conversation
src/bcli/_version.py had a hardcoded `__version__ = "0.1.0"` that the
release process didn't bump alongside `pyproject.toml`. The 0.1.3
release shipped with `bcli --version` reporting "0.1.0" — the wheel
contents and entry-point logic were correct, only the version string
was stale.
Switch _version.py to read from importlib.metadata.version("bc-cli"),
which is the canonical Python-packaging single source of truth.
pyproject.toml's `version` field is now the only place release.sh
needs to coordinate with — no duplicate constant to forget.
Bump pyproject.toml to 0.1.4 so the next release ships with both the
fix and a correct self-reported version. (Republishing 0.1.3 isn't
possible on PyPI — versions are immutable once published.)
Verified locally: `from bcli._version import __version__; print(__version__)`
returns "0.1.4" after `uv tool install`.
Previous commit 3ce5ea8 bumped pyproject.toml to 0.1.4 but did not update uv.lock, so CI failed on `uv sync --locked` across all three Python versions.
Stops AI agents from generating bloated invocations like `bcli -c LLC get fixedAssets --publisher beautech --group finance --version v1.5 --all -f json` when `bcli -c LLC get fixedAssets` is enough. - Mark `--publisher`, `--group`, `--version` as `hidden=True` in get/post/patch/delete/attach commands. The flags still work as escape hatches for power users; they just don't appear in `--help`, so agents can't pattern-match them in. - Extend AGENTS.md "Profiles do most of the work" to cover the registry-resolved route, then add a "Don't write this" anti-recipe block with the literal bad command and minimal alternative, explaining why each flag was redundant (registry resolves publisher/group/version; `--all` paginates everything; `-f json` is auto-detected via CLAUDECODE=1).
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
__version__from package metadata sobcli --versionno longer drifts frompyproject.toml. Bumps to0.1.4.uv sync --lockedacross Python 3.11/3.12/3.13.--publisher,--group,--versionashidden=Trueonget/post/patch/delete/attach. They remain functional escape hatches for power users but disappear from--help, which stops AI agents from pattern-matching them into routine commands.--publisher/--group/--version,--all,-f json) is unnecessary — registry resolves the route,--allpaginates everything,-f jsonis auto-detected viaCLAUDECODE=1.Test plan
uv run pytest tests/ -v— 432 passed, 5 skipped locally.uv run bcli get --help— confirms--publisher/--group/--versionno longer listed.uv run bcli --dry-run get vendors --publisher x --group y --version v1.5 --top 1— confirms hidden flags still accept input (escape hatch preserved).