From 8061c4c91445e9caf7340e05859ea98dffaaf6be Mon Sep 17 00:00:00 2001 From: zhaojunchang Date: Tue, 7 Apr 2026 23:08:35 +0800 Subject: [PATCH 1/2] feat: linux support custom data dir via environment variable --- internal/keychain/keychain_other.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/keychain/keychain_other.go b/internal/keychain/keychain_other.go index d84ad84b..e369bccc 100644 --- a/internal/keychain/keychain_other.go +++ b/internal/keychain/keychain_other.go @@ -25,6 +25,9 @@ const tagBytes = 16 // StorageDir returns the directory where encrypted files are stored. func StorageDir(service string) string { + if dir := os.Getenv("LARKSUITE_CLI_DATA_DIR"); dir != "" { + return dir + } home, err := vfs.UserHomeDir() if err != nil || home == "" { // If home is missing, fallback to relative path and print warning. From f567cc9ad30e7dd1c799586733193179297764dc Mon Sep 17 00:00:00 2001 From: zhaojunchang Date: Tue, 7 Apr 2026 23:16:43 +0800 Subject: [PATCH 2/2] feat(keychain): support custom log directory via LARKSUITE_CLI_LOG_DIR --- internal/keychain/auth_log.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/keychain/auth_log.go b/internal/keychain/auth_log.go index 079f8cd9..12b31515 100644 --- a/internal/keychain/auth_log.go +++ b/internal/keychain/auth_log.go @@ -21,6 +21,10 @@ var ( ) func authLogDir() string { + if dir := os.Getenv("LARKSUITE_CLI_LOG_DIR"); dir != "" { + return dir + } + if dir := os.Getenv("LARKSUITE_CLI_CONFIG_DIR"); dir != "" { return filepath.Join(dir, "logs") }