mirror of https://github.com/garrytan/gstack.git
feat: add Google Gemini / Antigravity Agent support
This commit is contained in:
parent
a861c00cfa
commit
913a1fa128
|
|
@ -22,6 +22,7 @@ bin/gstack-global-discover*
|
||||||
.openclaw/
|
.openclaw/
|
||||||
.hermes/
|
.hermes/
|
||||||
.gbrain/
|
.gbrain/
|
||||||
|
.gemini/
|
||||||
.gbrain-source
|
.gbrain-source
|
||||||
.context/
|
.context/
|
||||||
extension/.auth.json
|
extension/.auth.json
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,7 @@ Or target a specific agent with `./setup --host <name>`:
|
||||||
| Kiro | `--host kiro` | `~/.kiro/skills/gstack-*/` |
|
| Kiro | `--host kiro` | `~/.kiro/skills/gstack-*/` |
|
||||||
| Hermes | `--host hermes` | `~/.hermes/skills/gstack-*/` |
|
| Hermes | `--host hermes` | `~/.hermes/skills/gstack-*/` |
|
||||||
| GBrain (mod) | `--host gbrain` | `~/.gbrain/skills/gstack-*/` |
|
| GBrain (mod) | `--host gbrain` | `~/.gbrain/skills/gstack-*/` |
|
||||||
|
| Google Gemini CLI | `--host gemini` | `~/.gemini/skills/gstack-*/` |
|
||||||
|
|
||||||
**Want to add support for another agent?** See [docs/ADDING_A_HOST.md](docs/ADDING_A_HOST.md).
|
**Want to add support for another agent?** See [docs/ADDING_A_HOST.md](docs/ADDING_A_HOST.md).
|
||||||
It's one TypeScript config file, zero code changes.
|
It's one TypeScript config file, zero code changes.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
import type { HostConfig } from '../scripts/host-config';
|
||||||
|
|
||||||
|
const gemini: HostConfig = {
|
||||||
|
name: 'gemini',
|
||||||
|
displayName: 'Google Gemini CLI',
|
||||||
|
cliCommand: 'gemini',
|
||||||
|
cliAliases: [],
|
||||||
|
|
||||||
|
globalRoot: '.gemini/skills/gstack',
|
||||||
|
localSkillRoot: '.gemini/skills/gstack',
|
||||||
|
hostSubdir: '.gemini',
|
||||||
|
usesEnvVars: true,
|
||||||
|
|
||||||
|
frontmatter: {
|
||||||
|
mode: 'allowlist',
|
||||||
|
keepFields: ['name', 'description'],
|
||||||
|
descriptionLimit: null,
|
||||||
|
},
|
||||||
|
|
||||||
|
generation: {
|
||||||
|
generateMetadata: false,
|
||||||
|
skipSkills: ['codex'],
|
||||||
|
},
|
||||||
|
|
||||||
|
pathRewrites: [
|
||||||
|
{ from: '~/.claude/skills/gstack', to: '$GSTACK_ROOT' },
|
||||||
|
{ from: '.claude/skills/gstack', to: '.gemini/skills/gstack' },
|
||||||
|
{ from: '.claude/skills/review', to: '.gemini/skills/gstack/review' },
|
||||||
|
{ from: '.claude/skills', to: '.gemini/skills' },
|
||||||
|
],
|
||||||
|
|
||||||
|
suppressedResolvers: [
|
||||||
|
'GBRAIN_CONTEXT_LOAD',
|
||||||
|
'GBRAIN_SAVE_RESULTS',
|
||||||
|
],
|
||||||
|
|
||||||
|
runtimeRoot: {
|
||||||
|
globalSymlinks: ['bin', 'browse/dist', 'browse/bin', 'gstack-upgrade', 'ETHOS.md'],
|
||||||
|
globalFiles: {
|
||||||
|
'review': ['checklist.md', 'TODOS-format.md'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
install: {
|
||||||
|
prefixable: false,
|
||||||
|
linkingStrategy: 'symlink-generated',
|
||||||
|
},
|
||||||
|
|
||||||
|
coAuthorTrailer: 'Co-Authored-By: Google Gemini CLI <noreply@google.com>',
|
||||||
|
learningsMode: 'basic',
|
||||||
|
};
|
||||||
|
|
||||||
|
export default gemini;
|
||||||
|
|
@ -16,9 +16,10 @@ import cursor from './cursor';
|
||||||
import openclaw from './openclaw';
|
import openclaw from './openclaw';
|
||||||
import hermes from './hermes';
|
import hermes from './hermes';
|
||||||
import gbrain from './gbrain';
|
import gbrain from './gbrain';
|
||||||
|
import gemini from './gemini';
|
||||||
|
|
||||||
/** All registered host configs. Add new hosts here. */
|
/** All registered host configs. Add new hosts here. */
|
||||||
export const ALL_HOST_CONFIGS: HostConfig[] = [claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain];
|
export const ALL_HOST_CONFIGS: HostConfig[] = [claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain, gemini];
|
||||||
|
|
||||||
/** Map from host name to config. */
|
/** Map from host name to config. */
|
||||||
export const HOST_CONFIG_MAP: Record<string, HostConfig> = Object.fromEntries(
|
export const HOST_CONFIG_MAP: Record<string, HostConfig> = Object.fromEntries(
|
||||||
|
|
@ -65,4 +66,4 @@ export function getExternalHosts(): HostConfig[] {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-export individual configs for direct import
|
// Re-export individual configs for direct import
|
||||||
export { claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain };
|
export { claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain, gemini };
|
||||||
|
|
|
||||||
|
|
@ -979,7 +979,7 @@ for (const currentHost of hostsToRun) {
|
||||||
voice_line: catalogParts.voiceLine,
|
voice_line: catalogParts.voiceLine,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const relOutput = path.relative(OUT_DIR || ROOT, outputPath);
|
const relOutput = path.relative(OUT_DIR || ROOT, outputPath).replace(/\\/g, '/');
|
||||||
|
|
||||||
if (symlinkLoop) {
|
if (symlinkLoop) {
|
||||||
console.log(`SKIPPED (symlink loop): ${relOutput}`);
|
console.log(`SKIPPED (symlink loop): ${relOutput}`);
|
||||||
|
|
@ -1031,7 +1031,7 @@ for (const currentHost of hostsToRun) {
|
||||||
currentHostConfig.generation.skipSkills.includes(sec.skillDir)) continue;
|
currentHostConfig.generation.skipSkills.includes(sec.skillDir)) continue;
|
||||||
|
|
||||||
const { outputPath, content } = processSectionTemplate(path.join(ROOT, sec.tmpl), sec.skillDir, currentHost);
|
const { outputPath, content } = processSectionTemplate(path.join(ROOT, sec.tmpl), sec.skillDir, currentHost);
|
||||||
const relOutput = path.relative(OUT_DIR || ROOT, outputPath);
|
const relOutput = path.relative(OUT_DIR || ROOT, outputPath).replace(/\\/g, '/');
|
||||||
|
|
||||||
if (DRY_RUN) {
|
if (DRY_RUN) {
|
||||||
const existing = fs.existsSync(outputPath) ? fs.readFileSync(outputPath, 'utf-8') : '';
|
const existing = fs.existsSync(outputPath) ? fs.readFileSync(outputPath, 'utf-8') : '';
|
||||||
|
|
|
||||||
99
setup
99
setup
|
|
@ -24,6 +24,8 @@ FACTORY_SKILLS="$HOME/.factory/skills"
|
||||||
FACTORY_GSTACK="$FACTORY_SKILLS/gstack"
|
FACTORY_GSTACK="$FACTORY_SKILLS/gstack"
|
||||||
OPENCODE_SKILLS="$HOME/.config/opencode/skills"
|
OPENCODE_SKILLS="$HOME/.config/opencode/skills"
|
||||||
OPENCODE_GSTACK="$OPENCODE_SKILLS/gstack"
|
OPENCODE_GSTACK="$OPENCODE_SKILLS/gstack"
|
||||||
|
GEMINI_SKILLS="$HOME/.gemini/skills"
|
||||||
|
GEMINI_GSTACK="$GEMINI_SKILLS/gstack"
|
||||||
|
|
||||||
IS_WINDOWS=0
|
IS_WINDOWS=0
|
||||||
case "$(uname -s)" in
|
case "$(uname -s)" in
|
||||||
|
|
@ -85,7 +87,7 @@ NO_TEAM_MODE=0
|
||||||
PLAN_TUNE_HOOKS_MODE="" # "" = resolve from env/config/prompt; "yes"/"no" = explicit
|
PLAN_TUNE_HOOKS_MODE="" # "" = resolve from env/config/prompt; "yes"/"no" = explicit
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--host) [ -z "$2" ] && echo "Missing value for --host (expected claude, codex, kiro, factory, opencode, openclaw, hermes, gbrain, or auto)" >&2 && exit 1; HOST="$2"; shift 2 ;;
|
--host) [ -z "$2" ] && echo "Missing value for --host (expected claude, codex, kiro, factory, opencode, openclaw, hermes, gbrain, gemini, or auto)" >&2 && exit 1; HOST="$2"; shift 2 ;;
|
||||||
--host=*) HOST="${1#--host=}"; shift ;;
|
--host=*) HOST="${1#--host=}"; shift ;;
|
||||||
--local) LOCAL_INSTALL=1; shift ;;
|
--local) LOCAL_INSTALL=1; shift ;;
|
||||||
--prefix) SKILL_PREFIX=1; SKILL_PREFIX_FLAG=1; shift ;;
|
--prefix) SKILL_PREFIX=1; SKILL_PREFIX_FLAG=1; shift ;;
|
||||||
|
|
@ -101,7 +103,7 @@ while [ $# -gt 0 ]; do
|
||||||
done
|
done
|
||||||
|
|
||||||
case "$HOST" in
|
case "$HOST" in
|
||||||
claude|codex|kiro|factory|opencode|auto) ;;
|
claude|codex|kiro|factory|opencode|auto|gemini) ;;
|
||||||
openclaw)
|
openclaw)
|
||||||
echo ""
|
echo ""
|
||||||
echo "OpenClaw integration uses a different model — OpenClaw spawns Claude Code"
|
echo "OpenClaw integration uses a different model — OpenClaw spawns Claude Code"
|
||||||
|
|
@ -200,14 +202,16 @@ INSTALL_CODEX=0
|
||||||
INSTALL_KIRO=0
|
INSTALL_KIRO=0
|
||||||
INSTALL_FACTORY=0
|
INSTALL_FACTORY=0
|
||||||
INSTALL_OPENCODE=0
|
INSTALL_OPENCODE=0
|
||||||
|
INSTALL_GEMINI=0
|
||||||
if [ "$HOST" = "auto" ]; then
|
if [ "$HOST" = "auto" ]; then
|
||||||
command -v claude >/dev/null 2>&1 && INSTALL_CLAUDE=1
|
command -v claude >/dev/null 2>&1 && INSTALL_CLAUDE=1
|
||||||
command -v codex >/dev/null 2>&1 && INSTALL_CODEX=1
|
command -v codex >/dev/null 2>&1 && INSTALL_CODEX=1
|
||||||
command -v kiro-cli >/dev/null 2>&1 && INSTALL_KIRO=1
|
command -v kiro-cli >/dev/null 2>&1 && INSTALL_KIRO=1
|
||||||
command -v droid >/dev/null 2>&1 && INSTALL_FACTORY=1
|
command -v droid >/dev/null 2>&1 && INSTALL_FACTORY=1
|
||||||
command -v opencode >/dev/null 2>&1 && INSTALL_OPENCODE=1
|
command -v opencode >/dev/null 2>&1 && INSTALL_OPENCODE=1
|
||||||
|
command -v gemini >/dev/null 2>&1 && INSTALL_GEMINI=1
|
||||||
# If none found, default to claude
|
# If none found, default to claude
|
||||||
if [ "$INSTALL_CLAUDE" -eq 0 ] && [ "$INSTALL_CODEX" -eq 0 ] && [ "$INSTALL_KIRO" -eq 0 ] && [ "$INSTALL_FACTORY" -eq 0 ] && [ "$INSTALL_OPENCODE" -eq 0 ]; then
|
if [ "$INSTALL_CLAUDE" -eq 0 ] && [ "$INSTALL_CODEX" -eq 0 ] && [ "$INSTALL_KIRO" -eq 0 ] && [ "$INSTALL_FACTORY" -eq 0 ] && [ "$INSTALL_OPENCODE" -eq 0 ] && [ "$INSTALL_GEMINI" -eq 0 ]; then
|
||||||
INSTALL_CLAUDE=1
|
INSTALL_CLAUDE=1
|
||||||
fi
|
fi
|
||||||
elif [ "$HOST" = "claude" ]; then
|
elif [ "$HOST" = "claude" ]; then
|
||||||
|
|
@ -220,6 +224,8 @@ elif [ "$HOST" = "factory" ]; then
|
||||||
INSTALL_FACTORY=1
|
INSTALL_FACTORY=1
|
||||||
elif [ "$HOST" = "opencode" ]; then
|
elif [ "$HOST" = "opencode" ]; then
|
||||||
INSTALL_OPENCODE=1
|
INSTALL_OPENCODE=1
|
||||||
|
elif [ "$HOST" = "gemini" ]; then
|
||||||
|
INSTALL_GEMINI=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
migrate_direct_codex_install() {
|
migrate_direct_codex_install() {
|
||||||
|
|
@ -475,6 +481,16 @@ if [ "$INSTALL_OPENCODE" -eq 1 ] && [ "$NEEDS_BUILD" -eq 0 ]; then
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 1e. Generate .gemini/ Gemini skill docs
|
||||||
|
if [ "$INSTALL_GEMINI" -eq 1 ] && [ "$NEEDS_BUILD" -eq 0 ]; then
|
||||||
|
log "Generating .gemini/ skill docs..."
|
||||||
|
(
|
||||||
|
cd "$SOURCE_GSTACK_DIR"
|
||||||
|
bun_cmd install --frozen-lockfile 2>/dev/null || bun_cmd install
|
||||||
|
bun_cmd run gen:skill-docs --host gemini
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
# 2. Ensure Playwright's Chromium is available
|
# 2. Ensure Playwright's Chromium is available
|
||||||
if ! ensure_playwright_browser; then
|
if ! ensure_playwright_browser; then
|
||||||
echo "Installing Playwright Chromium..."
|
echo "Installing Playwright Chromium..."
|
||||||
|
|
@ -908,6 +924,73 @@ create_opencode_runtime_root() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create_gemini_runtime_root() {
|
||||||
|
local gstack_dir="$1"
|
||||||
|
local gemini_gstack="$2"
|
||||||
|
local gemini_dir="$gstack_dir/.gemini/skills"
|
||||||
|
|
||||||
|
if [ -L "$gemini_gstack" ]; then
|
||||||
|
rm -f "$gemini_gstack"
|
||||||
|
elif [ -d "$gemini_gstack" ] && [ "$gemini_gstack" != "$gstack_dir" ]; then
|
||||||
|
rm -rf "$gemini_gstack"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$gemini_gstack" "$gemini_gstack/browse" "$gemini_gstack/review"
|
||||||
|
|
||||||
|
if [ -f "$gemini_dir/gstack/SKILL.md" ]; then
|
||||||
|
_link_or_copy "$gemini_dir/gstack/SKILL.md" "$gemini_gstack/SKILL.md"
|
||||||
|
fi
|
||||||
|
if [ -d "$gstack_dir/bin" ]; then
|
||||||
|
_link_or_copy "$gstack_dir/bin" "$gemini_gstack/bin"
|
||||||
|
fi
|
||||||
|
if [ -d "$gstack_dir/browse/dist" ]; then
|
||||||
|
_link_or_copy "$gstack_dir/browse/dist" "$gemini_gstack/browse/dist"
|
||||||
|
fi
|
||||||
|
if [ -d "$gstack_dir/browse/bin" ]; then
|
||||||
|
_link_or_copy "$gstack_dir/browse/bin" "$gemini_gstack/browse/bin"
|
||||||
|
fi
|
||||||
|
for f in checklist.md TODOS-format.md; do
|
||||||
|
if [ -f "$gstack_dir/review/$f" ]; then
|
||||||
|
_link_or_copy "$gstack_dir/review/$f" "$gemini_gstack/review/$f"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ -f "$gstack_dir/ETHOS.md" ]; then
|
||||||
|
_link_or_copy "$gstack_dir/ETHOS.md" "$gemini_gstack/ETHOS.md"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
link_gemini_skill_dirs() {
|
||||||
|
local gstack_dir="$1"
|
||||||
|
local skills_dir="$2"
|
||||||
|
local gemini_dir="$gstack_dir/.gemini/skills"
|
||||||
|
local linked=()
|
||||||
|
|
||||||
|
if [ ! -d "$gemini_dir" ]; then
|
||||||
|
echo " Generating .gemini/ skill docs..."
|
||||||
|
( cd "$gstack_dir" && bun run gen:skill-docs --host gemini )
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "$gemini_dir" ]; then
|
||||||
|
echo " warning: .gemini/skills/ generation failed — run 'bun run gen:skill-docs --host gemini' manually" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for skill_dir in "$gemini_dir"/gstack*/; do
|
||||||
|
if [ -f "$skill_dir/SKILL.md" ]; then
|
||||||
|
skill_name="$(basename "$skill_dir")"
|
||||||
|
[ "$skill_name" = "gstack" ] && continue
|
||||||
|
target="$skills_dir/$skill_name"
|
||||||
|
if [ -L "$target" ] || [ ! -e "$target" ]; then
|
||||||
|
_link_or_copy "$skill_dir" "$target"
|
||||||
|
linked+=("$skill_name")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ ${#linked[@]} -gt 0 ]; then
|
||||||
|
echo " linked skills: ${linked[*]}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
link_factory_skill_dirs() {
|
link_factory_skill_dirs() {
|
||||||
local gstack_dir="$1"
|
local gstack_dir="$1"
|
||||||
local skills_dir="$2"
|
local skills_dir="$2"
|
||||||
|
|
@ -1193,6 +1276,16 @@ if [ "$INSTALL_OPENCODE" -eq 1 ]; then
|
||||||
echo " opencode skills: $OPENCODE_SKILLS"
|
echo " opencode skills: $OPENCODE_SKILLS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 6d. Install for Gemini
|
||||||
|
if [ "$INSTALL_GEMINI" -eq 1 ]; then
|
||||||
|
mkdir -p "$GEMINI_SKILLS"
|
||||||
|
create_gemini_runtime_root "$SOURCE_GSTACK_DIR" "$GEMINI_GSTACK"
|
||||||
|
link_gemini_skill_dirs "$SOURCE_GSTACK_DIR" "$GEMINI_SKILLS"
|
||||||
|
echo "gstack ready (gemini)."
|
||||||
|
echo " browse: $BROWSE_BIN"
|
||||||
|
echo " gemini skills: $GEMINI_SKILLS"
|
||||||
|
fi
|
||||||
|
|
||||||
# 7. Create .agents/ sidecar symlinks for the real Codex skill target.
|
# 7. Create .agents/ sidecar symlinks for the real Codex skill target.
|
||||||
# The root Codex skill ends up pointing at $SOURCE_GSTACK_DIR/.agents/skills/gstack,
|
# The root Codex skill ends up pointing at $SOURCE_GSTACK_DIR/.agents/skills/gstack,
|
||||||
# so the runtime assets must live there for both global and repo-local installs.
|
# so the runtime assets must live there for both global and repo-local installs.
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@ const ROOT = path.resolve(import.meta.dir, '..');
|
||||||
// ─── hosts/index.ts ─────────────────────────────────────────
|
// ─── hosts/index.ts ─────────────────────────────────────────
|
||||||
|
|
||||||
describe('hosts/index.ts', () => {
|
describe('hosts/index.ts', () => {
|
||||||
test('ALL_HOST_CONFIGS has 10 hosts', () => {
|
test('ALL_HOST_CONFIGS has 11 hosts', () => {
|
||||||
expect(ALL_HOST_CONFIGS.length).toBe(10);
|
expect(ALL_HOST_CONFIGS.length).toBe(11);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('ALL_HOST_NAMES matches config names', () => {
|
test('ALL_HOST_NAMES matches config names', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue