|
1 | | -# thirdweb cli |
| 1 | +<p align="center"> |
| 2 | +<br /> |
| 3 | +<a href="https://thirdweb.com"><img src="https://github.com/thirdweb-dev/js/blob/main/packages/sdk/logo.svg?raw=true" width="200" alt=""/></a> |
| 4 | +<br /> |
| 5 | +</p> |
| 6 | +<h1 align="center">thirdweb CLI</h1> |
| 7 | +<p align="center"> |
| 8 | +<a href="https://www.npmjs.com/package/@thirdweb-dev/cli"><img src="https://img.shields.io/npm/v/@thirdweb-dev/cli?color=red&logo=npm" alt="npm version"/></a> |
| 9 | +<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a> |
2 | 10 |
|
3 | | - This is a proxied package of the `@thirdweb-dev/cli` for convenient usage with `npx thirdweb`. |
4 | | - |
5 | | - You can find the actual package [here](https://www.npmjs.com/package/@thirdweb-dev/cli). |
6 | | - |
| 11 | +</p> |
| 12 | +<p align="center"><strong>Publish and deploy smart contracts without dealing with private keys</strong></p> |
| 13 | +<br /> |
| 14 | + |
| 15 | +## Getting started |
| 16 | + |
| 17 | +The thirdweb CLI is your one-stop-shop for publishing custom contracts for your team or the world to use. The CLI uploads all necessary data to decentralized storage and makes it available to deploy via the thirdweb sdk or thirdweb dashboard. |
| 18 | + |
| 19 | +This brings all the capabilities of thirdweb to your own custom contracts. |
| 20 | + |
| 21 | +## Deploying your contract |
| 22 | + |
| 23 | +```shell |
| 24 | +npx thirdweb@latest deploy |
| 25 | +``` |
| 26 | + |
| 27 | +This command will: |
| 28 | + |
| 29 | +- auto-detect any contracts in your project |
| 30 | +- compile your project |
| 31 | +- Upload ABIs to IPFS |
| 32 | +- Open the deploy flow in your thirdweb dashboard in a browser |
| 33 | + |
| 34 | +From the thirdweb dashboard, you can review and deploy your contracts on any supported EVM chain. |
| 35 | + |
| 36 | +Deploying contracts this way gives you access to: |
| 37 | + |
| 38 | +- auto generated SDKs for react, node, python, go |
| 39 | +- dashboards to manage, monitor and interact with your contracts |
| 40 | + |
| 41 | +## Releasing your contract |
| 42 | + |
| 43 | +```shell |
| 44 | +npx thirdweb@latest release |
| 45 | +``` |
| 46 | + |
| 47 | +Creates an official release of your contract, along with: |
| 48 | + |
| 49 | +- author attribution |
| 50 | +- contract information |
| 51 | +- instructions on how to use and what it's for |
| 52 | +- versioning |
| 53 | +- release notes |
| 54 | + |
| 55 | +Creating releases this way gives you shareable URL to let others to deploy your contracts in one click. It lets you manage released versions and get attribution for deployed contracts. Contract releases are registered on-chain (Polygon) and IPFS, for free (gasless). |
| 56 | + |
| 57 | +Deploying released contracts give deployers access to automatic SDKs to integrate into their app and dashboards to manage and monitor the deployed contracts. |
| 58 | + |
| 59 | +## Detecting contract extensions |
| 60 | + |
| 61 | +```shell |
| 62 | +npx thirdweb@latest detect |
| 63 | +``` |
| 64 | + |
| 65 | +As you're developing your contracts, you may want to implement [Extensions](https://portal.thirdweb.com/extensions) to unlock functionality on the SDKs (ie. nft minting with automatic upload to IPFS) and the dashboard (ie. generated UI to manage permissions). This command will show what extensions were detected on your contract, unlocking the corresponding functionality on the SDKs and dashboard. |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +## Global installation |
| 70 | + |
| 71 | +We recommend using npx to always get the latest version. Alternatively, you can install the CLI as a global command on your machine: |
| 72 | + |
| 73 | +```shell |
| 74 | +npm i -g @thirdweb-dev/cli |
| 75 | +``` |
| 76 | + |
| 77 | +--- |
| 78 | + |
| 79 | +## Supported projects |
| 80 | + |
| 81 | +To publish, you need to be in a directory that contains a project which the CLI is compatible |
| 82 | +with. The projects we support so far: |
| 83 | + |
| 84 | +- hardhat |
| 85 | +- forge |
| 86 | +- truffle |
| 87 | +- solc |
| 88 | + |
| 89 | +--- |
| 90 | + |
| 91 | +## Running the examples |
| 92 | + |
| 93 | +Clone the repo and run this command after installing the CLI tool: |
| 94 | + |
| 95 | +```bash |
| 96 | +$ cd examples/hardhat |
| 97 | +$ npx thirdweb@latest release |
| 98 | +``` |
| 99 | + |
| 100 | +## Local Development |
| 101 | + |
| 102 | +The simplest way to work on the CLI locally is to: |
| 103 | + |
| 104 | +1. Install the package locally |
| 105 | +2. Run the `build:watch` command to compile any changes in realtime |
| 106 | + |
| 107 | +```bash |
| 108 | +$ npm install -g ./ |
| 109 | +$ yarn run build:watch |
| 110 | +``` |
0 commit comments