Skip to content

Migrate JS CLI to Kit plugins#62

Merged
lorisleiva merged 1 commit into
mainfrom
loris/update-js-client-cli
May 18, 2026
Merged

Migrate JS CLI to Kit plugins#62
lorisleiva merged 1 commit into
mainfrom
loris/update-js-client-cli

Conversation

@lorisleiva
Copy link
Copy Markdown
Member

This PR rebuilds the clients/js CLI on top of the Kit plugin client model introduced in the previous PR. getClient is now a flat .use(...) chain composing the standard payer/identity/solanaRpc/programMetadataProgram plugins together with two small CLI-local plugins (cliConfigs and cliRunOrExport), replacing the bespoke shim layer in cli/utils.ts and the createDefaultTransactionPlannerAndExecutor / getPdaDetails helpers that lived in internals.ts. Commands now consume client.identity (instead of a CLI-only client.authority alias) and call client.runOrExport(...) with an InstructionPlanInput directly, using client.programMetadata.instructions.* wrappers for single-instruction commands and the building-block getXMetadataInstructionPlan functions for the one-shots so the --export flow can plan-then-branch. The ad-hoc compute-unit-limit stripping helper used during export is replaced with the version-agnostic setTransactionMessageComputeUnitLimit(undefined, m) from @solana/kit. No public-surface changes: all CLI options, commands, and behaviors are identical.

This PR rebuilds the `clients/js` CLI on top of the Kit plugin client model introduced in the previous PR. `getClient` is now a flat `.use(...)` chain composing the standard `payer`/`identity`/`solanaRpc`/`programMetadataProgram` plugins together with two small CLI-local plugins (`cliConfigs` and `cliRunOrExport`), replacing the bespoke shim layer in `cli/utils.ts` and the `createDefaultTransactionPlannerAndExecutor` / `getPdaDetails` helpers that lived in `internals.ts`. Commands now consume `client.identity` (instead of a CLI-only `client.authority` alias) and call `client.runOrExport(...)` with an `InstructionPlanInput` directly, using `client.programMetadata.instructions.*` wrappers for single-instruction commands and the building-block `getXMetadataInstructionPlan` functions for the one-shots so the `--export` flow can plan-then-branch. The ad-hoc compute-unit-limit stripping helper used during export is replaced with the version-agnostic `setTransactionMessageComputeUnitLimit(undefined, m)` from `@solana/kit`. No public-surface changes: all CLI options, commands, and behaviors are identical.
@lorisleiva lorisleiva marked this pull request as ready for review May 18, 2026 13:53
@lorisleiva lorisleiva merged commit 2160327 into main May 18, 2026
9 checks passed
@lorisleiva lorisleiva deleted the loris/update-js-client-cli branch May 18, 2026 13:59
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.

1 participant