puter-cli 1.4.1 → 1.4.3

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.
@@ -23,5 +23,11 @@ jobs:
23
23
  cache: 'pnpm'
24
24
  - name: Install dependencies
25
25
  run: pnpm install
26
- - name: Run tests
27
- run: pnpm test
26
+ - name: Run tests & coverage
27
+ run: pnpm run coverage
28
+ - name: Upload coverage reports to Codecov
29
+ uses: codecov/codecov-action@v5
30
+ with:
31
+ token: ${{ secrets.CODECOV_TOKEN }}
32
+ slug: bitsnaps/puter-cli
33
+
package/CHANGELOG.md CHANGED
@@ -4,8 +4,22 @@ 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.4.3](https://github.com/bitsnaps/puter-cli/compare/v1.4.2...v1.4.3)
8
+
9
+ - fix: show disk usage [`dfd0ca3`](https://github.com/bitsnaps/puter-cli/commit/dfd0ca302f459b7295593c8d0147df15e488c963)
10
+
11
+ #### [v1.4.2](https://github.com/bitsnaps/puter-cli/compare/v1.4.1...v1.4.2)
12
+
13
+ > 30 January 2025
14
+
15
+ - license to MIT [`ed0c7ce`](https://github.com/bitsnaps/puter-cli/commit/ed0c7cefba242a5d8fe701cddf5adbe32121bca7)
16
+ - codecov: setup & badge [`7c4211b`](https://github.com/bitsnaps/puter-cli/commit/7c4211b6ea7b882485e3dfbaa17887a2d1fabccc)
17
+ - changelog: update license [`dcf8d23`](https://github.com/bitsnaps/puter-cli/commit/dcf8d232160cf74d13267baa07a8f36578df9443)
18
+
7
19
  #### [v1.4.1](https://github.com/bitsnaps/puter-cli/compare/v1.4.0...v1.4.1)
8
20
 
21
+ > 27 January 2025
22
+
9
23
  - feat: init command will scaffold new project [`c61d3f8`](https://github.com/bitsnaps/puter-cli/commit/c61d3f8669d66eb1a869db38b877d226d00b8aca)
10
24
  - changelog: update [`c09aa17`](https://github.com/bitsnaps/puter-cli/commit/c09aa179bd0ad2f437bdf779916050c2496424cd)
11
25
 
package/LICENSE.md CHANGED
@@ -1,209 +1,21 @@
1
- # Do No Harm License
2
-
3
- ## 1. Preamble
4
-
5
- Most software today is developed with little to no thought of how it will be used, or the
6
- consequences for our society and planet.
7
-
8
- As software developers, we engineer the infrastructure of the 21st century. We recognise that our
9
- infrastructure has great power to shape the world and the lives of those we share it with, and we
10
- choose to consciously take responsibility for the social and environmental impacts of what we build.
11
-
12
- We envisage a world free from injustice, inequality, and the reckless destruction of lives and our
13
- planet. We reject slavery in all its forms, whether by force, indebtedness, or by algorithms that
14
- hack human vulnerabilities. We seek a world where humankind is at peace with our neighbours, nature,
15
- and ourselves. We want our work to enrich the physical, mental and spiritual wellbeing of all
16
- society.
17
-
18
- We build software to further this vision of a just world, or at the very least, to not put that
19
- vision further from reach.
20
-
21
- ## 2. Definitions
22
-
23
- "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by
24
- Sections 1 through 9 of this document.
25
-
26
- "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is
27
- granting the License.
28
-
29
- "Legal Entity" shall mean the union of the acting entity and all other entities that control, are
30
- controlled by, or are under common control with that entity. For the purposes of this definition,
31
- "control" means (i) the power, direct or indirect, to cause the direction or management of such
32
- entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
33
- outstanding shares, or (iii) beneficial ownership of such entity.
34
-
35
- "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this
36
- License.
37
-
38
- "Source" form shall mean the preferred form for making modifications, including but not limited to
39
- software source code, documentation source, and configuration files.
40
-
41
- "Object" form shall mean any form resulting from mechanical transformation or translation of a
42
- Source form, including but not limited to compiled object code, generated documentation, and
43
- conversions to other media types.
44
-
45
- "Work" shall mean the work of authorship, whether in Source or Object form, made available under the
46
- License, as indicated by a copyright notice that is included in or attached to the work (an example
47
- is provided in the Appendix below).
48
-
49
- "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or
50
- derived from) the Work and for which the editorial revisions, annotations, elaborations, or other
51
- modifications represent, as a whole, an original work of authorship. For the purposes of this
52
- License, Derivative Works shall not include works that remain separable from, or merely link (or
53
- bind by name) to the interfaces of, the Work and Derivative Works thereof.
54
-
55
- "Contribution" shall mean any work of authorship, including the original version of the Work and any
56
- modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted
57
- to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity
58
- authorized to submit on behalf of the copyright owner. For the purposes of this definition,
59
- "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or
60
- its representatives, including but not limited to communication on electronic mailing lists, source
61
- code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor
62
- for the purpose of discussing and improving the Work, but excluding communication that is
63
- conspicuously marked or otherwise designated in writing by the copyright owner as "Not a
64
- Contribution."
65
-
66
- "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a
67
- Contribution has been received by Licensor and subsequently incorporated within the Work.
68
-
69
- "Forests" shall mean 0.5 or more hectares of trees that were either planted more than 50 years ago
70
- or were not planted by humans or human made equipment.
71
-
72
- "Deforestation" shall mean the clearing, burning or destruction of 0.5 or more hectares of forests
73
- within a 1 year period.
74
-
75
- ## 3. Grant of Copyright License
76
-
77
- Subject to the terms and conditions of this License, each Contributor hereby grants to You a
78
- perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to
79
- reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and
80
- distribute the Work and such Derivative Works in Source or Object form.
81
-
82
- ## 4. Grant of Patent License
83
-
84
- Subject to the terms and conditions of this License, each Contributor hereby grants to You a
85
- perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
86
- section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer
87
- the Work, where such license applies only to those patent claims licensable by such Contributor that
88
- are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s)
89
- with the Work to which such Contribution(s) was submitted. If You institute patent litigation
90
- against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or
91
- a Contribution incorporated within the Work constitutes direct or contributory patent infringement,
92
- then any patent licenses granted to You under this License for that Work shall terminate as of the
93
- date such litigation is filed.
94
-
95
- ## 5. Redistribution
96
-
97
- You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with
98
- or without modifications, and in Source or Object form, provided that You meet the following
99
- conditions:
100
-
101
- 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
102
-
103
- 2. You must cause any modified files to carry prominent notices stating that You changed the
104
- files; and
105
-
106
- 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright,
107
- patent, trademark, and attribution notices from the Source form of the Work, excluding those
108
- notices that do not pertain to any part of the Derivative Works; and
109
-
110
- 4. Neither the name of the copyright holder nor the names of its contributors may be used to endorse
111
- or promote products derived from this software without specific prior written permission; and
112
-
113
- 5. This software must not be used by any organisation, website, product, or service that:
114
- 1. promotes, lobbies for or derives a majority of income from:
115
- 1. **abuses of human rights**:
116
- * human trafficking
117
- * sex trafficking
118
- * slavery or indentured servitude
119
- * discrimination based on age, gender, gender identity, race, sexuality, religion, nationality
120
- * hate speech
121
- 2. **environmental destruction**:
122
- * the extraction or sale of fossil fuels
123
- * the destruction of habitats for threatened or endangered species, including through deforestation or burning of forests
124
- * the abuse, inhumane killing or neglect of animals under human control
125
- * industrial processes that generate waste products that threaten life
126
- 3. **conflict and war**:
127
- * warfare
128
- * war crimes
129
- * weapons manufacturing
130
- * violence (except when required to protect public safety)
131
- 4. **addictive or destructive products and services**:
132
- * gambling
133
- * tobacco
134
- * products that encourage adversely addictive behaviours
135
-
136
- 2. dissuades, lobbies against, or derives a majority of income from actions that discourage or frustrate:
137
- * peace
138
- * access to the rights set out in the [Universal Declaration of Human Rights](./documents/UDHR.md) and the [Convention on the Rights of the Child](./documents/CRC.md)
139
- * democratic processes
140
- * peaceful assembly and association (including worker associations)
141
- * a sustainable environment
142
- ; and
143
-
144
- 5. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative
145
- Works that You distribute must include a readable copy of the attribution notices contained
146
- within such NOTICE file, excluding those notices that do not pertain to any part of the
147
- Derivative Works, in at least one of the following places: within a NOTICE text file
148
- distributed as part of the Derivative Works; within the Source form or documentation, if
149
- provided along with the Derivative Works; or, within a display generated by the Derivative
150
- Works, if and wherever such third-party notices normally appear. The contents of the NOTICE
151
- file are for informational purposes only and do not modify the License. You may add Your own
152
- attribution notices within Derivative Works that You distribute, alongside or as an addendum to
153
- the NOTICE text from the Work, provided that such additional attribution notices cannot be
154
- construed as modifying the License.
155
-
156
- You may add Your own copyright statement to Your modifications and may provide additional or
157
- different license terms and conditions for use, reproduction, or distribution of Your modifications,
158
- or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of
159
- the Work otherwise complies with the conditions stated in this License.
160
-
161
- ## 6. Submission of Contributions
162
-
163
- Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the
164
- Work by You to the Licensor shall be under the terms and conditions of this License, without any
165
- additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify
166
- the terms of any separate license agreement you may have executed with Licensor regarding such
167
- Contributions.
168
-
169
- ## 7. Trademarks
170
-
171
- This License does not grant permission to use the trade names, trademarks, service marks, or product
172
- names of the Licensor, except as required for reasonable and customary use in describing the origin
173
- of the Work and reproducing the content of the NOTICE file.
174
-
175
- ## 8. Disclaimer of Warranty
176
-
177
- Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each
178
- Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
179
- KIND, either express or implied, including, without limitation, any warranties or conditions of
180
- TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
181
- responsible for determining the appropriateness of using or redistributing the Work and assume any
182
- risks associated with Your exercise of permissions under this License.
183
-
184
- ## 9. Limitation of Liability
185
-
186
- In no event and under no legal theory, whether in tort (including negligence), contract, or
187
- otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or
188
- agreed to in writing, shall any Contributor be liable to You for damages, including any direct,
189
- indirect, special, incidental, or consequential damages of any character arising as a result of this
190
- License or out of the use or inability to use the Work (including but not limited to damages for
191
- loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial
192
- damages or losses), even if such Contributor has been advised of the possibility of such damages.
193
-
194
- ## 10. Accepting Warranty or Additional Liability
195
-
196
- While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee
197
- for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights
198
- consistent with this License. However, in accepting such obligations, You may act only on Your own
199
- behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You
200
- agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or
201
- claims asserted against, such Contributor by reason of your accepting any such warranty or
202
- additional liability.
203
-
204
- ## Attribution
205
-
206
- Do No Harm License [Contributor Covenant][homepage], (pre 1.0),
207
- available at https://github.com/raisely/NoHarm
208
-
209
- [homepage]: https://github.com/raisely/NoHarm
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ibrahim H.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -2,7 +2,13 @@
2
2
 
3
3
  <p align="center">
4
4
  <img alt="test" src="https://github.com/bitsnaps/puter-cli/actions/workflows/npm-build.yml/badge.svg">
5
+ <a href="https://codecov.io/github/bitsnaps/puter-cli" >
6
+ <img src="https://codecov.io/github/bitsnaps/puter-cli/graph/badge.svg?token=TFPCdwdFxF"/>
7
+ </a>
5
8
  <img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/bitsnaps/puter-cli">
9
+ <a href="https://opensource.org/licenses/MIT" >
10
+ <img alt="License" src="https://img.shields.io/badge/License-MIT-yellow.svg">
11
+ </a>
6
12
  </p>
7
13
 
8
14
 
@@ -324,7 +330,12 @@ We welcome contributions! Please follow these steps:
324
330
 
325
331
  ## License
326
332
 
327
- This project is licensed under the **[NoHarm License](https://github.com/raisely/NoHarm/blob/publish/LICENSE.md)**. See the [LICENSE](LICENSE.md) file for details.
333
+ As of version v1.4.2, this project is licensed under the **[MIT License](LICENSE.md)**.
334
+
335
+ ## NoHarm
336
+
337
+ This project was previously licensed under the "NoHarm" license to explicitly prevent its use for harmful purposes. While it is now licensed under the permissive MIT License to encourage broader usage and contribution, we strongly emphasize that this software should not be used in any way that causes harm, infringes on others' rights, or promotes unethical practices. By using this software, you are urged to adhere to these principles and use it responsibly.
338
+
328
339
 
329
340
  ---
330
341
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "puter-cli",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "Command line interface for Puter cloud platform",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -24,7 +24,7 @@
24
24
  "cloud"
25
25
  ],
26
26
  "author": "Ibrahim.H",
27
- "license": "NoHarm",
27
+ "license": "MIT",
28
28
  "dependencies": {
29
29
  "chalk": "^5.3.0",
30
30
  "cli-table3": "^0.6.5",
@@ -452,7 +452,6 @@ export async function getInfo(args = []) {
452
452
  console.log(chalk.cyan(`Writable: `) + chalk.white(data.writable ? 'Yes' : 'No'));
453
453
  console.log(chalk.cyan(`Owner: `) + chalk.white(data.owner.username));
454
454
  console.log(chalk.dim('----------------------------------------'));
455
- console.log(chalk.green('Done.'));
456
455
  } else {
457
456
  console.error(chalk.red('Unable to get stat info. Please check your credentials.'));
458
457
  }
@@ -523,7 +522,6 @@ export async function getDiskUsage(body = null) {
523
522
  });
524
523
 
525
524
  const data = await response.json();
526
- console.log(data);
527
525
  if (response.ok && data) {
528
526
  showDiskSpaceUsage(data);
529
527
  } else {
@@ -784,7 +782,7 @@ export async function uploadFile(args = []) {
784
782
  // Step 2: Check disk space
785
783
  const dfResponse = await fetch(`${API_BASE}/df`, {
786
784
  method: 'POST',
787
- headers: getHeaders(), // Use a dummy boundary for non-multipart requests
785
+ headers: getHeaders(),
788
786
  body: null
789
787
  });
790
788
 
package/src/commons.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import chalk from 'chalk';
2
2
  import { getAuthToken } from './commands/auth.js';
3
+ import { formatSize } from './utils.js';
3
4
  import { readFile } from 'fs/promises';
4
5
  import { fileURLToPath } from 'url';
5
6
  import { dirname, join } from 'path';
@@ -100,7 +101,6 @@ export function showDiskSpaceUsage(data) {
100
101
  // format the usagePercentage with 2 decimal floating point value:
101
102
  console.log(chalk.cyan(`Usage Percentage: `) + chalk.white(`${usagePercentage.toFixed(2)}%`));
102
103
  console.log(chalk.dim('----------------------------------------'));
103
- console.log(chalk.green('Done.'));
104
104
  }
105
105
 
106
106
  /**