envpkt 0.4.1 → 0.4.2
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/cli.js +12 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { Command } from "commander";
|
|
2
|
+
import { existsSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
4
3
|
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { Command } from "commander";
|
|
5
6
|
import { Cond, Left, List, Option, Right, Try } from "functype";
|
|
6
|
-
import { existsSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
8
|
import { TypeCompiler } from "@sinclair/typebox/compiler";
|
|
9
9
|
import { TomlDate, parse, stringify } from "smol-toml";
|
|
@@ -2844,7 +2844,15 @@ const runShellHook = (shell) => {
|
|
|
2844
2844
|
//#endregion
|
|
2845
2845
|
//#region src/cli/index.ts
|
|
2846
2846
|
const program = new Command();
|
|
2847
|
-
program.name("envpkt").description("Credential lifecycle and fleet management for AI agents\n\n Developer workflow: env scan → catalog → cloud-synced folder → eval $(envpkt env export)\n Agent / CI workflow: catalog → audit --strict → seal → exec --strict → fleet").version(
|
|
2847
|
+
program.name("envpkt").description("Credential lifecycle and fleet management for AI agents\n\n Developer workflow: env scan → catalog → cloud-synced folder → eval $(envpkt env export)\n Agent / CI workflow: catalog → audit --strict → seal → exec --strict → fleet").version((() => {
|
|
2848
|
+
const findPkgJson = (dir) => {
|
|
2849
|
+
if (existsSync(join(dir, "package.json"))) return join(dir, "package.json");
|
|
2850
|
+
const parent = dirname(dir);
|
|
2851
|
+
return parent === dir ? "" : findPkgJson(parent);
|
|
2852
|
+
};
|
|
2853
|
+
const pkgPath = findPkgJson(dirname(fileURLToPath(import.meta.url)));
|
|
2854
|
+
return pkgPath ? JSON.parse(readFileSync(pkgPath, "utf-8")).version : "0.0.0";
|
|
2855
|
+
})());
|
|
2848
2856
|
program.command("init").description("Initialize a new envpkt.toml in the current directory").option("--from-fnox [path]", "Scaffold from fnox.toml (optionally specify path)").option("--catalog <path>", "Path to shared secret catalog").option("--agent", "Include [agent] section").option("--name <name>", "Agent name (requires --agent)").option("--capabilities <caps>", "Comma-separated capabilities (requires --agent)").option("--expires <date>", "Agent credential expiration YYYY-MM-DD (requires --agent)").option("--force", "Overwrite existing envpkt.toml").action((options) => {
|
|
2849
2857
|
runInit(process.cwd(), options);
|
|
2850
2858
|
});
|