Conversation
Implement `vws generate-vumark` command for generating VuMark instances from VuMark targets. The command accepts a target ID, instance ID, and output format (SVG/PNG/PDF), and writes the generated VuMark to a file. Includes comprehensive error handling for invalid instance IDs, quota limits, and missing targets, plus full test coverage and help text regression files. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Use VWS.generate_vumark_instance() instead of a separate VuMarkService, align the VuMarkAccept enum and exception names with the actual API (InvalidInstanceIdError, TargetStatusNotSuccessError), and update tests to use existing MockVWS fixtures rather than a hypothetical MockVuMarkWS. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| ), | ||
| } | ||
|
|
||
| return exc_type_to_message[type(exc)] |
There was a problem hiding this comment.
Unhandled VWS exceptions cause KeyError crash
Medium Severity
The _handle_vumark_exceptions context manager catches all VWSError subclasses, but _get_vumark_error_message only maps a small subset of exception types. Exceptions like ProjectInactiveError, ProjectSuspendedError, RequestQuotaReachedError, and ProjectHasNoAPIAccessError would be caught but have no entry in exc_type_to_message, causing a KeyError crash instead of a user-friendly error message. The existing _get_error_message in commands.py handles these cases.
Additional Locations (1)
| show_default=True, | ||
| ) | ||
|
|
||
| return click_option_function(command) |
There was a problem hiding this comment.
Duplicated _base_vws_url_option function across two files
Low Severity
_base_vws_url_option in vumark.py is an exact duplicate of the same function in commands.py (lines 119–130). Having two identical private copies risks them diverging when one is updated without the other. This could be extracted into a shared options module (similar to how server_access_key_option lives in vws_cli.options.credentials).


Summary
Adds a
vws generate-vumarkCLI command that wrapsVWS.generate_vumark_instance()from vws-python (VWS-Python/vws-python#2858). The command accepts a target ID, instance ID, and output format (PNG/SVG/PDF, defaulting to PNG), and writes the generated VuMark image bytes to a file.Error handling covers invalid instance IDs, targets not in the success state, unknown targets, and authentication failures. Tests use the existing
MockVWS/VuforiaDatabasefixtures and will pass once the vws-python PR is merged and the dependency is updated.🤖 Generated with Claude Code
Note
Medium Risk
Adds a new CLI surface that performs network calls and writes binary output to disk; risk is mainly around dependency/API behavior and error mapping, but existing commands remain unchanged.
Overview
Adds a new
vws generate-vumarkcommand that callsVWS.generate_vumark_instance()with--target-id,--instance-id,--format(png/svg/pdf, default png),--output, plus base URL and timeout options, and writes the returned bytes to a file.Introduces VuMark-specific exception handling to convert common API failures (unknown target, target not processed, invalid instance id, auth/request errors) into user-facing stderr messages with exit code 1, and updates CLI help snapshots and adds end-to-end tests covering formats, defaults, and failure cases.
Written by Cursor Bugbot for commit 6797d9a. This will update automatically on new commits. Configure here.