Back to Home
CLI Commands

Configuration Reference

Complete reference for .gk.json and settings.json configuration

Overview

GemKit uses two configuration files in the .gemini/ directory:

  • .gk.json - Project settings, plans, paths, and agent configuration
  • settings.json - Tools, hooks, and automation settings

.gk.json Reference

The main project configuration file.

Plan Settings

json
{
  "plan": {
    "namingFormat": "{date}-{issue}-{slug}",
    "dateFormat": "YYMMDD-HHmm",
    "issuePrefix": "GH-",
    "reportsDir": "reports",
    "resolutionOrder": ["session", "branch"],
    "branchPattern": "^(?:feature|fix|chore)/(?<name>.+)$"
  }
}
FieldDescription
namingFormatTemplate for plan file names
dateFormatDate format in plan names
issuePrefixPrefix for issue references
reportsDirDirectory for generated reports
resolutionOrderOrder to resolve plan context
branchPatternRegex to extract branch names

Path Configuration

json
{
  "paths": {
    "docs": "docs",
    "plans": "plans"
  }
}
FieldDescription
docsDocumentation directory
plansPlans directory

Agent Spawning

json
{
  "spawn": {
    "agentsDir": ".gemini/agents",
    "defaultModel": "gemini-2.5-flash",
    "music": false
  }
}
FieldDescription
agentsDirDirectory containing agent definitions
defaultModelDefault AI model for agents
musicEnable ambient music during execution

Project Detection

json
{
  "project": {
    "type": "auto",
    "packageManager": "auto",
    "framework": "auto"
  }
}

All fields default to "auto" for automatic detection.

Notifications

json
{
  "notifications": {
    "discord": {
      "enabled": true,
      "mainAgent": true,
      "subAgentRoles": ["code-executor", "git-manager"]
    }
  }
}
FieldDescription
discord.enabledEnable Discord notifications
discord.mainAgentNotify for main agent events
discord.subAgentRolesRoles that trigger notifications

Locale and Trust

json
{
  "locale": {
    "responseLanguage": null
  },
  "trust": {
    "enabled": false,
    "passphrase": null
  }
}

Assertions

json
{
  "assertions": []
}

Custom assertions for validation (empty by default).

settings.json Reference

Controls tools, hooks, and automation behavior.

Tools Configuration

json
{
  "tools": {
    "hooks": true,
    "allowedTools": [
      "list", "read", "write", "glob", "search",
      "replace", "fetch", "memory", "todolist",
      "websearch", "shell"
    ],
    "interactiveShell": {
      "enabled": false,
      "inactivityTimeout": 60
    },
    "color": true,
    "autoApproved": ["git", "npm", "npx", "npm install", "npm run build"]
  }
}
FieldDescription
hooksEnable/disable hooks system
allowedToolsList of tools agents can use
interactiveShell.enabledAllow interactive shell
interactiveShell.inactivityTimeoutShell timeout in seconds
colorEnable colored output
autoApprovedCommands that don't require approval

Hooks Configuration

Hooks are defined in settings.json with lifecycle stages:

json
{
  "hooks": {
    "SessionStart": [
      {
        "command": "node .gemini/hooks/gk-session-init.cjs",
        "timeout": 30000,
        "matcher": "*"
      }
    ],
    "BeforeAgent": [
      {
        "command": "node .gemini/hooks/gk-session-init.cjs",
        "timeout": 30000,
        "matcher": "*"
      },
      {
        "command": "node .gemini/hooks/gk-dev-rules-reminder.cjs",
        "timeout": 10000,
        "matcher": "*"
      }
    ],
    "BeforeModel": [
      {
        "command": "node .gemini/hooks/gk-session-init.cjs",
        "timeout": 5000,
        "matcher": "*"
      }
    ],
    "SessionEnd": [
      {
        "command": "node .gemini/hooks/gk-session-end.cjs",
        "timeout": 10000,
        "matcher": "*"
      }
    ]
  }
}

Hook Lifecycle Stages

StageWhen It Runs
SessionStartWhen a new session begins
BeforeAgentBefore an agent processes a request
BeforeModelBefore sending to the AI model
SessionEndWhen session completes

Hook Object Properties

PropertyTypeDescription
commandstringCommand to execute
timeoutnumberTimeout in milliseconds
matcherstringPattern to match (* for all)

Environment Variables

Required

VariableDescription
GEMINI_API_KEYGoogle Gemini API key

Optional

VariableDescription
ANTHROPIC_API_KEYClaude API key for dual-provider
DISCORD_WEBHOOKDiscord webhook URL for notifications

Setting Environment Variables

Linux/macOS:

bash
export GEMINI_API_KEY=your-key-here

Windows (PowerShell):

powershell
$env:GEMINI_API_KEY = "your-key-here"

.gkignore Reference

Specify files to ignore when loading context:

node_modules/
dist/
build/
.next/
.env
*.log

Complete .gk.json Example

json
{
  "plan": {
    "namingFormat": "{date}-{issue}-{slug}",
    "dateFormat": "YYMMDD-HHmm",
    "issuePrefix": "GH-",
    "reportsDir": "reports",
    "resolutionOrder": ["session", "branch"],
    "branchPattern": "^(?:feature|fix|chore)/(?<name>.+)$"
  },
  "paths": {
    "docs": "docs",
    "plans": "plans"
  },
  "spawn": {
    "agentsDir": ".gemini/agents",
    "defaultModel": "gemini-2.5-flash",
    "music": false
  },
  "project": {
    "type": "auto",
    "packageManager": "auto",
    "framework": "auto"
  },
  "notifications": {
    "discord": {
      "enabled": true,
      "mainAgent": true,
      "subAgentRoles": ["code-executor", "git-manager"]
    }
  },
  "locale": {
    "responseLanguage": null
  },
  "trust": {
    "enabled": false,
    "passphrase": null
  },
  "assertions": []
}
Caught a mistake? Edit this page on GitHub
Updated: Jan 20, 2026