cloud-pc-templates 1.3.0 → 1.3.1

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 +14 -176
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -7,6 +7,14 @@ Cloud PC Templates is a command-line tool for managing cloud PC configurations a
7
7
  ```bash
8
8
  npm install -g cloud-pc-templates
9
9
  ```
10
+ ## Video Tutorial
11
+
12
+ For a step-by-step guide on using Cloud PC Templates, watch this video tutorial:
13
+
14
+ [![Cloud PC Templates Tutorial](https://img.youtube.com/vi/XMF0K9R2rD0/0.jpg)](https://www.youtube.com/watch?v=XMF0K9R2rD0)
15
+
16
+ [Click here to watch on YouTube](https://www.youtube.com/watch?v=XMF0K9R2rD0)
17
+
10
18
 
11
19
  ## Usage
12
20
 
@@ -42,14 +50,7 @@ npx cloud-pc-templates ai login loginMode ollamacloud
42
50
  ```
43
51
 
44
52
  **What it does:**
45
- 1. Checks if you're already logged in by testing the health endpoint at `http://localhost:3004/health`
46
- 2. If already logged in, displays "Already logged in" message
47
- 3. If not logged in:
48
- - Prompts you to enter your API Key (masked input with asterisks)
49
- - Downloads the Ollama proxy script from GitHub
50
- - Runs the proxy with your API key as an argument
51
- - Validates the health endpoint
52
- - Displays "Logged in" confirmation
53
+ 1. Runs a wrapper service at `http://localhost:3004/health` which is an interface to ollama cloud models, it requires ollama api key.
53
54
 
54
55
  **Example:**
55
56
  ```bash
@@ -59,27 +60,15 @@ Enter API Key: **************************
59
60
  - Endpoint checked: http://localhost:3004/health
60
61
  ```
61
62
 
62
- **Features:**
63
- - Masked input for API key (shows `*` instead of actual characters)
64
- - Supports pasting long API keys
65
- - Backspace support for corrections
66
- - Cross-platform terminal support (TTY and non-TTY)
67
- - Real-time proxy output logging for debugging
68
-
69
63
  ##### Ollama Local Login
70
64
 
71
- Connect to Ollama Local instance:
65
+ Connect to Ollama Local models:
72
66
  ```bash
73
67
  npx cloud-pc-templates ai login loginMode ollamalocal
74
68
  ```
75
69
 
76
70
  **What it does:**
77
- 1. Checks if Ollama is running on the default port (11434)
78
- 2. If Ollama is not running, displays a warning with installation instructions
79
- 3. Downloads the Ollama Offline Proxy script from GitHub
80
- 4. Runs the proxy on port 3005 (no API key required)
81
- 5. Validates the proxy health endpoint
82
- 6. Displays "Logged in" confirmation
71
+ 1. Runs a wrapper service to connect to ollama local models
83
72
 
84
73
  **Example (with Ollama running):**
85
74
  ```bash
@@ -93,26 +82,11 @@ $ npx cloud-pc-templates ai login loginMode ollamalocal
93
82
  - Ollama running on: localhost:11434
94
83
  ```
95
84
 
96
- **Example (without Ollama running):**
97
- ```bash
98
- $ npx cloud-pc-templates ai login loginMode ollamalocal
99
- 🔍 Checking if Ollama is running...
100
- ⚠️ WARNING: Ollama is not running on localhost:11434
101
- Please install Ollama and run it before using this login mode.
102
- Download Ollama from: https://ollama.ai
103
-
104
- After installation, start Ollama with:
105
- ollama serve
106
-
107
- Continuing anyway...
108
- ```
109
-
110
85
  **Features:**
111
86
  - No API key required
112
87
  - Checks for local Ollama installation
113
88
  - Helpful warnings with installation instructions
114
89
  - Runs proxy on port 3005
115
- - Provides detailed status output
116
90
 
117
91
  ##### Hugging Face Login
118
92
 
@@ -122,11 +96,7 @@ npx cloud-pc-templates ai login loginMode huggingface
122
96
  ```
123
97
 
124
98
  **What it does:**
125
- 1. Prompts you to enter your Hugging Face API Key (masked input with asterisks)
126
- 2. Downloads the Hugging Face proxy script from GitHub
127
- 3. Runs the proxy on port 3006 with your API key
128
- 4. Validates the proxy health endpoint
129
- 5. Displays "Logged in" confirmation
99
+ 1. Runs a wrapper service over huggingface cloud models and it requires huggingface api key
130
100
 
131
101
  **Example:**
132
102
  ```bash
@@ -136,14 +106,6 @@ Enter Hugging Face API Key: ****************************
136
106
  - Endpoint checked: http://localhost:3006/health
137
107
  ```
138
108
 
139
- **Features:**
140
- - Masked input for API key (shows `*` instead of actual characters)
141
- - Supports pasting long API keys
142
- - Backspace support for corrections
143
- - Runs proxy on port 3006
144
- - Real-time proxy output logging for debugging
145
- - Get your API key from: https://huggingface.co/settings/tokens
146
-
147
109
  ### Command Discovery
148
110
 
149
111
  The CLI features intelligent command discovery. If you don't provide all required arguments, it shows available options:
@@ -181,45 +143,7 @@ cloud-pc-templates/
181
143
  ├── package.json # Project metadata and bin configuration
182
144
  └── README.md # This file
183
145
  ```
184
-
185
- ### Modules
186
-
187
- #### index.js
188
- - **Command Tree**: Hierarchical command structure supporting nested subcommands
189
- - **Argument Parsing**: Handles command-line arguments with `--` prefix stripping
190
- - **Request Routing**: Routes commands to appropriate handlers
191
-
192
- #### handlers/ollamacloud.js
193
- - `promptForApiKey()`: Interactive masked API key input
194
- - `checkHealthEndpoint()`: Health check for proxy server
195
- - `downloadAndRunProxy()`: Downloads and executes proxy script with API key
196
- - `checkAndLoginOllamaCloud()`: Main login orchestrator
197
-
198
- #### handlers/ollamalocal.js
199
- - `checkOllamaHealth()`: Verifies Ollama is running on port 11434
200
- - `downloadAndRunProxy()`: Downloads and executes offline proxy script
201
- - `checkProxyHealth()`: Health check for the offline proxy
202
- - `checkAndLoginOllamaLocal()`: Main login orchestrator with warning system
203
-
204
- #### handlers/huggingface.js
205
- - `promptForApiKey()`: Interactive masked API key input
206
- - `checkHealthEndpoint()`: Health check for proxy server
207
- - `downloadAndRunProxy()`: Downloads and executes proxy script with API key
208
- - `checkAndLoginHuggingFace()`: Main login orchestrator
209
-
210
- #### handlers/launch.js
211
- - `openBrowser()`: Cross-platform browser launcher
212
- - `launchWebsite()`: Opens cloud-pc-templates.com
213
-
214
- ## Features
215
-
216
- ### Masked API Key Input
217
- When logging in to Ollama Cloud, your API key is protected:
218
- - Each character you type displays as an asterisk `*`
219
- - Works with keyboard input and pasted text
220
- - Supports backspace for corrections
221
-
222
- ### Cross-Platform Support
146
+ ### Cross-Platform Support for the launch command
223
147
  The launch command works on:
224
148
  - macOS (uses `open` command)
225
149
  - Linux (uses `xdg-open` command)
@@ -253,36 +177,6 @@ Each handler is a separate module that can be:
253
177
  - Extended with new features
254
178
  - Reused in other projects
255
179
 
256
- ### Adding New Commands
257
-
258
- To add a new command:
259
-
260
- 1. Create a new handler file in `handlers/`:
261
- ```javascript
262
- // handlers/mycommand.js
263
- async function myCommandHandler() {
264
- // Implementation
265
- }
266
-
267
- module.exports = { myCommandHandler };
268
- ```
269
-
270
- 2. Import it in `index.js`:
271
- ```javascript
272
- const { myCommandHandler } = require('./handlers/mycommand');
273
- ```
274
-
275
- 3. Add it to the command tree:
276
- ```javascript
277
- const commandTree = {
278
- // ... existing commands
279
- mycommand: {
280
- description: 'My command description',
281
- handler: () => myCommandHandler()
282
- }
283
- };
284
- ```
285
-
286
180
  ## NPM Script
287
181
 
288
182
  The project is configured with a binary entrypoint in `package.json`:
@@ -297,66 +191,10 @@ The project is configured with a binary entrypoint in `package.json`:
297
191
 
298
192
  This enables the `npx cloud-pc-templates` command globally.
299
193
 
300
- ## API Key Security
301
-
302
- When entering your API key:
303
- - Input is masked with asterisks
304
- - Key is passed directly to the proxy process
305
- - Never logged or stored in plain text
306
- - Passed via command-line argument or environment variable
307
-
308
- ## Troubleshooting
309
-
310
- ### "Unknown command" error
311
- - Make sure you've spelled the command correctly
312
- - Use `npx cloud-pc-templates help` to see available commands
313
- - Commands are case-sensitive
314
-
315
- ### Ollama Cloud login fails
316
- - Check that you have a valid API key
317
- - Ensure your network connection is stable
318
- - Try checking if the health endpoint is accessible manually:
319
- ```bash
320
- curl http://localhost:3004/health
321
- ```
322
-
323
- ### Ollama Local login fails
324
- - Make sure Ollama is installed: https://ollama.ai
325
- - Start Ollama with: `ollama serve`
326
- - Check if Ollama is running on port 11434:
327
- ```bash
328
- curl http://localhost:11434/api/tags
329
- ```
330
- - Ensure port 3005 is not in use by another application
331
-
332
- ### Hugging Face login fails
333
- - Check that you have a valid Hugging Face API key
334
- - Get your API key from: https://huggingface.co/settings/tokens
335
- - Make sure your API key has the necessary permissions
336
- - Ensure port 3006 is not in use by another application
337
- - Check your internet connection for accessing Hugging Face services
338
-
339
- ### Browser won't open with `launch`
340
- - Ensure you have a default browser configured
341
- - On Linux, make sure `xdg-open` is installed: `sudo apt-get install xdg-utils`
342
- - On Windows, ensure a browser is set as default
343
- - On Android/Termux:
344
- - For best results, install Termux API: `pkg install termux-api`
345
- - Otherwise, `xdg-open` will be used as fallback
346
- - Ensure you have a browser app installed on your device
347
-
348
- ## Video Tutorial
349
-
350
- For a step-by-step guide on using Cloud PC Templates, watch this video tutorial:
351
-
352
- [![Cloud PC Templates Tutorial](https://img.youtube.com/vi/XMF0K9R2rD0/0.jpg)](https://www.youtube.com/watch?v=XMF0K9R2rD0)
353
-
354
- [Click here to watch on YouTube](https://www.youtube.com/watch?v=XMF0K9R2rD0)
355
-
356
194
  ## License
357
195
 
358
196
  ISC
359
197
 
360
198
  ## Author
361
199
 
362
- Cloud PC Templates Contributors
200
+ Devashish Priyadarshi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloud-pc-templates",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {