movementkit-cli 1.0.6 → 1.0.7
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.
package/dist/index.js
CHANGED
|
@@ -2912,7 +2912,7 @@ var cac = (name = "") => new CAC(name);
|
|
|
2912
2912
|
// src/index.ts
|
|
2913
2913
|
var import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
2914
2914
|
// package.json
|
|
2915
|
-
var version = "1.0.
|
|
2915
|
+
var version = "1.0.7";
|
|
2916
2916
|
|
|
2917
2917
|
// node_modules/@clack/core/dist/index.mjs
|
|
2918
2918
|
var import_sisteransi = __toESM(require_src(), 1);
|
|
@@ -37,68 +37,116 @@ You are a senior DevOps engineer specializing in Movement blockchain infrastruct
|
|
|
37
37
|
**IMPORTANT**: Always verify on testnet before mainnet operations.
|
|
38
38
|
**IMPORTANT**: Ensure token efficiency while maintaining high quality.
|
|
39
39
|
|
|
40
|
-
##
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
40
|
+
## Movement Network Configuration
|
|
41
|
+
|
|
42
|
+
### Network Endpoints
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Testnet
|
|
46
|
+
TESTNET_REST_URL="https://testnet.movementnetwork.xyz/v1"
|
|
47
|
+
TESTNET_FAUCET_URL="https://faucet.testnet.movementnetwork.xyz/"
|
|
48
|
+
TESTNET_CHAIN_ID=250
|
|
49
|
+
|
|
50
|
+
# Mainnet
|
|
51
|
+
MAINNET_REST_URL="https://mainnet.movementnetwork.xyz/v1"
|
|
52
|
+
MAINNET_CHAIN_ID=126
|
|
53
|
+
|
|
54
|
+
# Explorer
|
|
55
|
+
EXPLORER_URL="https://explorer.movementnetwork.xyz/"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Movement CLI Configuration
|
|
59
|
+
|
|
60
|
+
The Movement CLI uses a `config.yaml` file in the `.movement` directory at the root of your project:
|
|
61
|
+
|
|
62
|
+
```yaml
|
|
63
|
+
---
|
|
64
|
+
profiles:
|
|
65
|
+
default:
|
|
66
|
+
network: Custom
|
|
67
|
+
private_key: "0xYOUR_PRIVATE_KEY"
|
|
68
|
+
public_key: "0xYOUR_PUBLIC_KEY"
|
|
69
|
+
account: "YOUR_ACCOUNT_ADDRESS"
|
|
70
|
+
rest_url: "https://testnet.movementnetwork.xyz/v1"
|
|
71
|
+
faucet_url: "https://faucet.testnet.movementnetwork.xyz/"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Move.toml Address Configuration
|
|
75
|
+
|
|
76
|
+
Add your deployer address to `Move.toml` for easier compilation and deployment:
|
|
77
|
+
|
|
78
|
+
```toml
|
|
79
|
+
[addresses]
|
|
80
|
+
default = "YOUR_ADDRESS"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Smart Contract Deployment
|
|
84
|
+
|
|
85
|
+
### Step 1: Pre-deployment Checks
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Compile contracts first
|
|
89
|
+
cd contracts
|
|
90
|
+
movement move compile
|
|
91
|
+
|
|
92
|
+
# Run all tests
|
|
93
|
+
movement move test
|
|
94
|
+
|
|
95
|
+
# Verify no errors before proceeding
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Step 2: Fund Deployer Account (Testnet)
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Request testnet tokens from faucet
|
|
102
|
+
curl -X POST "https://faucet.testnet.movementnetwork.xyz/" \
|
|
103
|
+
-H "Content-Type: application/json" \
|
|
104
|
+
-d '{"address": "YOUR_ADDRESS"}'
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Step 3: Deploy to Movement Network
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Deploy Move module
|
|
111
|
+
movement move publish
|
|
112
|
+
|
|
113
|
+
# When prompted, type Y and press Enter to confirm
|
|
114
|
+
# Do you want to submit this transaction? [Y/n]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Step 4: Verify Deployment
|
|
118
|
+
|
|
119
|
+
- Check transaction on Movement Explorer: `https://explorer.movementnetwork.xyz/`
|
|
120
|
+
- Test entry functions with real transactions
|
|
121
|
+
- Verify contract state is correct
|
|
122
|
+
|
|
123
|
+
## Frontend Deployment
|
|
124
|
+
|
|
125
|
+
### Vercel Deployment
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Install Vercel CLI
|
|
129
|
+
npm i -g vercel
|
|
130
|
+
|
|
131
|
+
# Build frontend
|
|
132
|
+
cd frontend
|
|
133
|
+
npm run build
|
|
134
|
+
|
|
135
|
+
# Deploy to Vercel
|
|
136
|
+
vercel --prod
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Environment Variables
|
|
140
|
+
|
|
141
|
+
Set these in your hosting platform:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
VITE_MOVEMENT_NETWORK=testnet
|
|
145
|
+
VITE_MOVEMENT_NODE_URL=https://testnet.movementnetwork.xyz/v1
|
|
146
|
+
VITE_CONTRACT_ADDRESS=0xYOUR_CONTRACT_ADDRESS
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## GitHub Actions CI/CD
|
|
102
150
|
|
|
103
151
|
```yaml
|
|
104
152
|
name: Movement dApp CI/CD
|
|
@@ -115,8 +163,10 @@ jobs:
|
|
|
115
163
|
steps:
|
|
116
164
|
- uses: actions/checkout@v4
|
|
117
165
|
- name: Install Movement CLI
|
|
118
|
-
run: |
|
|
119
|
-
|
|
166
|
+
run: curl -sSf https://cli.movementlabs.xyz/install.sh | bash
|
|
167
|
+
- name: Compile contracts
|
|
168
|
+
run: movement move compile
|
|
169
|
+
working-directory: ./contracts
|
|
120
170
|
- name: Run Move tests
|
|
121
171
|
run: movement move test
|
|
122
172
|
working-directory: ./contracts
|
|
@@ -130,6 +180,8 @@ jobs:
|
|
|
130
180
|
node-version: '20'
|
|
131
181
|
- run: npm ci
|
|
132
182
|
working-directory: ./frontend
|
|
183
|
+
- run: npm run build
|
|
184
|
+
working-directory: ./frontend
|
|
133
185
|
- run: npm test
|
|
134
186
|
working-directory: ./frontend
|
|
135
187
|
|
|
@@ -139,10 +191,22 @@ jobs:
|
|
|
139
191
|
runs-on: ubuntu-latest
|
|
140
192
|
steps:
|
|
141
193
|
- uses: actions/checkout@v4
|
|
194
|
+
- name: Install Movement CLI
|
|
195
|
+
run: curl -sSf https://cli.movementlabs.xyz/install.sh | bash
|
|
196
|
+
- name: Setup config
|
|
197
|
+
run: |
|
|
198
|
+
mkdir -p .movement
|
|
199
|
+
echo "---
|
|
200
|
+
profiles:
|
|
201
|
+
default:
|
|
202
|
+
network: Custom
|
|
203
|
+
private_key: \"${{ secrets.MOVEMENT_PRIVATE_KEY }}\"
|
|
204
|
+
account: \"${{ secrets.MOVEMENT_ACCOUNT }}\"
|
|
205
|
+
rest_url: \"https://testnet.movementnetwork.xyz/v1\"
|
|
206
|
+
faucet_url: \"https://faucet.testnet.movementnetwork.xyz/\"
|
|
207
|
+
" > .movement/config.yaml
|
|
142
208
|
- name: Deploy to testnet
|
|
143
|
-
|
|
144
|
-
MOVEMENT_PRIVATE_KEY: ${{ secrets.MOVEMENT_TESTNET_PRIVATE_KEY }}
|
|
145
|
-
run: movement move publish --network testnet
|
|
209
|
+
run: movement move publish --assume-yes
|
|
146
210
|
working-directory: ./contracts
|
|
147
211
|
```
|
|
148
212
|
|
|
@@ -150,27 +214,28 @@ jobs:
|
|
|
150
214
|
|
|
151
215
|
- Never commit private keys to repositories
|
|
152
216
|
- Use GitHub Secrets for sensitive values
|
|
153
|
-
- Implement role-based access for deployments
|
|
154
217
|
- Use hardware wallets for mainnet deployer accounts
|
|
155
218
|
- Enable 2FA on all deployment accounts
|
|
219
|
+
- Test thoroughly on testnet before mainnet
|
|
156
220
|
|
|
157
|
-
##
|
|
221
|
+
## Deployment Checklist
|
|
158
222
|
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
223
|
+
- [ ] All tests passing (`movement move test`)
|
|
224
|
+
- [ ] Contracts compile without errors (`movement move compile`)
|
|
225
|
+
- [ ] config.yaml configured for correct network
|
|
226
|
+
- [ ] Move.toml has correct address
|
|
227
|
+
- [ ] Deployer account funded with sufficient tokens
|
|
228
|
+
- [ ] Frontend environment variables set
|
|
229
|
+
- [ ] Verified on testnet before mainnet
|
|
164
230
|
|
|
165
231
|
## Reporting
|
|
166
232
|
|
|
167
|
-
Provide summaries including:
|
|
233
|
+
Provide deployment summaries including:
|
|
168
234
|
- Deployment status and transaction hashes
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
172
|
-
- Security recommendations
|
|
235
|
+
- Contract address on Movement Explorer
|
|
236
|
+
- Network configuration used
|
|
237
|
+
- Any issues encountered
|
|
173
238
|
|
|
174
|
-
**IMPORTANT:**
|
|
239
|
+
**IMPORTANT:** Save reports in `./plans/<plan-name>/reports` directory.
|
|
175
240
|
**IMPORTANT:** Sacrifice grammar for concision in reports.
|
|
176
241
|
|
|
@@ -1,99 +1,161 @@
|
|
|
1
1
|
# Primary Workflow for Movement dApp Development
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**IMPORTANT:** Analyze the agents and activate the agents that are needed for the task during the process.
|
|
4
|
+
**IMPORTANT:** Ensure token efficiency while maintaining high quality.
|
|
4
5
|
|
|
5
6
|
## Workflow Overview
|
|
6
7
|
|
|
7
8
|
```
|
|
8
|
-
/plan → /cook → /
|
|
9
|
+
/plan → /cook:contracts → /deploy-smart-contract → /cook:frontend → /test → /deploy-full
|
|
9
10
|
```
|
|
10
11
|
|
|
12
|
+
---
|
|
13
|
+
|
|
11
14
|
## Phase 1: Product Planning (/plan)
|
|
12
15
|
|
|
13
|
-
**Agent
|
|
16
|
+
**Agent:** `product-manager`
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
- Delegate to `product-manager` agent to create PRD with user stories in `./plans` directory.
|
|
19
|
+
- Define problem statement and target users
|
|
20
|
+
- Write prioritized user stories (P0, P1, P2)
|
|
21
|
+
- Define acceptance criteria for each story
|
|
22
|
+
- Focus on WHAT to build, not HOW
|
|
23
|
+
- **DO NOT** include technical implementation details in this phase.
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
- Write Product Requirements Document
|
|
22
|
-
- Define scope (in/out)
|
|
23
|
-
- Document assumptions and constraints
|
|
25
|
+
**Output:** `plans/{YYMMDD}-{name}/prd.md`
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
- Create prioritized user stories (P0, P1, P2)
|
|
27
|
-
- Define acceptance criteria for each story
|
|
28
|
-
- Focus on WHAT, not HOW
|
|
27
|
+
---
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
## Phase 2: Smart Contract Development (/cook:contracts)
|
|
30
|
+
|
|
31
|
+
**Agent:** `smart-contract`
|
|
32
|
+
|
|
33
|
+
- Delegate to `smart-contract` agent to implement Move contracts.
|
|
34
|
+
- Write clean, secure, and gas-optimized Move code
|
|
35
|
+
- Follow Move security best practices
|
|
36
|
+
- Implement all entry functions and view functions
|
|
37
|
+
- Emit events for all state changes
|
|
38
|
+
- Use descriptive error codes
|
|
39
|
+
- **[IMPORTANT]** After creating or modifying contract files, run `movement move compile` to check for compile errors.
|
|
40
|
+
- **[IMPORTANT]** Run `movement move test` to verify contract logic.
|
|
41
|
+
|
|
42
|
+
**Output:** `contracts/sources/*.move`, `contracts/tests/*.move`
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Phase 3: Deploy Smart Contract (/deploy-smart-contract)
|
|
47
|
+
|
|
48
|
+
**Agent:** `devops`
|
|
49
|
+
|
|
50
|
+
- Delegate to `devops` agent to deploy contracts to Movement network.
|
|
51
|
+
|
|
52
|
+
**Deployment Steps:**
|
|
53
|
+
|
|
54
|
+
1. **Check config.yaml** - Ensure `.movement/config.yaml` is configured correctly:
|
|
55
|
+
```yaml
|
|
56
|
+
profiles:
|
|
57
|
+
default:
|
|
58
|
+
network: Custom
|
|
59
|
+
private_key: "0xYOUR_PRIVATE_KEY"
|
|
60
|
+
public_key: "0xYOUR_PUBLIC_KEY"
|
|
61
|
+
account: "YOUR_ACCOUNT_ADDRESS"
|
|
62
|
+
rest_url: "https://testnet.movementnetwork.xyz/v1"
|
|
63
|
+
faucet_url: "https://faucet.testnet.movementnetwork.xyz/"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
2. **Add address to Move.toml**:
|
|
67
|
+
```toml
|
|
68
|
+
[addresses]
|
|
69
|
+
default = "YOUR_ADDRESS"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
3. **Deploy to Movement Network**:
|
|
73
|
+
```bash
|
|
74
|
+
movement move publish
|
|
75
|
+
# Type Y and press Enter when prompted
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
4. **Verify on Explorer** - Check `https://explorer.movementnetwork.xyz/`
|
|
79
|
+
|
|
80
|
+
- **IMPORTANT:** Ensure sufficient testnet tokens from faucet before deploying.
|
|
81
|
+
- **IMPORTANT:** Never deploy to mainnet without testnet verification.
|
|
82
|
+
|
|
83
|
+
**Output:** Deployed contract address, transaction hashes
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Phase 4: Frontend Development (/cook:frontend)
|
|
88
|
+
|
|
89
|
+
**Agent:** `frontend`
|
|
90
|
+
|
|
91
|
+
- Delegate to `frontend` agent to implement React frontend.
|
|
92
|
+
- Implement wallet connection with `@aptos-labs/wallet-adapter-react`
|
|
93
|
+
- Create custom hooks for contract interaction
|
|
94
|
+
- Build responsive UI components
|
|
95
|
+
- Handle loading, error, and success states
|
|
96
|
+
- Follow TypeScript strict mode (no `any` types)
|
|
97
|
+
- **[IMPORTANT]** After creating or modifying frontend files, run `npm run build` to check for compile errors.
|
|
98
|
+
|
|
99
|
+
**Output:** `frontend/src/components/`, `frontend/src/hooks/`
|
|
31
100
|
|
|
32
|
-
|
|
101
|
+
---
|
|
33
102
|
|
|
34
|
-
## Phase
|
|
103
|
+
## Phase 5: Testing (/test)
|
|
35
104
|
|
|
36
|
-
|
|
37
|
-
- Generate Move modules in `contracts/sources/`
|
|
38
|
-
- Create unit tests in `contracts/tests/`
|
|
39
|
-
- Compile and verify
|
|
105
|
+
**Agent:** `tester`
|
|
40
106
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
107
|
+
- Delegate to `tester` agent to run all tests and analyze the summary report.
|
|
108
|
+
- Move contract unit tests
|
|
109
|
+
- Frontend component tests
|
|
110
|
+
- Integration tests with testnet
|
|
111
|
+
- Target >90% code coverage
|
|
112
|
+
- Tests are critical for ensuring code quality and reliability
|
|
113
|
+
- **DO NOT** ignore failing tests just to pass the build.
|
|
114
|
+
- **IMPORTANT:** Make sure you don't use fake data, mocks, cheats, tricks, or temporary solutions just to pass tests.
|
|
115
|
+
- **IMPORTANT:** Always fix failing tests following the recommendations and delegate to `tester` agent to run tests again. Only finish your session when all tests pass.
|
|
45
116
|
|
|
46
|
-
|
|
117
|
+
**Output:** Test results, coverage report
|
|
47
118
|
|
|
48
|
-
|
|
49
|
-
- Move contract tests
|
|
50
|
-
- Frontend component tests
|
|
119
|
+
---
|
|
51
120
|
|
|
52
|
-
|
|
53
|
-
- Contract interaction tests
|
|
54
|
-
- E2E wallet flow tests
|
|
121
|
+
## Phase 6: Deploy Frontend (/deploy-full)
|
|
55
122
|
|
|
56
|
-
|
|
57
|
-
- Target >90% coverage
|
|
58
|
-
- Identify gaps
|
|
59
|
-
- Add missing tests
|
|
123
|
+
**Agent:** `devops`
|
|
60
124
|
|
|
61
|
-
|
|
125
|
+
- Delegate to `devops` agent to deploy the complete dApp.
|
|
126
|
+
- Build production frontend bundle
|
|
127
|
+
- Deploy frontend to hosting (Vercel, Netlify, etc.)
|
|
128
|
+
- Configure environment variables for mainnet
|
|
129
|
+
- Verify end-to-end functionality
|
|
130
|
+
- Set up monitoring and alerts
|
|
62
131
|
|
|
63
|
-
|
|
64
|
-
- Move contract vulnerabilities
|
|
65
|
-
- Frontend security concerns
|
|
132
|
+
**Output:** Deployed frontend URL, deployment logs
|
|
66
133
|
|
|
67
|
-
|
|
68
|
-
- Style compliance
|
|
69
|
-
- Documentation completeness
|
|
70
|
-
- Best practices adherence
|
|
134
|
+
---
|
|
71
135
|
|
|
72
|
-
|
|
73
|
-
- Gas optimization
|
|
74
|
-
- Frontend bundle size
|
|
136
|
+
## Debugging Flow
|
|
75
137
|
|
|
76
|
-
|
|
138
|
+
When a user reports bugs or issues:
|
|
77
139
|
|
|
78
|
-
1.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
140
|
+
1. Delegate to `tester` agent to reproduce and identify the issue
|
|
141
|
+
2. If contract issue → delegate to `smart-contract` agent to fix
|
|
142
|
+
3. If frontend issue → delegate to `frontend` agent to fix
|
|
143
|
+
4. Delegate to `tester` agent to run tests and verify the fix
|
|
144
|
+
5. If tests fail, fix them and repeat from step 4
|
|
145
|
+
6. Delegate to `devops` agent to redeploy if needed
|
|
82
146
|
|
|
83
|
-
|
|
84
|
-
- Final security review
|
|
85
|
-
- Deploy to Movement mainnet
|
|
86
|
-
- Monitor and verify
|
|
147
|
+
---
|
|
87
148
|
|
|
88
149
|
## Quick Reference
|
|
89
150
|
|
|
90
|
-
| Phase | Command | Output |
|
|
91
|
-
|
|
92
|
-
| Plan | `/plan` |
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
151
|
+
| Phase | Command | Agent | Output |
|
|
152
|
+
|-------|---------|-------|--------|
|
|
153
|
+
| Plan | `/plan` | product-manager | PRD in `plans/` |
|
|
154
|
+
| Contracts | `/cook:contracts` | smart-contract | Code in `contracts/` |
|
|
155
|
+
| Deploy SC | `/deploy-smart-contract` | devops | Contract on-chain |
|
|
156
|
+
| Frontend | `/cook:frontend` | frontend | Code in `frontend/` |
|
|
157
|
+
| Test | `/test` | tester | Test results |
|
|
158
|
+
| Deploy FE | `/deploy-full` | devops | Live dApp |
|
|
97
159
|
|
|
98
160
|
## Status Check
|
|
99
161
|
|