aethel 0.3.2 → 0.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.3 (2026-04-05)
4
+
5
+ - Persist credentials to ~/.config/aethel/ after auth for seamless init
6
+
3
7
  ## 0.3.2 (2026-04-05)
4
8
 
5
9
  - Add --version flag, interactive init folder selection, and release script
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aethel",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Git-style Google Drive sync CLI with interactive TUI",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/cli.js CHANGED
@@ -20,7 +20,7 @@ function getGitHash() {
20
20
 
21
21
  const gitHash = getGitHash();
22
22
  const versionString = gitHash ? `${pkg.version} (${gitHash})` : pkg.version;
23
- import { resolveCredentialsPath, resolveTokenPath } from "./core/auth.js";
23
+ import { persistCredentials, resolveCredentialsPath, resolveTokenPath } from "./core/auth.js";
24
24
  import {
25
25
  initWorkspace,
26
26
  requireRoot,
@@ -119,8 +119,11 @@ async function handleAuth(options) {
119
119
  const repo = await openRepo(options, { requireWorkspace: false });
120
120
  const account = await repo.getAccountInfo();
121
121
 
122
+ const credentialsPath = resolveCredentialsPath(options.credentials);
123
+ await persistCredentials(credentialsPath);
124
+
122
125
  console.log("OAuth initialization completed.");
123
- console.log(`Credentials path: ${resolveCredentialsPath(options.credentials)}`);
126
+ console.log(`Credentials path: ${credentialsPath}`);
124
127
  console.log(`Token path: ${resolveTokenPath(options.token)}`);
125
128
  console.log(`Authenticated user: ${account.name}`);
126
129
  console.log(`Authenticated email: ${account.email}`);
package/src/core/auth.js CHANGED
@@ -29,6 +29,21 @@ function resolvePath(candidatePath, fallbackFileName) {
29
29
  return path.join(CONFIG_DIR, fallbackFileName);
30
30
  }
31
31
 
32
+ export { CONFIG_DIR };
33
+
34
+ /**
35
+ * Copy a credentials file into ~/.config/aethel/ so future commands
36
+ * work without --credentials. No-op if the file is already there.
37
+ */
38
+ export async function persistCredentials(sourcePath) {
39
+ const dest = path.join(CONFIG_DIR, DEFAULT_CREDENTIALS_PATH);
40
+ const resolved = path.resolve(sourcePath);
41
+ if (resolved === dest) return;
42
+ if (fsSyncFallback.existsSync(dest)) return;
43
+ await fs.mkdir(CONFIG_DIR, { recursive: true });
44
+ await fs.copyFile(resolved, dest);
45
+ }
46
+
32
47
  export function resolveCredentialsPath(customPath) {
33
48
  return resolvePath(
34
49
  customPath || process.env.GOOGLE_DRIVE_CREDENTIALS_PATH,