@vention/vention-cli 0.29.3 → 0.29.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.
Files changed (2) hide show
  1. package/README.md +51 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -18,6 +18,7 @@
18
18
  - **Local IDE development**: Edit MachineLogic Python apps in your preferred IDE with full tooling support
19
19
  - **Bidirectional sync**: Pull apps from MachineBuilder and push changes back seamlessly
20
20
  - **Active design detection**: Automatically finds and connects to designs with MachineLogic tab open
21
+ - **Application logs**: Fetch your application's logs from the digital twin without leaving the terminal
21
22
  - **Smart file handling**: Automatically ignores build artifacts, virtual environments, and common development files
22
23
  - **Session management**: Persistent authentication with secure token storage
23
24
  - **Multiple apps support**: Link and switch between different apps within the same design
@@ -52,7 +53,7 @@ OAuth-based authentication opens a browser window for secure login. Session toke
52
53
  ## ⚙️ Installation & Setup
53
54
 
54
55
  **Requirements:**
55
- - Node.js 16 or higher
56
+ - Node.js 18 or higher
56
57
  - npm or yarn
57
58
  - Active MachineBuilder session with MachineLogic tab open
58
59
 
@@ -96,7 +97,7 @@ The CLI will:
96
97
  - Let you select a design
97
98
  - Display MachineLogic Python apps in that design
98
99
  - Let you select an app to pull
99
- - Create a folder named after the app with all source files
100
+ - Create a folder named after the app with all source files (special characters in the name are replaced with underscores)
100
101
 
101
102
  **Step 4: Edit locally**
102
103
  Open the created folder in your IDE and edit files like `main.py` or `project.json`.
@@ -142,6 +143,16 @@ To link your current directory to a different app:
142
143
  1. Delete the `.machine-code-app-directory-info.json` file
143
144
  2. Run `vention link` or `vention pull` and select the new app
144
145
 
146
+ ### View your application's logs
147
+
148
+ If your directory is linked and the design is active in MachineBuilder:
149
+
150
+ ```bash
151
+ vention logs
152
+ ```
153
+
154
+ This fetches the application's logs from the digital twin and prints them to your terminal.
155
+
145
156
  ### View help for any command
146
157
 
147
158
  ```bash
@@ -152,7 +163,7 @@ vention push --help
152
163
 
153
164
  ### Work with multiple environments
154
165
 
155
- The CLI stores the environment (e.g., `prod`, `staging`) in the link metadata file. To switch environments, re-link to the desired environment.
166
+ The CLI stores the environment (`local`, `demo`, or `prod`) in the link metadata file. The environment is set when you log in and defaults to `prod`.
156
167
 
157
168
  ---
158
169
 
@@ -163,6 +174,7 @@ The CLI stores the environment (e.g., `prod`, `staging`) in the link metadata fi
163
174
  ```bash
164
175
  vention --help # Display help information
165
176
  vention --version # Display CLI version
177
+ vention --verbose # Enable verbose output for debugging (use with any command)
166
178
  ```
167
179
 
168
180
  ### `vention login`
@@ -177,7 +189,7 @@ vention login
177
189
  **Behavior:**
178
190
  - Opens a browser window for secure OAuth authentication
179
191
  - Stores session tokens in `~/.vention-cli-config.json`
180
- - Tokens persist across terminal sessions
192
+ - Tokens persist across terminal sessions and are refreshed automatically
181
193
 
182
194
  **Exit codes:**
183
195
  - `0`: Authentication successful
@@ -198,6 +210,7 @@ vention pull
198
210
  - If the directory is not linked: prompts for design and app selection, creates a new folder
199
211
  - If the directory is already linked: updates files in place using stored link metadata
200
212
  - Downloads all source files except ignored patterns
213
+ - Writes read-only `.vention-design-configuration.json` and `.vention-design-scene-assets.json` reference files (the latter only when the design has scene assets)
201
214
  - Writes/updates `.machine-code-app-directory-info.json`
202
215
  - Updates `lastPulledAt` timestamp
203
216
 
@@ -222,19 +235,19 @@ vention push
222
235
  ```
223
236
 
224
237
  **Behavior:**
238
+ - If the directory is not linked: offers to link it to an application and continue the push
225
239
  - Reads `.machine-code-app-directory-info.json` to identify target design/app
226
240
  - Serializes all local files except ignored patterns
227
241
  - Uploads to MachineBuilder
228
242
  - Updates `lastPushedAt` timestamp
229
243
 
230
244
  **Prerequisites:**
231
- - Directory must be linked (contains `.machine-code-app-directory-info.json`)
232
245
  - User must be logged in
233
246
  - The same design must be active in MachineBuilder (MachineLogic tab open)
234
247
 
235
248
  **Exit codes:**
236
- - `0`: Push successful
237
- - `1`: Not linked, not logged in, design not active, or push failed
249
+ - `0`: Push successful, or push cancelled at the link prompt
250
+ - `1`: Not logged in, design not active, or push failed
238
251
 
239
252
  ---
240
253
 
@@ -260,6 +273,31 @@ vention link
260
273
 
261
274
  ---
262
275
 
276
+ ### `vention logs`
277
+
278
+ **Description:** Fetch application logs from the linked digital twin.
279
+
280
+ **Usage:**
281
+ ```bash
282
+ vention logs
283
+ ```
284
+
285
+ **Behavior:**
286
+ - Reads `.machine-code-app-directory-info.json` to identify the target design/app
287
+ - Fetches the application's logs from the digital twin
288
+ - Prints the logs to the terminal
289
+
290
+ **Prerequisites:**
291
+ - Directory must be linked (contains `.machine-code-app-directory-info.json`)
292
+ - User must be logged in
293
+ - The same design must be active in MachineBuilder (MachineLogic tab open)
294
+
295
+ **Exit codes:**
296
+ - `0`: Logs fetched successfully
297
+ - `1`: Not linked, not logged in, design not active, or fetch failed
298
+
299
+ ---
300
+
263
301
  ### Link Metadata File
264
302
 
265
303
  **Location:** `.machine-code-app-directory-info.json` (project root)
@@ -282,8 +320,8 @@ vention link
282
320
  - `designId` (number): Unique design identifier
283
321
  - `applicationId` (string): Unique application identifier
284
322
  - `uuid` (string, optional): App UUID if available
285
- - `environment` (string): Target environment (e.g., `prod`, `staging`)
286
- - `lastPulledAt` (ISO 8601 timestamp): Last successful pull time
323
+ - `environment` (string): Target environment (one of `local`, `demo`, `prod`)
324
+ - `lastPulledAt` (ISO 8601 timestamp): Last successful pull time (also set when the directory is first linked)
287
325
  - `lastPushedAt` (ISO 8601 timestamp): Last successful push time
288
326
 
289
327
  ---
@@ -300,9 +338,9 @@ vention link
300
338
  - **Cause:** No designs have the MachineLogic tab open in MachineBuilder
301
339
  - **Solution:** Open your target design in MachineBuilder and click the MachineLogic tab to activate it
302
340
 
303
- **"This directory is not linked …" (during push)**
341
+ **"This directory is not linked …"**
304
342
  - **Cause:** The directory doesn't have `.machine-code-app-directory-info.json`
305
- - **Solution:** Run `vention link` or `vention pull` to establish the link
343
+ - **Solution:** Run `vention link` or `vention pull` to establish the link. During `push`, the CLI will offer to link the directory and continue automatically.
306
344
 
307
345
  **Push fails with authentication errors**
308
346
  - **Cause:** Session tokens expired
@@ -321,7 +359,7 @@ vention link
321
359
  A: No, only MachineLogic Python apps are supported.
322
360
 
323
361
  **Q: Do I need to keep MachineBuilder open while editing locally?**
324
- A: No, you only need MachineBuilder open (with MachineLogic tab active) when running `pull` or `push` commands.
362
+ A: No, you only need MachineBuilder open (with MachineLogic tab active) when running `pull`, `push`, or `logs` commands.
325
363
 
326
364
  **Q: Where are my authentication tokens stored?**
327
365
  A: In `~/.vention-cli-config.json` in your home directory.
@@ -330,7 +368,7 @@ A: In `~/.vention-cli-config.json` in your home directory.
330
368
  A: Yes, each app folder maintains its own link metadata. You can have multiple linked directories.
331
369
 
332
370
  **Q: What files are ignored during push?**
333
- A: `venv`, `node_modules`, `dist`, `build`, `__pycache__`, `*.egg-info`, `.machine-code-app-directory-info.json`, `.vention-design-scene-assets.json`, and `.vention-design-configuration.json`.
371
+ A: `venv`, `.venv`, `node_modules`, `dist`, `build`, `__pycache__`, `*.egg-info`, `.machine-code-app-directory-info.json`, `.vention-design-scene-assets.json`, and `.vention-design-configuration.json`.
334
372
 
335
373
  **Q: Can I add custom ignore patterns?**
336
374
  A: Not currently. The ignore list is built into the CLI.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vention/vention-cli",
3
- "version": "0.29.3",
3
+ "version": "0.29.4",
4
4
  "description": "CLI tool for Vention applications",
5
5
  "type": "module",
6
6
  "engines": {