Add Antigravity global skills config sync to skill commands
Sync ~/.gemini/config/skills.json to include the user's absolute global agents skills directory (~/.agents/skills) upon global skill install, and expose Antigravity status in skill status. - Prepend the absolute path to entries if not already present - Migrate legacy tilde path to absolute path to ensure discovery - Avoid modifying config if target path is already registered - Provide unit tests covering creation, deduplication, and prepend
This commit is contained in:
1 parent
eb77ca1aef
commit
ee4cb332d9
3 files changed
+258
-5
No files matched your search
@@ -1,9 +1,11 @@
|
||||
import { existsSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import {
|
||||
getAntigravitySkillsStatus,
|
||||
getDefaultGlobalSkillDir,
|
||||
getSkillContent,
|
||||
installSkillFiles
|
||||
installSkillFiles,
|
||||
syncAntigravitySkillsConfig
|
||||
} from "../../core/embedded-skill.js";
|
||||
import { booleanOption, stringOption } from "../parser.js";
|
||||
import { printJson } from "../printer.js";
|
||||
@@ -25,11 +27,15 @@ export function handleSkillCommand(action: string | undefined, maybeName: string
|
||||
: getDefaultGlobalSkillDir();
|
||||
|
||||
const result = installSkillFiles(targetDir);
|
||||
const isGlobal = !isLocal && !customDir;
|
||||
const antigravity = isGlobal ? syncAntigravitySkillsConfig() : undefined;
|
||||
|
||||
printJson({
|
||||
installed: true,
|
||||
targetDir: result.targetDir,
|
||||
fileCount: result.files.length,
|
||||
files: result.files
|
||||
files: result.files,
|
||||
...(antigravity ? { antigravity } : {})
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -37,6 +43,7 @@ export function handleSkillCommand(action: string | undefined, maybeName: string
|
||||
if (action === "status" || action === "get" || !action) {
|
||||
const globalDir = getDefaultGlobalSkillDir();
|
||||
const localDir = join(process.cwd(), ".agents", "skills", "seal-use");
|
||||
const antigravity = getAntigravitySkillsStatus();
|
||||
printJson({
|
||||
global: {
|
||||
dir: globalDir,
|
||||
@@ -45,7 +52,8 @@ export function handleSkillCommand(action: string | undefined, maybeName: string
|
||||
local: {
|
||||
dir: localDir,
|
||||
installed: existsSync(join(localDir, "SKILL.md"))
|
||||
}
|
||||
},
|
||||
antigravity
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user