@5ive-tech/cli 1.0.6 → 1.0.8
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/README.md +62 -72
- package/package.json +5 -6
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 5IVE CLI
|
|
2
2
|
|
|
3
3
|
CLI for building, testing, deploying, and executing 5ive DSL programs.
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ CLI for building, testing, deploying, and executing 5ive DSL programs.
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install -g @5ive-tech/cli
|
|
9
|
-
|
|
9
|
+
5ive --version
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
Or run without global install:
|
|
@@ -20,14 +20,14 @@ npx @5ive-tech/cli --help
|
|
|
20
20
|
### 1) Initialize a project
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
|
|
23
|
+
5ive init my-program
|
|
24
24
|
cd my-program
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
### 2) Compile to a `.five` artifact (recommended)
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
|
|
30
|
+
5ive compile src/main.v -o build/main.five
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
The `.five` artifact contains bytecode and ABI and is the best default for deployment and SDK integration.
|
|
@@ -35,29 +35,29 @@ The `.five` artifact contains bytecode and ABI and is the best default for deplo
|
|
|
35
35
|
### 3) Run locally
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
|
|
38
|
+
5ive execute build/main.five --local -f 0
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
### 4) Configure on-chain target
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
5ive config init
|
|
45
|
+
5ive config set --target devnet
|
|
46
|
+
5ive config set --keypair ~/.config/solana/id.json
|
|
47
|
+
5ive config set --program-id <FIVE_VM_PROGRAM_ID> --target devnet
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
### 5) Deploy and execute on-chain
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
5ive deploy build/main.five --target devnet
|
|
54
|
+
5ive execute build/main.five --target devnet -f 0
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
If you already have a deployed script account:
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
|
|
60
|
+
5ive execute --script-account <SCRIPT_ACCOUNT_PUBKEY> --target devnet -f 0
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
## Program ID Resolution
|
|
@@ -66,7 +66,7 @@ For on-chain commands (`deploy`, `execute`, `deploy-and-execute`, `namespace`),
|
|
|
66
66
|
|
|
67
67
|
1. `--program-id` flag
|
|
68
68
|
2. `five.toml` `[deploy].program_id`
|
|
69
|
-
3. `
|
|
69
|
+
3. `5ive config` stored value for current target
|
|
70
70
|
4. `FIVE_PROGRAM_ID` environment variable
|
|
71
71
|
|
|
72
72
|
If none are set, on-chain commands fail fast with a program ID setup error.
|
|
@@ -76,139 +76,129 @@ If none are set, on-chain commands fail fast with a program ID setup error.
|
|
|
76
76
|
### Project build flow
|
|
77
77
|
|
|
78
78
|
```bash
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
5ive build
|
|
80
|
+
5ive deploy build/main.five --project .
|
|
81
|
+
5ive execute build/main.five --project . -f 0
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
`
|
|
84
|
+
`5ive build` / `--project` use `five.toml` and the generated manifest to resolve artifacts.
|
|
85
85
|
|
|
86
|
-
### One-command deploy+execute (
|
|
86
|
+
### One-command deploy+execute (smoke tests)
|
|
87
87
|
|
|
88
88
|
```bash
|
|
89
|
-
|
|
89
|
+
5ive deploy-and-execute build/main.five --target devnet -f 0
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
### Run tests
|
|
93
93
|
|
|
94
94
|
```bash
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
5ive test --sdk-runner
|
|
96
|
+
5ive test tests/ --on-chain --target devnet
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
### Namespace operations
|
|
100
100
|
|
|
101
101
|
```bash
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
5ive namespace register @your-domain
|
|
103
|
+
5ive namespace bind @your-domain/program --script <SCRIPT_ACCOUNT_PUBKEY>
|
|
104
|
+
5ive namespace resolve @your-domain/program
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
## Advanced
|
|
107
|
+
## Advanced Workflows (Optional)
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
### 1) Compile diagnostics and machine-readable metrics
|
|
109
|
+
### Compile diagnostics and machine-readable metrics
|
|
112
110
|
|
|
113
111
|
```bash
|
|
114
|
-
|
|
112
|
+
5ive compile src/main.v \
|
|
115
113
|
--analyze \
|
|
116
114
|
--metrics-output build/compile-metrics.json \
|
|
117
115
|
--metrics-format json \
|
|
118
116
|
--error-format json
|
|
119
117
|
```
|
|
120
118
|
|
|
121
|
-
###
|
|
119
|
+
### Project-aware execution from `five.toml` context
|
|
122
120
|
|
|
123
121
|
```bash
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
5ive execute --project . -f 0
|
|
123
|
+
5ive execute --project . -f 0 --params params.json --target devnet
|
|
126
124
|
```
|
|
127
125
|
|
|
128
|
-
###
|
|
126
|
+
### Deploy large artifacts with chunk/optimization controls
|
|
129
127
|
|
|
130
128
|
```bash
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
5ive deploy build/main.five --target devnet --optimized --progress
|
|
130
|
+
5ive deploy build/main.five --target devnet --force-chunked --chunk-size 900
|
|
131
|
+
5ive deploy build/main.five --target devnet --dry-run --format json
|
|
134
132
|
```
|
|
135
133
|
|
|
136
|
-
###
|
|
134
|
+
### Deploy-and-execute for fast integration checks
|
|
137
135
|
|
|
138
136
|
```bash
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
5ive deploy-and-execute build/main.five --target devnet -f 0 -p "[100]"
|
|
138
|
+
5ive deploy-and-execute src/main.v --target local --debug --cleanup
|
|
141
139
|
```
|
|
142
140
|
|
|
143
|
-
###
|
|
141
|
+
### Advanced test modes
|
|
144
142
|
|
|
145
143
|
```bash
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
5ive test --sdk-runner --format json
|
|
145
|
+
5ive test test-scripts/ --on-chain --target devnet --batch --analyze-costs
|
|
146
|
+
5ive test --watch --parallel 4
|
|
149
147
|
```
|
|
150
148
|
|
|
151
|
-
###
|
|
149
|
+
### Namespace manager and lockfile modes
|
|
152
150
|
|
|
153
151
|
```bash
|
|
154
152
|
# On-chain manager flow
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
5ive namespace register @acme --manager <MANAGER_SCRIPT_ACCOUNT>
|
|
154
|
+
5ive namespace bind @acme/payments --script <SCRIPT_ACCOUNT_PUBKEY> --manager <MANAGER_SCRIPT_ACCOUNT>
|
|
157
155
|
|
|
158
156
|
# Local lockfile-only flow (no manager RPC)
|
|
159
|
-
|
|
157
|
+
5ive namespace resolve @acme/payments --local
|
|
160
158
|
```
|
|
161
159
|
|
|
162
|
-
###
|
|
160
|
+
### Config layering and explicit RPC overrides
|
|
163
161
|
|
|
164
162
|
```bash
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
5ive config set --rpc-url https://api.devnet.solana.com --target devnet
|
|
164
|
+
5ive config set --show-config true
|
|
165
|
+
5ive deploy build/main.five --target devnet --network https://your-rpc.example.com
|
|
168
166
|
```
|
|
169
167
|
|
|
170
168
|
## Artifact and SDK Interop
|
|
171
169
|
|
|
172
|
-
`@5ive-tech/cli` and `@5ive-tech/sdk` work best with `.five` artifacts
|
|
173
|
-
|
|
174
|
-
- Compile with CLI to `.five`
|
|
175
|
-
- Load and interact in SDK via ABI-aware helpers
|
|
176
|
-
- Use the same artifact in frontend flows on [5ive.tech](https://5ive.tech)
|
|
177
|
-
|
|
178
|
-
You can still use `.bin` where needed, but `.five` is the preferred default.
|
|
170
|
+
`@5ive-tech/cli` and `@5ive-tech/sdk` work best with `.five` artifacts.
|
|
179
171
|
|
|
180
172
|
## Common Commands
|
|
181
173
|
|
|
182
174
|
```bash
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
175
|
+
5ive help <command>
|
|
176
|
+
5ive help compile
|
|
177
|
+
5ive help deploy
|
|
178
|
+
5ive help execute
|
|
179
|
+
5ive help config
|
|
188
180
|
```
|
|
189
181
|
|
|
190
182
|
## Troubleshooting
|
|
191
183
|
|
|
192
184
|
### `Program ID required` or `owner/program mismatch`
|
|
193
185
|
|
|
194
|
-
Set or override the VM program ID:
|
|
195
|
-
|
|
196
186
|
```bash
|
|
197
|
-
|
|
187
|
+
5ive config set --program-id <FIVE_VM_PROGRAM_ID> --target devnet
|
|
198
188
|
# or
|
|
199
|
-
|
|
189
|
+
5ive deploy build/main.five --program-id <FIVE_VM_PROGRAM_ID> --target devnet
|
|
200
190
|
```
|
|
201
191
|
|
|
202
192
|
### `Keypair file not found`
|
|
203
193
|
|
|
204
194
|
```bash
|
|
205
|
-
|
|
195
|
+
5ive config set --keypair ~/.config/solana/id.json
|
|
206
196
|
```
|
|
207
197
|
|
|
208
|
-
### Command-specific help
|
|
198
|
+
### Command-specific help
|
|
209
199
|
|
|
210
200
|
```bash
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
201
|
+
5ive compile --help
|
|
202
|
+
5ive execute --help
|
|
203
|
+
5ive config --help
|
|
214
204
|
```
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@5ive-tech/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "High-performance CLI for Five VM development with WebAssembly integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"
|
|
9
|
-
"five
|
|
8
|
+
"5ive": "dist/index.js",
|
|
9
|
+
"five": "dist/index.js"
|
|
10
10
|
},
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=18.0.0"
|
|
@@ -33,8 +33,7 @@
|
|
|
33
33
|
"lint": "eslint src/**/*.ts",
|
|
34
34
|
"format": "prettier --write src/**/*.ts",
|
|
35
35
|
"dev": "npm run build:js:dev",
|
|
36
|
-
"prepublishOnly": "npm run build"
|
|
37
|
-
"postinstall": "npm run verify:wasm || npm run sync:wasm"
|
|
36
|
+
"prepublishOnly": "npm run build"
|
|
38
37
|
},
|
|
39
38
|
"files": [
|
|
40
39
|
"dist/",
|
|
@@ -79,7 +78,7 @@
|
|
|
79
78
|
"ora": "^8.0.1",
|
|
80
79
|
"semver": "^7.6.0",
|
|
81
80
|
"ws": "^8.16.0",
|
|
82
|
-
"@5ive-tech/sdk": "^1.1.
|
|
81
|
+
"@5ive-tech/sdk": "^1.1.4"
|
|
83
82
|
},
|
|
84
83
|
"devDependencies": {
|
|
85
84
|
"@types/fs-extra": "^11.0.4",
|