generate-idl-client

generate-idl-client is a command for Claude Code from solanabr/solana-ai-kit. It costs 19 tokens per session (722 once invoked), scanned A, original, MIT.

A command that creates a TypeScript client from a Solana program's IDL, a file describing the program's instructions and data. Solana is a blockchain platform, and the client lets TypeScript code interact with that program.

In plain words
What is it for?
Use it to detect Anchor, Shank, or Codama IDL sources, run the matching generator, and verify the resulting TypeScript client.
Why use it?
It avoids manually writing client code and checks that the generated result compiles.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to detect Anchor, Shank, or Codama IDL sources, run the matching generator, and verify the resulting TypeScript client.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/solanabr/solana-ai-kit/generate-idl-client
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/solanabr/solana-ai-kit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for generate-idl-client

README.md
[![agentmods](https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/generate-idl-client/github.svg)](https://agentmods.dev/commands/solanabr/solana-ai-kit/generate-idl-client)
Your own site
<a href="https://agentmods.dev/commands/solanabr/solana-ai-kit/generate-idl-client"><img src="https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/generate-idl-client/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for generate-idl-client

Your own site · 80×15
<a href="https://agentmods.dev/commands/solanabr/solana-ai-kit/generate-idl-client"><img src="https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/generate-idl-client.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 722 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00019 $0.00722
Opus 5.5 $0.00008 $0.00289
Sonnet 5.5 $0.00004 $0.00144
Haiku 4.5 $0.00002 $0.00072

Measured 1mo ago against content hash 3cdbe9112862, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

generate-idl-client scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

.claude/commands/generate-idl-client.md · 30 lines

How it starts

The opening of the file, as written. The whole thing — 30 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generate or refresh the client for a program. $ARGUMENTS can name the program, the IDL path, or the output directory.

Pipeline and repo layout: idl-codegen.md. Using the generated client: kit/codama.md.

Choose the generator

  • Codama (default): renders a Kit-native TypeScript client, plus a Rust client if wanted, from an Anchor or Shank IDL. Use it for new clients, @solana/kit frontends, and every native or Pinocchio program.
  • Anchor TS client (@anchor-lang/core): only when the app already builds on Program/AnchorProvider. There is nothing to generate: anchor build writes target/idl/<name>.json and target/types/<name>.ts, and new Program(idl as MyProgram, provider) takes the address from idl.address.
  • Rust client or CPI from another Anchor program: declare_program!(<name>) reads idls/<name>.json. For a deployed program, anchor idl fetch -o idls/<name>.json <PROGRAM_ID> (Anchor 1.x reads the IDL from Program Metadata).

Steps

  1. Build the IDL from current code:
    • Anchor: NO_DNA=1 anchor build writes target/idl/<name>.json.
    • Native or Pinocchio with Shank macros: cargo install shank-cli, then shank idl -r programs/<name> -o idl (-p <PROGRAM_ID> sets the address). Check that the IDL has metadata.origin: "shank": Codama reads Shank IDLs through its Anchor adapter and uses that field to pick 1-byte discriminators.
  2. Generate with Codama:
    • Anchor CLIs with the codama subcommand (check anchor codama --help): anchor codama generate -l js -p clients target/idl/<name>.json, or set [clients] auto = true and js = true in Anchor.toml to regenerate on every anchor build.
    • Codama CLI: npx codama init (asks for the IDL path and renderers, writes codama.json, installs @codama/renderers-js and, for Anchor or Shank IDLs, @codama/nodes-from-anchor), then npx codama run js (or --all).
    • Script form, if the project already has one: createFromRoot(rootNodeFromAnchor(idl)).accept(renderVisitor(outDir)), with createFromRoot from codama and renderVisitor from @codama/renderers-js.
  3. Typecheck the consumers (npx tsc --noEmit) and run the tests that use the client.
  4. Commit generated code when consumers should not have to run codegen; otherwise wire generation into the build or CI. Regenerate after every instruction or account change.

Read the full file on GitHub · 30 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · -261 lines · +4 tokens per session 3cdbe9112862
  2. 1mo ago Changed 45b38fb4f909
  3. 1mo ago First seen · 291 lines · 15 tokens per session scan A 62e550308da7

Subscribe to this mod's changes

generate-idl-client is a command published in the GitHub repository solanabr/solana-ai-kit (104 stars, last pushed 1mo ago), licensed MIT. It adds 19 tokens to every session and 722 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.