puter-cli 1.8.5 → 1.8.6

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/CHANGELOG.md CHANGED
@@ -4,8 +4,17 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v1.8.6](https://github.com/HeyPuter/puter-cli/compare/v1.8.5...v1.8.6)
8
+
9
+ - Use random name if not specified for `site:deploy` [`#24`](https://github.com/HeyPuter/puter-cli/pull/24)
10
+ - Use random name if not specified [`48ae3f0`](https://github.com/HeyPuter/puter-cli/commit/48ae3f04325f27b654e00050c7ec514bee72535e)
11
+ - docs(readme): update site command [`aa4ba6e`](https://github.com/HeyPuter/puter-cli/commit/aa4ba6e1ee52e1c6e2c0cb5fb74c120fb1b5c0c3)
12
+ - refactor(site): remove name argument from site:deploy [`1ffaacb`](https://github.com/HeyPuter/puter-cli/commit/1ffaacbd3e00dff4f75af66bd1d4b9aee1daf9c6)
13
+
7
14
  #### [v1.8.5](https://github.com/HeyPuter/puter-cli/compare/v1.8.4...v1.8.5)
8
15
 
16
+ > 5 October 2025
17
+
9
18
  - feat(site): add site:deploy command for one-step project deployment [`94210ed`](https://github.com/HeyPuter/puter-cli/commit/94210ed796e7564647f4cd177a1b0bef72e66ef2)
10
19
  - Fix and add some details to the README file [`8acb6ea`](https://github.com/HeyPuter/puter-cli/commit/8acb6ea753b4f83c146f26473f61756e613a4953)
11
20
  - fix(files): touch command to creation a new file [`d30a067`](https://github.com/HeyPuter/puter-cli/commit/d30a0673e9aa5fb5b5d6b037a6a134a196a27529)
package/README.md CHANGED
@@ -197,12 +197,18 @@ P.S. This command will look for the allocated `subdomain` and attempt to delete
197
197
 
198
198
  The static sites are served from the selected directory (or the current directory if none is specified).
199
199
 
200
- - **Deploy Site**: Deploy a static website from a directory.
200
+ - **Create Site**: Create a static website from a directory.
201
201
  ```bash
202
- puter> site:create <app_name> [<dir>] [--subdomain=<name>]
202
+ puter> site:create <app_name> [<dir>] [--subdomain=<name>]
203
203
  ```
204
204
  P.S. If the subdomain already exists, it will generate a new random one. You can set your own subdomain using `--subdomain` argument.
205
205
 
206
+ - **Deploy Site**: Deploy a static website from the current local directory to a remote directory. If no remote directory is specified, it deploys to the current directory on the remote instance.
207
+ ```bash
208
+ puter> site:deploy [<remote_dir>] [--subdomain=<name>]
209
+ ```
210
+ P.S. If the subdomain is not provided, it will be generated from the app name. The `--subdomain` argument allows you to specify a custom subdomain. All files in the remote directory will overwritten.
211
+
206
212
  - **List Sites**: List all hosted sites.
207
213
  ```bash
208
214
  puter> sites
package/bin/index.js CHANGED
@@ -67,7 +67,6 @@ async function main() {
67
67
  program
68
68
  .command('site:deploy')
69
69
  .description('Deploy a local web project to Puter')
70
- .argument('[name]', 'Name of the site')
71
70
  .argument('[remoteDir]', 'Remote directory path')
72
71
  .option('--subdomain <subdomain>', 'Subdomain for the site')
73
72
  .action(async (name, remoteDir, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "puter-cli",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "description": "Command line interface for Puter cloud platform",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -7,20 +7,20 @@ import { getSubdomains } from './subdomains.js';
7
7
 
8
8
  /**
9
9
  * Deploy a local web project to Puter.
10
- * @param {string[]} args - Command-line arguments (e.g., <valid_site_app> [<remote_dir>] [--subdomain=<subdomain>]).
10
+ * @param {string[]} args - Command-line arguments (e.g., [<remote_dir>] [--subdomain=<subdomain>]).
11
11
  */
12
12
  export async function deploy(args = []) {
13
- if (args.length < 1 || !isValidAppName(args[0])) {
14
- console.log(chalk.red('Usage: site:deploy <valid_site_app> [<remote_dir>] [--subdomain=<subdomain>]'));
13
+ if (args.length > 2 || args.some(arg => arg.startsWith('--') && !arg.startsWith('--subdomain='))) {
14
+ console.log(chalk.red('Usage: site:deploy [<remote_dir>] [--subdomain=<subdomain>]'));
15
15
  console.log(chalk.yellow('Example: site:deploy'));
16
- console.log(chalk.yellow('Example: site:deploy my-app'));
17
- console.log(chalk.yellow('Example: site:deploy my-app ./my-app'));
18
- console.log(chalk.yellow('Example: site:deploy my-app ./my-app --subdomain=my-app-new'));
16
+ console.log(chalk.yellow('Example: site:deploy'));
17
+ console.log(chalk.yellow('Example: site:deploy ./my-app'));
18
+ console.log(chalk.yellow('Example: site:deploy ./my-app --subdomain=my-app-new'));
19
19
  return;
20
20
  }
21
- const appName = args[0]; // && !args[0].startsWith('--') ? args[0] : generateAppName();
22
- const remoteDirArg = args.find(arg => !arg.startsWith('--') && arg !== appName);
23
- const remoteDir = remoteDirArg || '.'; // `./${appName}`;
21
+ const appName = generateAppName();
22
+ const remoteDirArg = args.find(arg => !arg.startsWith('--'));
23
+ const remoteDir = remoteDirArg || '.';
24
24
  const subdomain = args.find(arg => arg.startsWith('--subdomain='))?.split('=')[1] || appName;
25
25
  const sourceDir = '.'; // Deploy from the current directory
26
26
 
package/src/executor.js CHANGED
@@ -156,8 +156,7 @@ const commands = {
156
156
  * @param {string} input The command line input
157
157
  */
158
158
  export async function execCommand(context, input) {
159
- const [cmd, ...args] = input.split(' ');
160
-
159
+ const [cmd, ...args] = input?input.split(' '):[];
161
160
 
162
161
  // Add the command to history (skip the "history" command itself)
163
162
  if (cmd !== 'history') {
@@ -355,9 +354,9 @@ function showHelp(command) {
355
354
  Example: site:create mywebsite /path/to/dir --subdomain=mywebsite
356
355
  `,
357
356
  'site:deploy': `
358
- ${chalk.cyan('site:deploy [<valid_name_app>] [<remote_dir>] [--subdomain=<subdomain>]')}
357
+ ${chalk.cyan('site:deploy [<remote_dir>] [--subdomain=<subdomain>]')}
359
358
  Deploy a local web project to Puter.
360
- Example: site:deploy my-app ./my-app --subdomain my-app
359
+ Example: site:deploy ./my-app --subdomain my-app
361
360
  `,
362
361
  '!': `
363
362
  ${chalk.cyan('!<command>')}