@5ive-tech/cli 1.0.4
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 +226 -0
- package/dist/assets/vm/five_vm_wasm.d.ts +762 -0
- package/dist/assets/vm/five_vm_wasm.js +3754 -0
- package/dist/assets/vm/five_vm_wasm_bg.wasm +0 -0
- package/dist/assets/vm/five_vm_wasm_bg.wasm.d.ts +247 -0
- package/dist/assets/vm/package.json +11 -0
- package/dist/cli.d.ts +47 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +343 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/analyze.d.ts +3 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +435 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/build.d.ts +3 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +66 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/compile.d.ts +3 -0
- package/dist/commands/compile.d.ts.map +1 -0
- package/dist/commands/compile.js +872 -0
- package/dist/commands/compile.js.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +431 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/deploy-and-execute.d.ts +3 -0
- package/dist/commands/deploy-and-execute.d.ts.map +1 -0
- package/dist/commands/deploy-and-execute.js +317 -0
- package/dist/commands/deploy-and-execute.js.map +1 -0
- package/dist/commands/deploy.d.ts +21 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +806 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/donate.d.ts +4 -0
- package/dist/commands/donate.d.ts.map +1 -0
- package/dist/commands/donate.js +104 -0
- package/dist/commands/donate.js.map +1 -0
- package/dist/commands/execute.d.ts +6 -0
- package/dist/commands/execute.d.ts.map +1 -0
- package/dist/commands/execute.js +749 -0
- package/dist/commands/execute.js.map +1 -0
- package/dist/commands/fmt.d.ts +3 -0
- package/dist/commands/fmt.d.ts.map +1 -0
- package/dist/commands/fmt.js +327 -0
- package/dist/commands/fmt.js.map +1 -0
- package/dist/commands/help.d.ts +6 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +224 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/index.d.ts +45 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +119 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +887 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/local.d.ts +3 -0
- package/dist/commands/local.d.ts.map +1 -0
- package/dist/commands/local.js +703 -0
- package/dist/commands/local.js.map +1 -0
- package/dist/commands/namespace.d.ts +3 -0
- package/dist/commands/namespace.d.ts.map +1 -0
- package/dist/commands/namespace.js +328 -0
- package/dist/commands/namespace.js.map +1 -0
- package/dist/commands/template.d.ts +4 -0
- package/dist/commands/template.d.ts.map +1 -0
- package/dist/commands/template.js +486 -0
- package/dist/commands/template.js.map +1 -0
- package/dist/commands/test.d.ts +6 -0
- package/dist/commands/test.d.ts.map +1 -0
- package/dist/commands/test.js +890 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/commands/version.d.ts +6 -0
- package/dist/commands/version.d.ts.map +1 -0
- package/dist/commands/version.js +339 -0
- package/dist/commands/version.js.map +1 -0
- package/dist/config/ConfigManager.d.ts +69 -0
- package/dist/config/ConfigManager.d.ts.map +1 -0
- package/dist/config/ConfigManager.js +261 -0
- package/dist/config/ConfigManager.js.map +1 -0
- package/dist/config/index.d.ts +10 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +21 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/types.d.ts +35 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +105 -0
- package/dist/config/types.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/project/ProjectLoader.d.ts +12 -0
- package/dist/project/ProjectLoader.d.ts.map +1 -0
- package/dist/project/ProjectLoader.js +115 -0
- package/dist/project/ProjectLoader.js.map +1 -0
- package/dist/types.d.ts +334 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/AccountFixtureGenerator.d.ts +48 -0
- package/dist/utils/AccountFixtureGenerator.d.ts.map +1 -0
- package/dist/utils/AccountFixtureGenerator.js +265 -0
- package/dist/utils/AccountFixtureGenerator.js.map +1 -0
- package/dist/utils/FiveFileManager.d.ts +96 -0
- package/dist/utils/FiveFileManager.d.ts.map +1 -0
- package/dist/utils/FiveFileManager.js +329 -0
- package/dist/utils/FiveFileManager.js.map +1 -0
- package/dist/utils/ascii-art.d.ts +72 -0
- package/dist/utils/ascii-art.d.ts.map +1 -0
- package/dist/utils/ascii-art.js +314 -0
- package/dist/utils/ascii-art.js.map +1 -0
- package/dist/utils/cli-ui.d.ts +39 -0
- package/dist/utils/cli-ui.d.ts.map +1 -0
- package/dist/utils/cli-ui.js +75 -0
- package/dist/utils/cli-ui.js.map +1 -0
- package/dist/utils/fileUtils.d.ts +25 -0
- package/dist/utils/fileUtils.d.ts.map +1 -0
- package/dist/utils/fileUtils.js +50 -0
- package/dist/utils/fileUtils.js.map +1 -0
- package/dist/utils/logger.d.ts +53 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +287 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/wasm/compiler.d.ts +101 -0
- package/dist/wasm/compiler.d.ts.map +1 -0
- package/dist/wasm/compiler.js +906 -0
- package/dist/wasm/compiler.js.map +1 -0
- package/dist/wasm/loader.d.ts +2 -0
- package/dist/wasm/loader.d.ts.map +1 -0
- package/dist/wasm/loader.js +90 -0
- package/dist/wasm/loader.js.map +1 -0
- package/dist/wasm/vm.d.ts +32 -0
- package/dist/wasm/vm.d.ts.map +1 -0
- package/dist/wasm/vm.js +440 -0
- package/dist/wasm/vm.js.map +1 -0
- package/package.json +100 -0
package/README.md
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# Five CLI
|
|
2
|
+
|
|
3
|
+
CLI for building, testing, deploying, and executing 5ive DSL programs.
|
|
4
|
+
|
|
5
|
+
This README is for external users working with:
|
|
6
|
+
- `five-cli`
|
|
7
|
+
- `five-sdk`
|
|
8
|
+
- [5ive frontend](https://5ive.tech)
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install -g @5ive-tech/cli
|
|
14
|
+
five --version
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or run without global install:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx @5ive-tech/cli --help
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
### 1) Initialize a project
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
five init my-program
|
|
29
|
+
cd my-program
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2) Compile to a `.five` artifact (recommended)
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
five compile src/main.v -o build/main.five
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The `.five` artifact contains bytecode and ABI and is the best default for deployment and SDK integration.
|
|
39
|
+
|
|
40
|
+
### 3) Run locally
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
five execute build/main.five --local -f 0
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 4) Configure on-chain target
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
five config init
|
|
50
|
+
five config set --target devnet
|
|
51
|
+
five config set --keypair ~/.config/solana/id.json
|
|
52
|
+
five config set --program-id <FIVE_VM_PROGRAM_ID> --target devnet
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 5) Deploy and execute on-chain
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
five deploy build/main.five --target devnet
|
|
59
|
+
five execute build/main.five --target devnet -f 0
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
If you already have a deployed script account:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
five execute --script-account <SCRIPT_ACCOUNT_PUBKEY> --target devnet -f 0
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Program ID Resolution
|
|
69
|
+
|
|
70
|
+
For on-chain commands (`deploy`, `execute`, `deploy-and-execute`, `namespace`), program ID precedence is:
|
|
71
|
+
|
|
72
|
+
1. `--program-id` flag
|
|
73
|
+
2. `five.toml` `[deploy].program_id`
|
|
74
|
+
3. `five config` stored value for current target
|
|
75
|
+
4. `FIVE_PROGRAM_ID` environment variable
|
|
76
|
+
|
|
77
|
+
If none are set, on-chain commands fail fast with a program ID setup error.
|
|
78
|
+
|
|
79
|
+
See: [PROGRAM_ID_SETUP.md](./PROGRAM_ID_SETUP.md)
|
|
80
|
+
|
|
81
|
+
## Standard Workflows
|
|
82
|
+
|
|
83
|
+
### Project build flow
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
five build
|
|
87
|
+
five deploy build/main.five --project .
|
|
88
|
+
five execute build/main.five --project . -f 0
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`five build` / `--project` use `five.toml` and the generated manifest to resolve artifacts.
|
|
92
|
+
|
|
93
|
+
### One-command deploy+execute (great for smoke tests)
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
five deploy-and-execute build/main.five --target devnet -f 0
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Run tests
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
five test --sdk-runner
|
|
103
|
+
five test tests/ --on-chain --target devnet
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Namespace operations
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
five namespace register @your-domain
|
|
110
|
+
five namespace bind @your-domain/program --script <SCRIPT_ACCOUNT_PUBKEY>
|
|
111
|
+
five namespace resolve @your-domain/program
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Advanced CLI Workflows (Optional)
|
|
115
|
+
|
|
116
|
+
Most teams can stay on the quick-start path. Use these features when you need deeper control.
|
|
117
|
+
|
|
118
|
+
### 1) Compile diagnostics and machine-readable metrics
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
five compile src/main.v \
|
|
122
|
+
--analyze \
|
|
123
|
+
--metrics-output build/compile-metrics.json \
|
|
124
|
+
--metrics-format json \
|
|
125
|
+
--error-format json
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 2) Project-aware execution from `five.toml` context
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
five execute --project . -f 0
|
|
132
|
+
five execute --project . -f 0 --params params.json --target devnet
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 3) Deploy large artifacts with chunk/optimization controls
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
five deploy build/main.five --target devnet --optimized --progress
|
|
139
|
+
five deploy build/main.five --target devnet --force-chunked --chunk-size 900
|
|
140
|
+
five deploy build/main.five --target devnet --dry-run --format json
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 4) Deploy-and-execute for fast integration checks
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
five deploy-and-execute build/main.five --target devnet -f 0 -p "[100]"
|
|
147
|
+
five deploy-and-execute src/main.v --target local --debug --cleanup
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### 5) Advanced test modes
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
five test --sdk-runner --format json
|
|
154
|
+
five test test-scripts/ --on-chain --target devnet --batch --analyze-costs
|
|
155
|
+
five test --watch --parallel 4
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 6) Namespace manager and lockfile modes
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# On-chain manager flow
|
|
162
|
+
five namespace register @acme --manager <MANAGER_SCRIPT_ACCOUNT>
|
|
163
|
+
five namespace bind @acme/payments --script <SCRIPT_ACCOUNT_PUBKEY> --manager <MANAGER_SCRIPT_ACCOUNT>
|
|
164
|
+
|
|
165
|
+
# Local lockfile-only flow (no manager RPC)
|
|
166
|
+
five namespace resolve @acme/payments --local
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### 7) Config layering and explicit RPC overrides
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
five config set --rpc-url https://api.devnet.solana.com --target devnet
|
|
173
|
+
five config set --show-config true
|
|
174
|
+
five deploy build/main.five --target devnet --network https://your-rpc.example.com
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Artifact and SDK Interop
|
|
178
|
+
|
|
179
|
+
`five-cli` and `five-sdk` work best with `.five` artifacts:
|
|
180
|
+
|
|
181
|
+
- Compile with CLI to `.five`
|
|
182
|
+
- Load and interact in SDK via ABI-aware helpers
|
|
183
|
+
- Use the same artifact in frontend flows on [5ive.tech](https://5ive.tech)
|
|
184
|
+
|
|
185
|
+
You can still use `.bin` where needed, but `.five` is the preferred default.
|
|
186
|
+
|
|
187
|
+
## Common Commands
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
five help <command>
|
|
191
|
+
five help compile
|
|
192
|
+
five help deploy
|
|
193
|
+
five help execute
|
|
194
|
+
five help config
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Troubleshooting
|
|
198
|
+
|
|
199
|
+
### `Program ID required` or `owner/program mismatch`
|
|
200
|
+
|
|
201
|
+
Set or override the VM program ID:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
five config set --program-id <FIVE_VM_PROGRAM_ID> --target devnet
|
|
205
|
+
# or
|
|
206
|
+
five deploy build/main.five --program-id <FIVE_VM_PROGRAM_ID> --target devnet
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### `Keypair file not found`
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
five config set --keypair ~/.config/solana/id.json
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Command-specific help from global help flow
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
five compile --help
|
|
219
|
+
five execute --help
|
|
220
|
+
five config --help
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Links
|
|
224
|
+
|
|
225
|
+
- Program ID setup: [PROGRAM_ID_SETUP.md](./PROGRAM_ID_SETUP.md)
|
|
226
|
+
- 5ive frontend: [5ive.tech](https://5ive.tech)
|