@@ -25,10 +25,10 @@ Upload an IDL or security.txt file to your program in one command:
2525
2626``` sh
2727# Upload IDL (as upgrade authority using the default CLI keypair)
28- npx @solana-program/program-metadata write idl < program-id> ./idl.json
28+ npx @solana-program/program-metadata@latest write idl < program-id> ./idl.json
2929
3030# Upload metadata with additional information about your program similar to security.txt
31- npx @solana-program/program-metadata write security < program-id> ./security.json
31+ npx @solana-program/program-metadata@latest write security < program-id> ./security.json
3232```
3333
3434At the moment the Solana explorer only reads Codama IDLs that are uploaded as canonical metadata accounts. But soon it will also support security files and Anchor IDLs.
@@ -42,7 +42,7 @@ The CLI supports both canonical (program upgrade authority) and non-canonical (t
4242You can run the CLI directly with npx (no install required):
4343
4444``` sh
45- npx @solana-program/program-metadata < command> [options]
45+ npx @solana-program/program-metadata@latest < command> [options]
4646```
4747
4848Or install globally:
@@ -55,7 +55,7 @@ program-metadata <command> [options]
5555See all the commands:
5656
5757``` sh
58- npx @solana-program/program-metadata --help
58+ npx @solana-program/program-metadata@latest --help
5959```
6060
6161### Commands
@@ -65,7 +65,7 @@ npx @solana-program/program-metadata --help
6565Create a new metadata account for a program (either creates or updates if it already exists):
6666
6767``` sh
68- npx @solana-program/program-metadata write < seed> < program-id> < file> [options]
68+ npx @solana-program/program-metadata@latest write < seed> < program-id> < file> [options]
6969```
7070
7171- ` <seed> ` : e.g. "idl", "security" as standard or anything else you want to use for other data
@@ -79,7 +79,7 @@ npx @solana-program/program-metadata write <seed> <program-id> <file> [options]
7979Download metadata to a file or print to stdout:
8080
8181``` sh
82- npx @solana-program/program-metadata fetch < seed> < program-id> [options]
82+ npx @solana-program/program-metadata@latest fetch < seed> < program-id> [options]
8383```
8484
8585- ` --output <file> ` : Save to file
@@ -90,28 +90,28 @@ npx @solana-program/program-metadata fetch <seed> <program-id> [options]
9090By default your keypair that creates the metadata account will be its authority. You can change the authority by using the ` set-authority ` command. This can be useful when you don't want to update the metadata using the program authority going forward or if you use a multisig to create the metadata account for example. (Multisig instructions see further down) For canonical metadata accounts the upgrade authority can always claim back the metadata account if it is not immutable. For non-canonical metadata accounts the authority can not be changed because the PDA is derived from that authority.
9191
9292- Set a new authority:
93- ` npx @solana-program/program-metadata set-authority <seed> <program-id> --new-authority <pubkey> `
93+ ` npx @solana-program/program-metadata@latest set-authority <seed> <program-id> --new-authority <pubkey> `
9494 Note that the program upgrade authority can always claim back the metadata account if it is not immutable.
9595- Remove authority:
96- ` npx @solana-program/program-metadata remove-authority <seed> <program-id> `
96+ ` npx @solana-program/program-metadata@latest remove-authority <seed> <program-id> `
9797 This will leave only the upgrade authority as the authority of the metadata account.
9898- Make metadata immutable:
99- ` npx @solana-program/program-metadata set-immutable <seed> <program-id> `
99+ ` npx @solana-program/program-metadata@latest set-immutable <seed> <program-id> `
100100 This will make the metadata account immutable and cannot be updated anymore, even for the update authority.
101101- Close metadata account:
102- ` npx @solana-program/program-metadata close <seed> <program-id> `
102+ ` npx @solana-program/program-metadata@latest close <seed> <program-id> `
103103 This will close the account and you can reclaim the rent.
104104
105105#### Buffer Management
106106
107107Using a buffer account you can split the metadata update into the uploading of the data part and then assign the buffer to the program in a later transaction.
108108
109109- Create/update/fetch/close buffer accounts:
110- ` npx @solana-program/program-metadata create-buffer|update-buffer|fetch-buffer|close-buffer ... `
110+ ` npx @solana-program/program-metadata@latest create-buffer|update-buffer|fetch-buffer|close-buffer ... `
111111- List all buffer accounts for an authority:
112- ` npx @solana-program/program-metadata list-buffers [authority] `
112+ ` npx @solana-program/program-metadata@latest list-buffers [authority] `
113113- Update a metadata account with a buffer:
114- ` npx @solana-program/program-metadata write <seed> <program-id> --buffer <buffer-address> `
114+ ` npx @solana-program/program-metadata@latest write <seed> <program-id> --buffer <buffer-address> `
115115
116116### Options
117117
@@ -133,14 +133,14 @@ For updating a metadata account of a program that is managed by a Squads multisi
1331332 . Create the buffer account and transfer ownership to the squad
134134
135135``` bash
136- npx @solana-program/program-metadata create-buffer ./target/idl/let_me_buy.json
137- npx @solana-program/program-metadata set-buffer-authority < buffer-address> --new-authority < multisig-address>
136+ npx @solana-program/program-metadata@latest create-buffer ./target/idl/let_me_buy.json
137+ npx @solana-program/program-metadata@latest set-buffer-authority < buffer-address> --new-authority < multisig-address>
138138```
139139
1401403 . Export the transaction as base58 and then import it into your multisig under ` developers/txBuilder/createTransaction/addInstruction/ImportAsBase58 `
141141
142142``` bash
143- npx @solana-program/program-metadata write idl < program-address> --buffer < buffer-address> --export < multisig-address> --export-encoding base58 --close-buffer < your-address-to-get-the-buffer-rent-back>
143+ npx @solana-program/program-metadata@latest write idl < program-address> --buffer < buffer-address> --export < multisig-address> --export-encoding base58 --close-buffer < your-address-to-get-the-buffer-rent-back>
144144```
145145
1461464 . Sign the transaction in your multisig and send it
@@ -150,31 +150,31 @@ npx @solana-program/program-metadata write idl <program-address> --buffer <buffe
150150** Upload IDL as canonical (upgrade authority):**
151151
152152``` sh
153- npx @solana-program/program-metadata write idl < program-id> ./idl.json --keypair < authority-keypair>
153+ npx @solana-program/program-metadata@latest write idl < program-id> ./idl.json --keypair < authority-keypair>
154154```
155155
156156** Upload metadata as third-party (non-canonical):**
157157
158158``` sh
159- npx @solana-program/program-metadata write idl < program-id> ./metadata.json --non-canonical < your-pubkey>
159+ npx @solana-program/program-metadata@latest write idl < program-id> ./metadata.json --non-canonical < your-pubkey>
160160```
161161
162162** Fetch canonical metadata:**
163163
164164``` sh
165- npx @solana-program/program-metadata fetch idl < program-id> --output ./idl.json
165+ npx @solana-program/program-metadata@latest fetch idl < program-id> --output ./idl.json
166166```
167167
168168** Fetch non-canonical metadata:**
169169
170170``` sh
171- npx @solana-program/program-metadata fetch idl < program-id> --non-canonical < pubkey> --output ./idl.json
171+ npx @solana-program/program-metadata@latest fetch idl < program-id> --non-canonical < pubkey> --output ./idl.json
172172```
173173
174174** Close a metadata account:**
175175
176176``` sh
177- npx @solana-program/program-metadata close idl < program-id>
177+ npx @solana-program/program-metadata@latest close idl < program-id>
178178```
179179
180180## Security.txt File Format
@@ -212,7 +212,7 @@ For that you just create a json file containing the security.txt data and upload
212212Then use the same commands as for the IDL to upload the security.txt file:
213213
214214``` sh
215- npx @solana-program/program-metadata write security < program-id> ./security.json
215+ npx @solana-program/program-metadata@latest write security < program-id> ./security.json
216216```
217217
218218## Fetching IDL or Security Metadata with the JavaScript SDK
0 commit comments