getmyenv 0.9.3 → 0.9.5

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/README.md CHANGED
@@ -35,7 +35,7 @@ Prompts and status lines go to stderr, so `export --stdout > .env` stays clean.
35
35
  Commit `.getmyenv/project.json`. `token.json` and `claim.json` stay local and are gitignored.
36
36
 
37
37
  <!-- cli:help -->
38
- Output of `npx getmyenv --help` (0.9.3):
38
+ Output of `npx getmyenv --help` (0.9.5):
39
39
 
40
40
  ```text
41
41
  Usage: getmyenv [options] [command]
@@ -9,7 +9,7 @@ export async function backupCommand(opts) {
9
9
  const { client } = await ensureTokenAndLink({ apiUrl: opts.apiUrl });
10
10
  const data = await client.request("GET", "/api/cli/backup");
11
11
  if (!data.publicKey || !data.wrappedPrivateKey) {
12
- throw new Error("No Vault password yet, so there is nothing to back up. Set a value first: npx getmyenv set KEY");
12
+ throw new Error("No Vault password yet, so there is nothing to back up. Set it in the dashboard, or set a value: npx getmyenv set KEY");
13
13
  }
14
14
  const envelope = createBackupEnvelope({
15
15
  projectName: data.projectName,
@@ -22,7 +22,10 @@ export async function unlinkCommand(opts) {
22
22
  }
23
23
  if (!opts.yes) {
24
24
  const label = meta?.projectName ?? meta?.projectId ?? "this folder";
25
- const ok = await promptConfirm(`Unlink ${label}? Revokes this folder's token and removes .getmyenv files. The project and its values stay.`, { defaultYes: false });
25
+ const tokenLine = readClaimFile()
26
+ ? "Removes .getmyenv files except claim.json. The guest token stays, so claim still works."
27
+ : "Revokes this folder's token and removes .getmyenv files.";
28
+ const ok = await promptConfirm(`Unlink ${label}? ${tokenLine} The project and its values stay.`, { defaultYes: false });
26
29
  if (!ok) {
27
30
  console.log(pc.dim("Kept."));
28
31
  return;
@@ -30,8 +33,13 @@ export async function unlinkCommand(opts) {
30
33
  }
31
34
  if (folder) {
32
35
  try {
33
- await new ApiClient(resolveApiUrl(opts.apiUrl), folder.token).request("DELETE", "/api/cli/token");
34
- console.log(`${pc.green("✓")} Token revoked`);
36
+ const res = await new ApiClient(resolveApiUrl(opts.apiUrl), folder.token).request("DELETE", "/api/cli/token");
37
+ if (res?.revoked === false) {
38
+ console.log(pc.dim("Guest token kept on the server, so claim still works with claim.json."));
39
+ }
40
+ else {
41
+ console.log(`${pc.green("✓")} Token revoked`);
42
+ }
35
43
  }
36
44
  catch (err) {
37
45
  // 401/404: the token is already gone on the server. Anything else keeps
package/dist/lib/vault.js CHANGED
@@ -44,7 +44,7 @@ export async function contextKey(linked, target, opts = {}) {
44
44
  const key = opened.get(target.id);
45
45
  if (!key) {
46
46
  throw new Error(member
47
- ? `The owner has not sent you the key for ${target.slug} yet. Ask them to open Project settings, Members in the dashboard.`
47
+ ? `Waiting for the owner to send the key for ${target.slug}. It arrives the next time they unlock the vault in the dashboard.`
48
48
  : `No key for ${target.slug} on this account. Open the project in the dashboard once.`);
49
49
  }
50
50
  for (const [id, k] of opened)
@@ -129,7 +129,7 @@ async function holderPrivateKey(linked, vault, opts) {
129
129
  const isGuest = vault.holder === "guest";
130
130
  if (!vault.publicKey || !vault.wrappedPrivateKey) {
131
131
  if (!opts.create) {
132
- throw new Error("No Vault password yet. Set a value first: npx getmyenv set KEY");
132
+ throw new Error("No Vault password yet. Set it in the dashboard, or set a value: npx getmyenv set KEY");
133
133
  }
134
134
  if (!isGuest) {
135
135
  console.error(pc.dim("Choose a Vault password. It stays on this machine. We store an encrypted key blob only.\n"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "getmyenv",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "CLI for getmyenv, an encrypted store for environment variables and secrets. We store ciphertext only.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@getmyenv/crypto": "0.4.1",
37
- "@getmyenv/shared": "0.8.0",
37
+ "@getmyenv/shared": "0.8.1",
38
38
  "@napi-rs/keyring": "^2.1.0",
39
39
  "commander": "^15.0.0",
40
40
  "dotenv": "^16.4.7",