@settlemint/sdk-cli 0.8.6 → 0.9.0-mainc7ab8dd6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +187 -25
  2. package/dist/cli.js +45228 -45303
  3. package/dist/cli.js.map +91 -91
  4. package/package.json +22 -7
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  Integrate SettleMint into your application with ease.
8
8
  </p>
9
9
  </p>
10
- <br/>
10
+
11
11
  <p align="center">
12
12
  <a href="https://github.com/settlemint/sdk/actions?query=branch%3Amain"><img src="https://github.com/settlemint/sdk/actions/workflows/build.yml/badge.svg?event=push&branch=main" alt="CI status" /></a>
13
13
  <a href="https://fsl.software" rel="nofollow"><img src="https://img.shields.io/npm/l/@settlemint/sdk-cli" alt="License"></a>
@@ -26,45 +26,207 @@
26
26
  <br />
27
27
  </div>
28
28
 
29
- ## Getting started
29
+ ## Table of Contents
30
+
31
+ - [About](#about)
32
+ - [Usage](#usage)
33
+ - [As a dependency in your package.json](#as-a-dependency-in-your-package.json)
34
+ - [Globally install the CLI](#globally-install-the-cli)
35
+ - [Examples](#examples)
36
+ - [Get the version of the CLI](#get-the-version-of-the-cli)
37
+ - [Get help for a command](#get-help-for-a-command)
38
+ - [Login to the platform](#login-to-the-platform)
39
+ - [Creating a new project from a starter kit template](#creating-a-new-project-from-a-starter-kit-template)
40
+ - [Installing dependencies](#installing-dependencies)
41
+ - [Connecting to your SettleMint infrastructure](#connecting-to-your-settlemint-infrastructure)
42
+ - [Deploying your smart contracts and subgraphs](#deploying-your-smart-contracts-and-subgraphs)
43
+ - [Generating code for your dApp](#generating-code-for-your-dapp)
44
+ - [Start your dApp in development mode](#start-your-dapp-in-development-mode)
45
+ - [Creating a new project from a smart contract template](#creating-a-new-project-from-a-smart-contract-template)
46
+ - [Testing your smart contracts on a local network](#testing-your-smart-contracts-on-a-local-network)
47
+ - [Deploying your smart contracts and subgraphs](#deploying-your-smart-contracts-and-subgraphs)
48
+ - [API Reference](#api-reference)
49
+ - [Contributing](#contributing)
50
+ - [License](#license)
51
+
52
+ ## About
53
+
54
+ The SettleMint CLI provides a command-line interface for interacting with the SettleMint platform. It enables you to manage your blockchain networks, deploy smart contracts, configure your SettleMint infrastructure directly from the terminal.
55
+
56
+ ## Usage
57
+
58
+ ### As a dependency in your package.json
59
+
60
+ ```bash
61
+ # npm
62
+ npm install @settlemint/sdk-cli
63
+ npx settlemint --version
64
+
65
+ # bun
66
+ bun add @settlemint/sdk-cli
67
+ bunx settlemint --version
68
+
69
+ # pnpm
70
+ pnpm add @settlemint/sdk-cli
71
+ pnpm dlx settlemint --version
72
+
73
+ # yarn
74
+ yarn add @settlemint/sdk-cli
75
+ yarn create settlemint --version
76
+ ```
77
+
78
+ ### Globally install the CLI
79
+
80
+ ```bash
81
+ # npm
82
+ npm install -g @settlemint/sdk-cli
83
+
84
+ # bun
85
+ bun install -g @settlemint/sdk-cli
86
+
87
+ # pnpm
88
+ pnpm install -g @settlemint/sdk-cli
89
+
90
+ # yarn
91
+ yarn install -g @settlemint/sdk-cli
92
+ ```
93
+
94
+ ## Examples
95
+
96
+ ### Get the version of the CLI
97
+
98
+ ```bash
99
+ settlemint --version
100
+ ```
101
+
102
+ ### Get help for a command
30
103
 
31
- First we will create a new Next JS project using the following command.
104
+ The CLI uses a hierarchical command structure. You can navigate through available commands and subcommands using the `--help` flag at any level.
32
105
 
33
106
  ```bash
34
- # Using npx
35
- npx @settlemint/sdk-cli@latest create
107
+ settlemint --help
108
+ settlemint platform --help
109
+ settlemint platform create --help
110
+ ```
111
+
112
+ ### Login to the platform
113
+
114
+ To use the SettleMint CLI, you first need to authenticate with the platform. Create a Personal Access Token (PAT) on the SettleMint platformand paste it when prompted by the login command.
115
+
116
+ Visit [the documentation](https://console.settlemint.com/documentation/docs/using-platform/personal-access-tokens/) to learn how to create a Personal Access Token.
36
117
 
37
- # Using bun
38
- bunx @settlemint/sdk-cli@latest create
118
+ Then run the login command and paste your token when prompted:
39
119
 
40
- # Using pnpm
41
- pnpm dlx @settlemint/sdk-cli@latest create
120
+ ```bash
121
+ settlemint login
42
122
  ```
43
123
 
44
- Then following the next steps in your terminal.
124
+ ### Creating a new project from a starter kit template
45
125
 
126
+ To create a new project from a starter kit template, use the `create` command with the `--template` flag:
46
127
 
47
- ## Local development
128
+ ```bash
129
+ settlemint create --project-name <project-name> --template <template-name>
130
+ ```
48
131
 
49
- ### Debugging
132
+ #### Installing dependencies
50
133
 
51
- To debug with interactive input you need to start the command from the terminal and then attach the debugger.
134
+ To install the dependencies for your project, use the `dependencies` command.
52
135
 
53
136
  ```bash
54
- bun --inspect-wait=localhost:6499/ sdk/cli/src/cli.ts create
55
- # Attach the debugger using the "SDK: Attach to process" configuration
137
+ # bun
138
+ bun install
139
+ bun run dependencies
140
+
141
+ # npm
142
+ npm install
143
+ npm run dependencies
144
+
145
+ # yarn
146
+ yarn install
147
+ yarn run dependencies
56
148
 
57
- # Run from the directory created by the create command
58
- bun --inspect-wait=localhost:6499/ sdk/cli/src/cli.ts connect
59
- # Attach the debugger using the "SDK: Attach to process" configuration
149
+ # pnpm
150
+ pnpm install
151
+ pnpm run dependencies
60
152
  ```
61
153
 
62
- ### e2e tests
154
+ #### Connecting to your SettleMint infrastructure
155
+
156
+ After creating your project, you'll need to connect it to your SettleMint infrastructure. This requires setting up environment variables with your SettleMint credentials and infrastructure details.
157
+
158
+ You can use the `connect` command to automatically configure your project and select the services you want to connect to.
159
+
160
+ ```bash
161
+ settlemint connect
162
+ ```
163
+
164
+ #### Deploying your smart contracts and subgraphs
165
+
166
+ To deploy your smart contracts and subgraphs, you can use the `deploy` command.
167
+
168
+ ```bash
169
+ settlemint scs hardhat deploy remote --accept-defaults
170
+ ```
171
+
172
+ To deploy your subgraphs, use the `subgraph` command.
173
+
174
+ ```bash
175
+ settlemint scs subgraph deploy --accept-defaults <subgraph-name>
176
+ ```
177
+
178
+ #### Generating code for your dApp
179
+
180
+ After deploying your smart contracts and subgraphs, you can generate TypeScript code for your dApp to interact with them. The `codegen` command will generate type-safe code for your integrations with the services selected in the `connect` command.
181
+
182
+ ```bash
183
+ settlemint codegen
184
+ ```
185
+
186
+ #### Start your dApp in development mode
187
+
188
+ ```bash
189
+ bun run dev
190
+ ```
191
+
192
+ ### Creating a new project from a smart contract template
193
+
194
+ To create a new project from a smart contract template, use the `create` command with the `--use-case` flag:
195
+
196
+ ```bash
197
+ settlemint scs create --project-name <project-name> --use-case <use-case-name>
198
+ ```
199
+
200
+ #### Testing your smart contracts on a local network
201
+
202
+ To test your smart contracts, you can use the `test` command.
203
+
204
+ ```bash
205
+ settlemint scs foundry test
206
+ ```
207
+
208
+ #### Deploying your smart contracts and subgraphs
209
+
210
+ To deploy your smart contracts and subgraphs, you can use the `deploy` command.
211
+
212
+ ```bash
213
+ settlemint scs hardhat deploy remote --accept-defaults
214
+ ```
215
+
216
+ To deploy your subgraphs, use the `subgraph` command.
217
+
218
+ ```bash
219
+ settlemint scs subgraph deploy --accept-defaults <subgraph-name>
220
+ ```
221
+
222
+ ## API Reference
223
+
224
+ See the [documentation](https://github.com/settlemint/sdk/tree/v0.9.0/sdk/cli/docs/settlemint.md) for available commands.
225
+
226
+ ## Contributing
227
+
228
+ We welcome contributions from the community! Please check out our [Contributing](../../.github/CONTRIBUTING.md) guide to learn how you can help improve the SettleMint SDK through bug reports, feature requests, documentation updates, or code contributions.
63
229
 
64
- Create a ".env" file in the root folder of this project.
230
+ ## License
65
231
 
66
- ```env
67
- SETTLEMINT_ACCESS_TOKEN_E2E_TESTS="sm_pat_xxx"
68
- SETTLEMINT_INSTANCE="https://me.settlemint.be"
69
- DISABLE_WORKSPACE_DELETE=true
70
- ```
232
+ The SettleMint SDK is released under the [FSL Software License](https://fsl.software). See the [LICENSE](https://github.com/settlemint/sdk/blob/main/LICENSE) file for more details.