summaryrefslogtreecommitdiff
path: root/packages/core/src
diff options
context:
space:
mode:
authorAbhi <[email protected]>2025-07-22 00:34:55 -0400
committerGitHub <[email protected]>2025-07-22 04:34:55 +0000
commit9daead63ddc4a0bddad05ec9f4bb7c0726da44f4 (patch)
treea756014f436f4cc356ca334a45494386027e7b4e /packages/core/src
parent5f813ef51076177aadccc0046f2182310d6b0a1a (diff)
(feat): Initial Version of Custom Commands (#4572)
Diffstat (limited to 'packages/core/src')
-rw-r--r--packages/core/src/utils/paths.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/packages/core/src/utils/paths.ts b/packages/core/src/utils/paths.ts
index 3382c588..5370a7cb 100644
--- a/packages/core/src/utils/paths.ts
+++ b/packages/core/src/utils/paths.ts
@@ -11,6 +11,7 @@ import * as crypto from 'crypto';
export const GEMINI_DIR = '.gemini';
export const GOOGLE_ACCOUNTS_FILENAME = 'google_accounts.json';
const TMP_DIR_NAME = 'tmp';
+const COMMANDS_DIR_NAME = 'commands';
/**
* Replaces the home directory with a tilde.
@@ -158,3 +159,20 @@ export function getProjectTempDir(projectRoot: string): string {
const hash = getProjectHash(projectRoot);
return path.join(os.homedir(), GEMINI_DIR, TMP_DIR_NAME, hash);
}
+
+/**
+ * Returns the absolute path to the user-level commands directory.
+ * @returns The path to the user's commands directory.
+ */
+export function getUserCommandsDir(): string {
+ return path.join(os.homedir(), GEMINI_DIR, COMMANDS_DIR_NAME);
+}
+
+/**
+ * Returns the absolute path to the project-level commands directory.
+ * @param projectRoot The absolute path to the project's root directory.
+ * @returns The path to the project's commands directory.
+ */
+export function getProjectCommandsDir(projectRoot: string): string {
+ return path.join(projectRoot, GEMINI_DIR, COMMANDS_DIR_NAME);
+}