
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
@polkadot-api/cli
Advanced tools
Add a chain by using the add command
polkadot-api add ksm -n ksmcc3
In this example, ksm is the key to be used to reference this chain, -n ksmcc3 is to source from the "well-known chain" Kusama.
Then you can run the CLI without arguments to generate the descriptor files
polkadot-api
Files are generated into a @polkadot-api/descriptors package.
polkadot-api --help
Usage: polkadot-api [options] [command]
Polkadot API CLI
Options:
-h, --help display help for command
Commands:
generate [options] Generate descriptor files
add [options] <key> Add a new chain spec to the list
update [options] [keys] Update the metadata files
remove [options] <key> Remove a chain spec from the list
help [command] display help for command
By default, the Polkadot API configuration file is polkadot-api.json, located at the project's root folder. This file contains a record of the added chains, their sources, and the destination folders for each one of them.
All the arguments of the CLI accept an option --config {file} to use a different configuration file.
Optionally you can have this configuration in the package.json file, which will be added under the polkadot-api subpath.
Usage: polkadot-api generate [options]
Generate descriptor files
Options:
--config <filename> Source for the config file
-k, --key <key> Key of the descriptor to generate
-h, --help display help for command
By default, it generates the descriptor files for all of the chains defined in the config file. To generate only the ones for a specific chain, use the -k, --key parameter.
Usage: polkadot-api add [options] <key>
Add a new chain spec to the list
Arguments:
key Key identifier for the chain spec
Options:
--config <filename> Source for the config file
-f, --file <filename> Source from metadata encoded file
-w, --wsUrl <URL> Source from websocket url
-c, --chainSpec <filename> Source from chain spec file
-n, --name <name> Source from a well-known chain
--no-persist Do not persist the metadata as a file
-h, --help display help for command
This command requires one of the options to specify a source:
-f, --file-w, --wsUrl-c, --chainSpec-n, --nameFor the external sources (-w, -c and -n), the CLI automatically downloads the metadata and stores it as a file {key}.scale so that it can be added to source control, which is recommended. In case you want to re-fetch in on the fly every time you generate the descriptors, there's the option --no-persist which wil not create the metadata file.
Usage: polkadot-api update [options] [keys]
Update the metadata files
Arguments:
keys Keys of the metadata files to update, separated by commas. Leave
empty for all
Options:
--config <filename> Source for the config file
-h, --help display help for command
For the chains with both an external source (added with -w, -c or -n) and a persisted file it re-fetches the metadata and updates the encoded metadata file.
Usage: polkadot-api remove [options] <key>
Remove a chain spec from the list
Arguments:
key Key identifier for the chain spec
Options:
--config <filename> Source for the config file
-h, --help display help for command
Removes the specified chain spec from the list. Equivalent as manually removing the entry from the config file.
FAQs
Add a chain by using the add command
We found that @polkadot-api/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.