@cuilo/cli 0.0.0-stage → 2.0.0-alpha.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License Copyright (c) 2023 Tonalli López
2
+
3
+ Permission is hereby granted, free
4
+ of charge, to any person obtaining a copy of this software and associated
5
+ documentation files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use, copy, modify, merge,
7
+ publish, distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice
12
+ (including the next paragraph) shall be included in all copies or substantial
13
+ portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
16
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
18
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,12 @@
1
- # Temporary Holding Version
1
+ # @cuilo/cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The npm package for [cuilo](https://cuilo.dev): generate projects and code from versioned, updatable packs, for humans and AI agents.
4
+
5
+ ```sh
6
+ npm install --global @cuilo/cli
7
+ cuilo --help
8
+ ```
9
+
10
+ The package has no dependencies and runs nothing at install time. Your package manager installs the one platform package that matches your system (for example `@cuilo/cli-darwin-arm64`), which holds the native binary. Every version is published from GitHub Actions with [npm provenance](https://docs.npmjs.com/generating-provenance-statements).
11
+
12
+ If `cuilo` reports that no binary is installed, your package manager skipped optional dependencies. Reinstall without `--omit=optional` / `--no-optional`, or use another install method from the docs.
package/bin/cuilo.js ADDED
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Runs the cuilo binary from the platform package the package manager installed; nothing is
4
+ * downloaded or run at install time.
5
+ */
6
+ import { spawnSync } from "node:child_process";
7
+ import { createRequire } from "node:module";
8
+ import process from "node:process";
9
+
10
+ const require = createRequire(import.meta.url);
11
+ const { name } = require("../package.json");
12
+
13
+ /** Whether this Linux uses musl instead of glibc. */
14
+ function isMusl() {
15
+ if (process.platform !== "linux") {
16
+ return false;
17
+ }
18
+ try {
19
+ return !process.report?.getReport()?.header?.glibcVersionRuntime;
20
+ } catch {
21
+ return false;
22
+ }
23
+ }
24
+
25
+ /** Platform package suffixes to try, in order. */
26
+ function platforms() {
27
+ const base = `${process.platform}-${process.arch}`;
28
+ if (process.platform !== "linux") {
29
+ return [base];
30
+ }
31
+ return isMusl() ? [`${base}-musl`, base] : [base, `${base}-musl`];
32
+ }
33
+
34
+ /** The path of the installed binary, or `undefined`. */
35
+ function binary() {
36
+ const file = process.platform === "win32" ? "bin/cuilo.exe" : "bin/cuilo";
37
+ for (const platform of platforms()) {
38
+ try {
39
+ return require.resolve(`${name}-${platform}/${file}`);
40
+ } catch {
41
+ // Not installed for this platform; try the next.
42
+ }
43
+ }
44
+ }
45
+
46
+ const path = binary();
47
+ if (!path) {
48
+ process.stderr.write(
49
+ `error: ${name} has no binary for ${process.platform}-${process.arch}. ` +
50
+ "Your package manager may have skipped optional dependencies (for example with --omit=optional or " +
51
+ "--no-optional); reinstall without that flag, or use the install script from https://cuilo.dev.\n"
52
+ );
53
+ process.exit(1);
54
+ }
55
+
56
+ const result = spawnSync(path, process.argv.slice(2), { stdio: "inherit" });
57
+ if (result.error) {
58
+ process.stderr.write(`error: could not run ${path}: ${result.error.message}\n`);
59
+ process.exit(1);
60
+ }
61
+ if (result.signal) {
62
+ process.kill(process.pid, result.signal);
63
+ }
64
+ process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
+ "author": "Tonalli López <contact@tuentyfaiv.com>",
3
+ "bin": {
4
+ "cuilo": "bin/cuilo.js"
5
+ },
6
+ "bugs": {
7
+ "url": "https://github.com/TuentyFaiv/cuilo/issues"
8
+ },
9
+ "description": "Generate projects and code from versioned, updatable packs, for humans and AI agents.",
10
+ "engines": {
11
+ "node": ">=18"
12
+ },
13
+ "files": [
14
+ "bin/cuilo.js"
15
+ ],
16
+ "homepage": "https://cuilo.dev",
17
+ "keywords": [
18
+ "cli",
19
+ "scaffolding",
20
+ "generator",
21
+ "templates",
22
+ "mcp"
23
+ ],
24
+ "license": "MIT",
2
25
  "name": "@cuilo/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
26
+ "optionalDependencies": {
27
+ "@cuilo/cli-darwin-arm64": "2.0.0-alpha.1",
28
+ "@cuilo/cli-darwin-x64": "2.0.0-alpha.1",
29
+ "@cuilo/cli-linux-arm64": "2.0.0-alpha.1",
30
+ "@cuilo/cli-linux-arm64-musl": "2.0.0-alpha.1",
31
+ "@cuilo/cli-linux-x64": "2.0.0-alpha.1",
32
+ "@cuilo/cli-linux-x64-musl": "2.0.0-alpha.1",
33
+ "@cuilo/cli-win32-arm64": "2.0.0-alpha.1",
34
+ "@cuilo/cli-win32-x64": "2.0.0-alpha.1"
35
+ },
36
+ "repository": {
37
+ "directory": "npm/cli",
38
+ "type": "git",
39
+ "url": "git+https://github.com/TuentyFaiv/cuilo.git"
40
+ },
41
+ "type": "module",
42
+ "version": "2.0.0-alpha.1"
43
+ }