Skip to content

feat: native Gemini CLI support via GEMINI.md configuration files#565

Open
ChetanTekur wants to merge 3 commits intogarrytan:mainfrom
ChetanTekur:gemini-config-fix
Open

feat: native Gemini CLI support via GEMINI.md configuration files#565
ChetanTekur wants to merge 3 commits intogarrytan:mainfrom
ChetanTekur:gemini-config-fix

Conversation

@ChetanTekur
Copy link
Copy Markdown

What

Adds native support for the Gemini CLI by migrating hardcoded CLAUDE.md references to a dynamic configuration file (GEMINI.md for Gemini, CLAUDE.md for Claude/Codex).

Why

Currently, gstack assumes CLAUDE.md is the universal source of truth for project configurations. When using the Gemini CLI, agents attempting to update or read configurations default to CLAUDE.md. This creates friction, confuses the agent, and pollutes the workspace with Claude-specific files for non-Claude users.

How

  1. Dynamic Config Path: Added configFile to HostPaths (scripts/resolvers/types.ts) and updated existing resolvers (testing.ts, utility.ts) to use ctx.paths.configFile instead of hardcoded strings.
  2. Template Tag: Added a {{CONFIG_FILE}} resolver (scripts/resolvers/index.ts) for future template authoring.
  3. Generator Pipeline: Added a global replacement in scripts/gen-skill-docs.ts so any static CLAUDE.md references in .tmpl files are automatically rewritten to GEMINI.md when compiling for the --host gemini target.
  4. Setup Script: Updated ./setup to perform the CLAUDE.md -> GEMINI.md translation via sed when installing skills into ~/.gemini/skills/gstack.
  5. Documentation: Added GEMINI.md and GEMINI.md.tmpl at the root.

This ensures 100% backward compatibility for Claude and Codex hosts while providing a seamless, native experience for Gemini users.

Testing

  • Rebased against main and resolved merge conflicts.
  • Verified TypeScript compilation via bun run build.
  • Verified the setup script correctly formats .agents/skills for the Gemini host without altering Claude's output.

@akshaybroota
Copy link
Copy Markdown

Bug found during testing

File: scripts/resolvers/utility.ts, line 374

The generateCoAuthorTrailer function is missing its closing } before generateConfigFile starts, causing a syntax error that breaks bun run gen:skill-docs entirely:

export function generateCoAuthorTrailer(ctx: TemplateContext): string {
  if (ctx.host === 'codex') {
    return 'Co-Authored-By: OpenAI Codex <noreply@openai.com>';
  }
  return 'Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>';
// ← missing closing } here
export function generateConfigFile(ctx: TemplateContext): string {
  return ctx.paths.configFile;
}

Error when running bun run gen:skill-docs:

error: Unexpected export
    at scripts/resolvers/utility.ts:375:1

Fix: Add the missing } to close generateCoAuthorTrailer before generateConfigFile begins.

Once fixed, gen:skill-docs runs cleanly for all three hosts (claude, codex, gemini) and the dry-run freshness check passes. The core Gemini support logic looks correct.

ChetanTekur and others added 3 commits April 1, 2026 21:43
- Update templates and resolvers to use `ctx.paths.configFile` instead of hardcoding `CLAUDE.md`
- Add dynamic `CONFIG_FILE` resolver for future template usage
- Apply global replacement in `gen-skill-docs.ts` so `CLAUDE.md` references become `GEMINI.md` for the gemini host
- Update `setup` to remap `CLAUDE.md` to `GEMINI.md` when installing the skills
- Provide `GEMINI.md` and `GEMINI.md.tmpl` configuration docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants