enact-cli 1.0.3 → 1.0.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.
- package/dist/index.js +25 -11
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7758,9 +7758,22 @@ var $visitAsync = visit.visitAsync;
|
|
|
7758
7758
|
|
|
7759
7759
|
// src/utils/help.ts
|
|
7760
7760
|
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
7761
|
+
import { readFileSync } from "fs";
|
|
7762
|
+
import { join } from "path";
|
|
7763
|
+
var __dirname = "/Users/keithgroves/projects/keithagroves/enact-project/enact-cli/src/utils";
|
|
7764
|
+
function getVersion() {
|
|
7765
|
+
try {
|
|
7766
|
+
const packageJsonPath = join(__dirname, "../../package.json");
|
|
7767
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
7768
|
+
return packageJson.version || "0.1.0";
|
|
7769
|
+
} catch (error) {
|
|
7770
|
+
return "0.1.0";
|
|
7771
|
+
}
|
|
7772
|
+
}
|
|
7761
7773
|
function showHelp() {
|
|
7774
|
+
const version = getVersion();
|
|
7762
7775
|
console.log(`
|
|
7763
|
-
${import_picocolors3.default.bold("Enact CLI")} ${import_picocolors3.default.dim(
|
|
7776
|
+
${import_picocolors3.default.bold("Enact CLI")} ${import_picocolors3.default.dim(`v${version}`)}
|
|
7764
7777
|
${import_picocolors3.default.dim("A CLI tool for managing and publishing Enact tools")}
|
|
7765
7778
|
|
|
7766
7779
|
${import_picocolors3.default.bold("Usage:")}
|
|
@@ -7790,7 +7803,8 @@ ${import_picocolors3.default.bold("More Help:")}
|
|
|
7790
7803
|
`);
|
|
7791
7804
|
}
|
|
7792
7805
|
function showVersion() {
|
|
7793
|
-
|
|
7806
|
+
const version = getVersion();
|
|
7807
|
+
console.log(`enact-cli v${version}`);
|
|
7794
7808
|
}
|
|
7795
7809
|
function showPublishHelp() {
|
|
7796
7810
|
console.log(`
|
|
@@ -7815,11 +7829,11 @@ ${import_picocolors3.default.bold("Examples:")}
|
|
|
7815
7829
|
|
|
7816
7830
|
// src/utils/config.ts
|
|
7817
7831
|
import { homedir } from "os";
|
|
7818
|
-
import { join } from "path";
|
|
7832
|
+
import { join as join2 } from "path";
|
|
7819
7833
|
import { existsSync } from "fs";
|
|
7820
7834
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
7821
|
-
var CONFIG_DIR =
|
|
7822
|
-
var CONFIG_FILE =
|
|
7835
|
+
var CONFIG_DIR = join2(homedir(), ".enact");
|
|
7836
|
+
var CONFIG_FILE = join2(CONFIG_DIR, "config.json");
|
|
7823
7837
|
async function ensureConfig() {
|
|
7824
7838
|
if (!existsSync(CONFIG_DIR)) {
|
|
7825
7839
|
await mkdir(CONFIG_DIR, { recursive: true });
|
|
@@ -7871,7 +7885,7 @@ async function getDefaultUrl() {
|
|
|
7871
7885
|
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
7872
7886
|
import { existsSync as existsSync2 } from "fs";
|
|
7873
7887
|
import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
7874
|
-
import { join as
|
|
7888
|
+
import { join as join3 } from "path";
|
|
7875
7889
|
import { homedir as homedir2 } from "os";
|
|
7876
7890
|
import { createServer } from "http";
|
|
7877
7891
|
import { parse } from "url";
|
|
@@ -8166,8 +8180,8 @@ function createEnactApiClient(baseUrl, supabaseUrl) {
|
|
|
8166
8180
|
|
|
8167
8181
|
// src/commands/auth.ts
|
|
8168
8182
|
var execAsync = promisify(exec);
|
|
8169
|
-
var CONFIG_DIR2 =
|
|
8170
|
-
var AUTH_FILE =
|
|
8183
|
+
var CONFIG_DIR2 = join3(homedir2(), ".enact");
|
|
8184
|
+
var AUTH_FILE = join3(CONFIG_DIR2, "auth.json");
|
|
8171
8185
|
var DEFAULT_SERVER = "https://enact.tools";
|
|
8172
8186
|
async function handleAuthCommand(args, options) {
|
|
8173
8187
|
if (options.help || !args[0]) {
|
|
@@ -8758,10 +8772,10 @@ function validateEnactFile(value) {
|
|
|
8758
8772
|
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
8759
8773
|
import { existsSync as existsSync4 } from "fs";
|
|
8760
8774
|
import { readFile as readFile4, writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
|
|
8761
|
-
import { join as
|
|
8775
|
+
import { join as join4 } from "path";
|
|
8762
8776
|
import { homedir as homedir3 } from "os";
|
|
8763
|
-
var CONFIG_DIR3 =
|
|
8764
|
-
var CONFIG_FILE2 =
|
|
8777
|
+
var CONFIG_DIR3 = join4(homedir3(), ".enact");
|
|
8778
|
+
var CONFIG_FILE2 = join4(CONFIG_DIR3, "config.json");
|
|
8765
8779
|
async function handleRemoteCommand(args, options) {
|
|
8766
8780
|
if (options.help || !args[0]) {
|
|
8767
8781
|
console.log(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "enact-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Official CLI for the Enact Protocol - package, secure, and discover AI tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -61,4 +61,4 @@
|
|
|
61
61
|
"picocolors": "^1.1.1",
|
|
62
62
|
"yaml": "^2.8.0"
|
|
63
63
|
}
|
|
64
|
-
}
|
|
64
|
+
}
|