# Subgraph

<div className="cli-command">
  {<pre>Usage: settlemint smart-contract-set subgraph|sg [options] [command]<br /><br />Commands for managing TheGraph subgraphs for smart contract indexing<br /><br />Options:<br />  -h, --help                        display help for command<br /><br />Commands:<br />  add [options]                     Add a contract to the subgraph<br />  build [options]                   Build the subgraph<br />  codegen                           Codegen the subgraph types<br />  deploy [options] [subgraph-name]  Deploy the subgraph<br />  remove [options] [subgraph-name]  Remove a subgraph<br />  help [command]                    display help for command<br /></pre>}
</div>

## Add

<div className="cli-command">
  {<pre>Usage: settlemint smart-contract-set subgraph add <br />Examples:<br /><br />  # Add a contract to the subgraph<br />  $ settlemint scs subgraph add --abi=./abis/bond.json --contract-name=bond<br /><br />Add a contract to the subgraph<br /><br />Options:<br />  --abi &lt;abi&gt;                      Path to the contract ABI.<br />  --contract-name &lt;contract-name&gt;  Name of the contract.<br />  --address &lt;contract-address&gt;     Address of the contract (defaults to<br />                                   0x0000000000000000000000000000000000000000).<br />  --start-block &lt;start-block&gt;      Start block of the contract (defaults to 0).<br />  --network &lt;network&gt;              Network name (defaults to settlemint).<br />  -h, --help                       display help for command<br /></pre>}
</div>

## Build

<div className="cli-command">
  {<pre>Usage: settlemint smart-contract-set subgraph build <br />Examples:<br /><br />  # Build the subgraph<br />  $ settlemint scs subgraph build<br /><br />Build the subgraph<br /><br />Options:<br />  --ipfs &lt;ipfs-url&gt;  The IPFS URL to use for the subgraph deployment<br />  -h, --help         display help for command<br /></pre>}
</div>

## Codegen

<div className="cli-command">
  {<pre>Usage: settlemint smart-contract-set subgraph codegen <br />Examples:<br /><br />  # Generate subgraph types<br />  $ settlemint scs subgraph codegen<br /><br />Codegen the subgraph types<br /><br />Options:<br />  -h, --help  display help for command<br /></pre>}
</div>

## Deploy

<div className="cli-command">
  {<pre>Usage: settlemint smart-contract-set subgraph deploy <br />Examples:<br /><br />  # Deploy the subgraph<br />  $ settlemint scs subgraph deploy<br /><br />  # Deploy the subgraph with a specific name<br />  $ settlemint scs subgraph deploy my-subgraph<br /><br />Deploy the subgraph<br /><br />Arguments:<br />  subgraph-name          The name of the subgraph to deploy (defaults to value<br />                         in .env if not provided)<br /><br />Options:<br />  --ipfs &lt;ipfs-url&gt;      The IPFS URL to use for the subgraph deployment<br />                         (defaults to https://ipfs.console.settlemint.com)<br />  -a, --accept-defaults  Accept the default and previously set values<br />  --prod                 Connect to your production environment<br />  -h, --help             display help for command<br /></pre>}
</div>

## Remove

<div className="cli-command">
  {<pre>Usage: settlemint smart-contract-set subgraph remove <br />Examples:<br /><br />  # Remove a subgraph<br />  $ settlemint scs subgraph remove my-subgraph<br /><br />Remove a subgraph<br /><br />Arguments:<br />  subgraph-name          The name of the subgraph to remove (defaults to value<br />                         in .env if not provided)<br /><br />Options:<br />  -a, --accept-defaults  Accept the default and previously set values<br />  --prod                 Connect to your production environment<br />  -f, --force            Force remove the subgraph without confirmation<br />  -h, --help             display help for command<br /></pre>}
</div>
