
Security News
Feross on TBPN: Socket's Series C and the State of Software Supply Chain Security
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.
@subql/cli
Advanced tools
CLI for SubQuery
$ npm install -g @subql/cli
$ subql COMMAND
running command...
$ subql (--version)
@subql/cli/6.0.1-1 linux-x64 node-v22.17.0
$ subql --help [COMMAND]
USAGE
$ subql COMMAND
...
subql build [LOCATION]subql codegen [LOCATION]subql codegen:import-abi LOCATIONsubql import-abi LOCATIONsubql init NAMEsubql mcpsubql migratesubql multi-chain:add [LOCATION]subql onfinality:create-deploymentsubql onfinality:create-multichain-deployment [LOCATION]subql onfinality:create-projectsubql onfinality:delete-deploymentsubql onfinality:delete-projectsubql onfinality:promote-deploymentsubql publish [LOCATION]subql build [LOCATION]Build this SubQuery project code into a bundle
USAGE
$ subql build [LOCATION] [--output <value>]
ARGUMENTS
LOCATION The path to the project, this can be a directory or a project manifest file.
FLAGS
--output=<value> [default: dist] The output location relative to the location
DESCRIPTION
Build this SubQuery project code into a bundle
See code: lib/commands/build.js
subql codegen [LOCATION]Generate entity types from the GraphQL schema and contract interfaces
USAGE
$ subql codegen [LOCATION]
ARGUMENTS
LOCATION The project directory or path to project manifest.
DESCRIPTION
Generate entity types from the GraphQL schema and contract interfaces
See code: lib/commands/codegen/index.js
subql codegen:import-abi LOCATIONImport and ABI to generate project handlers and mapping functions based on an Ethereum ABI. If address is provided, it will attempt to fetch the ABI and start block from the Etherscan.
USAGE
$ subql codegen:import-abi LOCATION [--address <value>] [--abiName <value>] [--startBlock <value>] [--abiPath <value>]
[--events <value>] [--functions <value>]
ARGUMENTS
LOCATION The path to the project, this can be a directory or a project manifest file.
FLAGS
--abiName=<value> The contracts name, if not provided, the contract address will be used if the ABI is fetched
from Etherscan
--abiPath=<value> The path to the ABI file
--address=<value> The contracts address
--events=<value> ABI events to generate handlers for. Use '*' for all. e.g. --events="approval, transfer"
--functions=<value> ABI functions to generate handlers for. Use '*' for all. e.g. --functions="approval, transfer"
--startBlock=<value> The start block of the handler, generally the block the contract is deployed.
DESCRIPTION
Import and ABI to generate project handlers and mapping functions based on an Ethereum ABI. If address is provided, it
will attempt to fetch the ABI and start block from the Etherscan.
ALIASES
$ subql import-abi
See code: lib/commands/codegen/import-abi.js
subql import-abi LOCATIONImport and ABI to generate project handlers and mapping functions based on an Ethereum ABI. If address is provided, it will attempt to fetch the ABI and start block from the Etherscan.
USAGE
$ subql import-abi LOCATION [--address <value>] [--abiName <value>] [--startBlock <value>] [--abiPath <value>]
[--events <value>] [--functions <value>]
ARGUMENTS
LOCATION The path to the project, this can be a directory or a project manifest file.
FLAGS
--abiName=<value> The contracts name, if not provided, the contract address will be used if the ABI is fetched
from Etherscan
--abiPath=<value> The path to the ABI file
--address=<value> The contracts address
--events=<value> ABI events to generate handlers for. Use '*' for all. e.g. --events="approval, transfer"
--functions=<value> ABI functions to generate handlers for. Use '*' for all. e.g. --functions="approval, transfer"
--startBlock=<value> The start block of the handler, generally the block the contract is deployed.
DESCRIPTION
Import and ABI to generate project handlers and mapping functions based on an Ethereum ABI. If address is provided, it
will attempt to fetch the ABI and start block from the Etherscan.
ALIASES
$ subql import-abi
subql init NAMEInitialize a SubQuery project from a template
USAGE
$ subql init NAME [--location <value>] [--network <value>] [--networkFamily <value>] [--endpoint
<value>] [--installDependencies] [--packageManager npm|yarn|pnpm] [--author <value>]
ARGUMENTS
NAME The name of the project to create
FLAGS
--author=<value> The project author that will be set in package.json. Defaults to the current system user
--endpoint=<value> The RPC endpoint that the project will use
--installDependencies Install the dependencies of the project
--location=<value> The path to the project, this can be a directory or a project manifest file.
--network=<value> The name of the network the project will index data for
--networkFamily=<value> The network family the project will index data for, e.g. EVM, Substrate
--packageManager=<option> [default: npm]
<options: npm|yarn|pnpm>
DESCRIPTION
Initialize a SubQuery project from a template
See code: lib/commands/init.js
subql mcpRuns an MCP (Model Context Protocol) server over stdio
USAGE
$ subql mcp
DESCRIPTION
Runs an MCP (Model Context Protocol) server over stdio
See code: lib/commands/mcp.js
subql migrateMigrate a Subgraph project to a SubQuery project, including the manifest and schema.
USAGE
$ subql migrate --input <value> --output <value> [--gitSubDirectory <value>]
FLAGS
--gitSubDirectory=<value> A subdirectory in the git repo if the input is a git repo
--input=<value> (required) A directory or git repo to a subgraph project
--output=<value> (required) The location of the SubQuery project
DESCRIPTION
Migrate a Subgraph project to a SubQuery project, including the manifest and schema.
See code: lib/commands/migrate.js
subql multi-chain:add [LOCATION]Add new chain manifest to multi-chain project
USAGE
$ subql multi-chain:add [LOCATION] --chainManifestFile <value>
ARGUMENTS
LOCATION The path to the multichain project, this can be a directory or a multichain manifest file.
FLAGS
--chainManifestFile=<value> (required) The path to the new chain manifest
DESCRIPTION
Add new chain manifest to multi-chain project
See code: lib/commands/multi-chain/add.js
subql onfinality:create-deploymentCreate a project deployment on the OnFinality managed services
USAGE
$ subql onfinality:create-deployment --org <value> --projectName <value> --ipfsCID <value> [--type primary|stage]
[--indexerVersion <value>] [--queryVersion <value>] [--dict <value>] [--endpoint <value>] [--indexerUnsafe]
[--indexerBatchSize <value>] [--indexerSubscription] [--disableHistorical] [--indexerUnfinalized]
[--indexerStoreCacheThreshold <value>] [--disableIndexerStoreCacheAsync] [--indexerWorkers <value>] [--queryUnsafe]
[--querySubscription] [--queryTimeout <value>] [--queryMaxConnection <value>] [--queryAggregate] [--queryLimit
<value>] [--useDefaults]
FLAGS
--dict=<value> A dictionary endpoint for this projects network
--disableHistorical Disable historical data indexing
--disableIndexerStoreCacheAsync Disable async store cache
--endpoint=<value> The RPC endpoint to be used by the project
--indexerBatchSize=<value> [default: 30] The batch size for the indexer
--indexerStoreCacheThreshold=<value> The number of items kept in the cache before flushing
--indexerSubscription Enable subscription for the indexer
--indexerUnfinalized Enable unfinalized blocks indexing
--indexerUnsafe Run the indexer in unsafe mode, this will disable some checks
--indexerVersion=<value> Indexer image version
--indexerWorkers=<value> The number of workers for the indexer
--ipfsCID=<value> (required) The IPFC CID of the published project
--org=<value> (required) The Github organization name
--projectName=<value> (required) Project name
--queryAggregate Enable aggregate queries
--queryLimit=<value> The maximum number of results for the query
--queryMaxConnection=<value> The maximum number of connections for the query
--querySubscription Enable subscription queries
--queryTimeout=<value> The timeout for the query
--queryUnsafe Run the query in unsafe mode, this will disable some checks
--queryVersion=<value> Query image version
--type=<option> [default: primary]
<options: primary|stage>
--useDefaults Use default values for indexerVersion, queryVersion, dictionary, endpoint
DESCRIPTION
Create a project deployment on the OnFinality managed services
See code: lib/commands/onfinality/create-deployment.js
subql onfinality:create-multichain-deployment [LOCATION]Create a multi-chain project deployment no the OnFinality managed services
USAGE
$ subql onfinality:create-multichain-deployment [LOCATION] --org <value> --projectName <value> [--type primary|stage] [--indexerVersion
<value>] [--queryVersion <value>] [--dict <value>] [--endpoint <value>] [--indexerUnsafe] [--indexerBatchSize
<value>] [--indexerSubscription] [--disableHistorical] [--indexerUnfinalized] [--indexerStoreCacheThreshold <value>]
[--disableIndexerStoreCacheAsync] [--indexerWorkers <value>] [--queryUnsafe] [--querySubscription] [--queryTimeout
<value>] [--queryMaxConnection <value>] [--queryAggregate] [--queryLimit <value>] [--useDefaults] [--ipfs <value>]
ARGUMENTS
LOCATION The path to the project, this can be a directory or a project manifest file.
FLAGS
--dict=<value> A dictionary endpoint for this projects network
--disableHistorical Disable historical data indexing
--disableIndexerStoreCacheAsync Disable async store cache
--endpoint=<value> The RPC endpoint to be used by the project
--indexerBatchSize=<value> [default: 30] The batch size for the indexer
--indexerStoreCacheThreshold=<value> The number of items kept in the cache before flushing
--indexerSubscription Enable subscription for the indexer
--indexerUnfinalized Enable unfinalized blocks indexing
--indexerUnsafe Run the indexer in unsafe mode, this will disable some checks
--indexerVersion=<value> Indexer image version
--indexerWorkers=<value> The number of workers for the indexer
--ipfs=<value> An additional IPFS endpoint to upload to
--org=<value> (required) The Github organization name
--projectName=<value> (required) Project name
--queryAggregate Enable aggregate queries
--queryLimit=<value> The maximum number of results for the query
--queryMaxConnection=<value> The maximum number of connections for the query
--querySubscription Enable subscription queries
--queryTimeout=<value> The timeout for the query
--queryUnsafe Run the query in unsafe mode, this will disable some checks
--queryVersion=<value> Query image version
--type=<option> [default: primary]
<options: primary|stage>
--useDefaults Use default values for indexerVersion, queryVersion, dictionary, endpoint
DESCRIPTION
Create a multi-chain project deployment no the OnFinality managed services
See code: lib/commands/onfinality/create-multichain-deployment.js
subql onfinality:create-projectCreate a project on the OnFinality managed services
USAGE
$ subql onfinality:create-project --org <value> --projectName <value> [--logoURL <value>] [--subtitle <value>] [--description
<value>] [--dedicatedDB <value>] [--projectType subquery|subgraph]
FLAGS
--dedicatedDB=<value> Dedicated DataBase
--description=<value> Description
--logoURL=<value> Logo URL
--org=<value> (required) Github organization name
--projectName=<value> (required) Project name
--projectType=<option> [default: subquery] Project type [subquery|subgraph]
<options: subquery|subgraph>
--subtitle=<value> Subtitle
DESCRIPTION
Create a project on the OnFinality managed services
See code: lib/commands/onfinality/create-project.js
subql onfinality:delete-deploymentDelete a deployment from the OnFinality managed services
USAGE
$ subql onfinality:delete-deployment --org <value> --projectName <value> --deploymentID <value>
FLAGS
--deploymentID=<value> (required) Deployment ID
--org=<value> (required) Github organization name
--projectName=<value> (required) Project name
DESCRIPTION
Delete a deployment from the OnFinality managed services
See code: lib/commands/onfinality/delete-deployment.js
subql onfinality:delete-projectDelete a project on the OnFinality managed services
USAGE
$ subql onfinality:delete-project --org <value> --projectName <value>
FLAGS
--org=<value> (required) The Github organization name
--projectName=<value> (required) The project name
DESCRIPTION
Delete a project on the OnFinality managed services
See code: lib/commands/onfinality/delete-project.js
subql onfinality:promote-deploymentPromote a deployment on the OnFinality managed services from a Stage environment to Production
USAGE
$ subql onfinality:promote-deployment --org <value> --projectName <value> --deploymentID <value>
FLAGS
--deploymentID=<value> (required) Deployment ID
--org=<value> (required) Github organization name
--projectName=<value> (required) Project name
DESCRIPTION
Promote a deployment on the OnFinality managed services from a Stage environment to Production
See code: lib/commands/onfinality/promote-deployment.js
subql publish [LOCATION]Upload this SubQuery project to IPFS for distribution
USAGE
$ subql publish [LOCATION] [--ipfs <value>] [--silent]
ARGUMENTS
LOCATION The path to the project, this can be a directory or a project manifest file.
FLAGS
--ipfs=<value> An additional IPFS endpoint to upload to
--silent Run the command without logging, only outputs the CIDs
DESCRIPTION
Upload this SubQuery project to IPFS for distribution
See code: lib/commands/publish.js
FAQs
CLI for SubQuery
The npm package @subql/cli receives a total of 1,206 weekly downloads. As such, @subql/cli popularity was classified as popular.
We found that @subql/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
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.

Security News
OSV withdrew 157 OSV malware reports after automated false positives incorrectly flagged trusted npm and PyPI packages, sending bad records into tools that rely on OSV data.

Research
/Security News
TrapDoor crypto stealer hits 36 malicious packages across npm, PyPI, and Crates.io, targeting crypto, DeFi, AI, and security developers.