feat(cli): add generate-bindings command wrapping the Stellar code generator - #824
Closed
davidugorji wants to merge 1 commit into
Closed
feat(cli): add generate-bindings command wrapping the Stellar code generator#824davidugorji wants to merge 1 commit into
davidugorji wants to merge 1 commit into
Conversation
…nerator Adds a `bc-forge generate-bindings` command that drives `stellar contract bindings <language>` so binding generation is reachable from the project CLI with the configured network already applied. All seven generators the Stellar CLI exposes are supported: typescript, rust, python, java, flutter, swift and php. Option combinations are validated before spawning, so misuse is reported by this CLI rather than as an opaque subprocess failure: - exactly one contract source (--wasm, --wasm-hash or --contract-id) - --output-dir required for the generators that write a package - the rust generator accepts a local --wasm only, matching its actual flag surface, and is rejected early for network sources RPC flags are forwarded only when generating from the network, since a local wasm needs no node. The binary is resolved through STELLAR_CLI_BIN / SOROBAN_CLI_BIN to accommodate the soroban -> stellar rename, and a missing binary produces an install hint instead of a bare ENOENT. The command runner is injected so tests assert the argument vector without spawning a process. Verified end to end against Stellar CLI 25.2.0: typescript generation produced a package exposing the real contract methods, and the rust generator emitted a client module. Closes BCPathway#701
davidugorji
force-pushed
the
feat/701-cli-generate-bindings
branch
from
August 26, 2026 15:24
2b3ed71 to
91a30bc
Compare
|
@davidugorji Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
Author
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.
Implements the
generate-bindingsCLI utility.Wraps
stellar contract bindings <language>so binding generation is reachable from the project CLI with the configured network already applied. All seven generators are supported (typescript, rust, python, java, flutter, swift, php).Option combinations are validated before spawning, so misuse is reported by this CLI rather than as an opaque subprocess failure: exactly one contract source,
--output-dirwhere required, and the rust generator restricted to a local--wasmto match its actual flag surface. The binary resolves throughSTELLAR_CLI_BIN/SOROBAN_CLI_BINfor the soroban→stellar rename, and a missing binary yields an install hint instead of a bare ENOENT.Verification:
tscclean, 17/17 unit tests pass, and verified end-to-end against Stellar CLI 25.2.0 — typescript generation produced a package exposing the real contract methods, and the rust generator emitted a client module.Closes #701