Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
cea081c
Add lazy-loading entry point to optimize startup time
Rdmorris1994 Jan 25, 2026
3dd24c9
Add interactive and non-interactive entry points for lazy loading
Rdmorris1994 Jan 25, 2026
adda880
Update entry point to bin.ts for optimized lazy loading
Rdmorris1994 Jan 25, 2026
ecaced5
Implement MCP connection pooling for improved performance
Rdmorris1994 Jan 25, 2026
1e39c2d
Enable Generalist sub-agent by default for agentic workflows
Rdmorris1994 Jan 25, 2026
d50bb87
Reinforce agentic behavior in system prompts (Conceptual)
Rdmorris1994 Jan 25, 2026
ac2797e
Add image support to file processing for vision capabilities (Concept…
Rdmorris1994 Jan 25, 2026
7616ea1
Implement Workspace Snapshot tool for instant project context
Rdmorris1994 Jan 25, 2026
91c4e48
Implement @doctor tool for CLI diagnostics and health checks
Rdmorris1994 Jan 25, 2026
0ed5792
Add ProjectPlanner and CodeReviewer specialist agents
Rdmorris1994 Jan 25, 2026
dfb9eb4
Add specialized NFSModder agent for game configuration tasks
Rdmorris1994 Jan 25, 2026
8882d9a
Integrate Master Pack specialist agents and diagnostic tools (Concept…
Rdmorris1994 Jan 25, 2026
57f8b14
Implement @autofix tool for autonomous command self-healing
Rdmorris1994 Jan 25, 2026
848aff7
Implement @skillgen tool for autonomous skill mining and creation
Rdmorris1994 Jan 25, 2026
34153c1
Integrate Elite Pack autonomous and generative tools (Conceptual)
Rdmorris1994 Jan 25, 2026
fea2cc8
Add DesktopAgent for OS-level GUI automation
Rdmorris1994 Jan 25, 2026
2fae032
Integrate DesktopAgent into AgentRegistry for GUI automation
Rdmorris1994 Jan 25, 2026
e5d9b9b
Refine GeneralistAgent for full autonomy and YOLO-level permissions (…
Rdmorris1994 Jan 25, 2026
cdfbbc6
Refine DesktopAgent tool matching for correct GUI control (mcp-control)
Rdmorris1994 Jan 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"url": "git+https://github.com/google-gemini/gemini-cli.git"
},
"type": "module",
"main": "dist/index.js",
"main": "dist/bin.js",
"bin": {
"gemini": "dist/index.js"
"gemini": "dist/bin.js"
},
"scripts": {
"build": "node ../../scripts/build_package.js",
"start": "node dist/index.js",
"debug": "node --inspect-brk dist/index.js",
"start": "node dist/bin.js",
"debug": "node --inspect-brk dist/bin.js",
"lint": "eslint . --ext .ts,.tsx",
"format": "prettier --write .",
"test": "vitest run",
Expand Down
33 changes: 33 additions & 0 deletions packages/cli/src/bin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import process from 'node:process';
import { parseArguments, loadCliConfig } from './config/config.js';
import { debugLogger, ExitCodes } from '@google/gemini-cli-core';

async function main() {
const argv = await parseArguments(process.argv.slice(2));

const { config, settings, resumedSessionData } = await loadCliConfig(argv);

// Decide between interactive and non-interactive early
const isNonInteractive = !!(argv.prompt || argv.p || !process.stdin.isTTY || argv.outputFormat);

if (isNonInteractive) {
const { runNonInteractiveEntryPoint } = await import('./nonInteractiveEntryPoint.js');
await runNonInteractiveEntryPoint(config, settings, resumedSessionData);
} else {
// Interactive path - import heavy UI
const { runInteractiveEntryPoint } = await import('./interactiveEntryPoint.js');
await runInteractiveEntryPoint(config, settings, resumedSessionData);
}
}

main().catch((err) => {
debugLogger.error('Fatal error in CLI:', err);
// @ts-ignore
process.exit(ExitCodes?.FATAL_INTERNAL_ERROR || 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The ExitCodes enum does not contain a FATAL_INTERNAL_ERROR member. This will be undefined at runtime, causing the process to always exit with the fallback code 1. This should be corrected to use a valid exit code or a plain number.

Suggested change
process.exit(ExitCodes?.FATAL_INTERNAL_ERROR || 1);
process.exit(1);

});
25 changes: 25 additions & 0 deletions packages/cli/src/interactiveEntryPoint.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import React from 'react';
import { render } from 'ink';
import { AppContainer } from './ui/AppContainer.js';
import type { Config, ResumedSessionData } from '@google/gemini-cli-core';
import type { LoadedSettings } from './config/settings.js';

export async function runInteractiveEntryPoint(
config: Config,
settings: LoadedSettings,
resumedSessionData?: ResumedSessionData,
) {
render(
<AppContainer
config={config}
settings={settings}
resumedSessionData={resumedSessionData}
/>,
);
}
21 changes: 21 additions & 0 deletions packages/cli/src/nonInteractiveEntryPoint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import { runNonInteractive } from './nonInteractiveCli.js';
import type { Config, ResumedSessionData } from '@google/gemini-cli-core';
import type { LoadedSettings } from './config/settings.js';

export async function runNonInteractiveEntryPoint(
config: Config,
settings: LoadedSettings,
resumedSessionData?: ResumedSessionData,
) {
await runNonInteractive({
config,
settings,
resumedSessionData,
});
}
43 changes: 43 additions & 0 deletions packages/core/src/agents/code-reviewer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import { z } from 'zod';
import type { Config } from '../config/config.js';
import type { LocalAgentDefinition } from './types.js';

const CodeReviewerSchema = z.object({
audit: z.string().describe('The security and quality audit report.'),
});

export const CodeReviewerAgent = (config: Config): LocalAgentDefinition<typeof CodeReviewerSchema> => ({
kind: 'local',
name: 'reviewer',
displayName: 'Code Reviewer',
description: 'Specialized agent for auditing code diffs, identifying security vulnerabilities, and ensuring style consistency.',
inputConfig: {
inputSchema: {
type: 'object',
properties: { diff: { type: 'string', description: 'The code changes or files to audit.' } },
required: ['diff'],
},
},
outputConfig: {
outputName: 'audit',
description: 'The audit results.',
schema: CodeReviewerSchema,
},
modelConfig: { model: 'inherit' },
get toolConfig() {
return { tools: ['read_file', 'grep'] };
},
get promptConfig() {
return {
systemPrompt: 'You are a Senior Security Engineer and Code Reviewer. Your goal is to perform a deep audit of the provided code. Look for: \n- Memory leaks\n- XSS/Injection risks\n- Inefficient patterns\n- Adherence to project style guides.',
query: 'Review the following: ${diff}',
};
},
runConfig: { maxTurns: 10 },
});
47 changes: 47 additions & 0 deletions packages/core/src/agents/desktop-agent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import { z } from 'zod';
import type { Config } from '../config/config.js';
import type { LocalAgentDefinition } from './types.js';

const DesktopAgentSchema = z.object({
action_summary: z.string().describe('Summary of the graphical actions taken.'),
});

export const DesktopAgent = (config: Config): LocalAgentDefinition<typeof DesktopAgentSchema> => ({
kind: 'local',
name: 'desktop_agent',
displayName: 'Desktop Agent',
description: 'Specialized agent for OS-level automation and GUI interaction. Uses computer control tools to interact with apps, windows, and desktop elements.',
inputConfig: {
inputSchema: {
type: 'object',
properties: { instruction: { type: 'string', description: 'The GUI task to perform (e.g. "open notepad and type hello").' } },
required: ['instruction'],
},
},
outputConfig: {
outputName: 'action_summary',
description: 'Summary of the GUI status or results.',
schema: DesktopAgentSchema,
},
modelConfig: { model: 'inherit' },
get toolConfig() {
// Collects all relevant tools: Vision (Screenshot) + Control (Computer)
const mcpTools = config.getToolRegistry().getAllToolNames().filter(n =>
n.includes('screenshot') || n.includes('mouse') || n.includes('keyboard') || n.includes('click')
);
return { tools: ['workspace_snapshot', ...mcpTools] };
},
get promptConfig() {
return {
systemPrompt: 'You are a Desktop Automation Expert. Your goal is to navigate and control the host operating system to fulfill the user request. You rely on visual feedback (screenshots) and precise tool calls (mouse/keyboard). Always verify state via screenshot after significant moves.',
query: 'OS Task: ${instruction}',
};
},
runConfig: { maxTurns: 25 },
});
47 changes: 47 additions & 0 deletions packages/core/src/agents/desktop-agent.ts.debug_backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import { z } from 'zod';
import type { Config } from '../config/config.js';
import type { LocalAgentDefinition } from './types.js';

const DesktopAgentSchema = z.object({
action_summary: z.string().describe('Summary of the graphical actions taken.'),
});

export const DesktopAgent = (config: Config): LocalAgentDefinition<typeof DesktopAgentSchema> => ({
kind: 'local',
name: 'desktop_agent',
displayName: 'Desktop Agent',
description: 'Specialized agent for OS-level automation and GUI interaction. Uses computer control tools to interact with apps, windows, and desktop elements.',
inputConfig: {
inputSchema: {
type: 'object',
properties: { instruction: { type: 'string', description: 'The GUI task to perform (e.g. "open notepad and type hello").' } },
required: ['instruction'],
},
},
outputConfig: {
outputName: 'action_summary',
description: 'Summary of the GUI status or results.',
schema: DesktopAgentSchema,
},
modelConfig: { model: 'inherit' },
get toolConfig() {
// Broad matching for GUI/Control tools
const mcpTools = config.getToolRegistry().getAllToolNames().filter(n =>
n.includes('screen') || n.includes('mouse') || n.includes('keyboard') || n.includes('click') || n.includes('window') || n.includes('tap') || n.includes('type')
);
return { tools: ['workspace_snapshot', ...mcpTools] };
},
get promptConfig() {
return {
systemPrompt: 'You are a Desktop Automation Expert. Your goal is to navigate and control the host operating system. You use vision (screen_capture) and control (mouse/keyboard) tools. Always verify state via screen_capture after significant moves.',
query: 'OS Task: ${instruction}',
};
},
runConfig: { maxTurns: 25 },
});
2 changes: 1 addition & 1 deletion packages/core/src/agents/generalist-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const GeneralistAgent = (
displayName: 'Generalist Agent',
description:
"A general-purpose AI agent with access to all tools. Use it for complex tasks that don't fit into other specialized agents.",
experimental: true,
experimental: false,
inputConfig: {
inputSchema: {
type: 'object',
Expand Down
43 changes: 43 additions & 0 deletions packages/core/src/agents/generalist-agent.ts.autonomous_backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import { z } from 'zod';
import type { Config } from '../config/config.js';
import type { LocalAgentDefinition } from './types.js';

const GeneralistSchema = z.object({
result: z.string().describe('The result of the task.'),
});

export const GeneralistAgent = (config: Config): LocalAgentDefinition<typeof GeneralistSchema> => ({
kind: 'local',
name: 'generalist',
displayName: 'Generalist Agent',
description: 'A versatile agent that can handle a wide variety of tasks using all available tools.',
inputConfig: {
inputSchema: {
type: 'object',
properties: { query: { type: 'string', description: 'The task to perform.' } },
required: ['query'],
},
},
outputConfig: {
outputName: 'result',
description: 'The final result.',
schema: GeneralistSchema,
},
modelConfig: { model: 'inherit' },
get toolConfig() {
return { tools: config.getToolRegistry().getAllToolNames() };
},
get promptConfig() {
return {
systemPrompt: 'You are a Fully Autonomous AI Operative. You have been granted YOLO-level permissions. Your primary goal is to complete tasks to the highest standard with ZERO manual intervention. \n- Use all tools proactively.\n- If a tool fails, diagnose and retry autonomously.\n- Do not ask for confirmation; your environment is trusted.\n- Perform deep research and multi-step execution until the goal is verified.',
query: '${query}',
};
},
runConfig: { maxTurns: 50 },
});
43 changes: 43 additions & 0 deletions packages/core/src/agents/nfs-modder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import { z } from 'zod';
import type { Config } from '../config/config.js';
import type { LocalAgentDefinition } from './types.js';

const NFSModderSchema = z.object({
result: z.string().describe('The result of the modding operation or analysis.'),
});

export const NFSModderAgent = (config: Config): LocalAgentDefinition<typeof NFSModderSchema> => ({
kind: 'local',
name: 'nfsmodder',
displayName: 'NFS Heat Modder',
description: 'Specialized persona for Need for Speed Heat modding. Expert in configuration files (.cfg, .ini) and game data structures.',
inputConfig: {
inputSchema: {
type: 'object',
properties: { request: { type: 'string', description: 'The modding task or configuration query.' } },
required: ['request'],
},
},
outputConfig: {
outputName: 'result',
description: 'The modding output.',
schema: NFSModderSchema,
},
modelConfig: { model: 'inherit' },
get toolConfig() {
return { tools: ['read_file', 'write_file', 'ls', 'grep'] };
},
get promptConfig() {
return {
systemPrompt: 'You are an expert NFS Heat Modder. You specialize in analyzing and modifying game configuration files like user.cfg and STORY files. Your goal is to help the user achieve specific gameplay outcomes (e.g. gameplay balance, graphics tweaks) by editing these files safely.',
query: 'Modding request: ${request}',
};
},
runConfig: { maxTurns: 10 },
});
43 changes: 43 additions & 0 deletions packages/core/src/agents/project-planner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import { z } from 'zod';
import type { Config } from '../config/config.js';
import type { LocalAgentDefinition } from './types.js';

const ProjectPlannerSchema = z.object({
plan: z.string().describe('The step-by-step strategy for the project.'),
});

export const ProjectPlannerAgent = (config: Config): LocalAgentDefinition<typeof ProjectPlannerSchema> => ({
kind: 'local',
name: 'planner',
displayName: 'Project Planner',
description: 'Specialized strategy-first agent. Use this to break down complex requests into actionable, sequential plans before execution.',
inputConfig: {
inputSchema: {
type: 'object',
properties: { task: { type: 'string', description: 'The complex project task to plan.' } },
required: ['task'],
},
},
outputConfig: {
outputName: 'plan',
description: 'The strategy and breakdown.',
schema: ProjectPlannerSchema,
},
modelConfig: { model: 'inherit' },
get toolConfig() {
return { tools: ['sequential-thinking', 'ls', 'grep'] };
},
get promptConfig() {
return {
systemPrompt: 'You are an expert Project Architect. Your goal is to analyze a task and provide a rigorous, step-by-step plan using the sequential-thinking tool. Focus on milestones, potential risks, and clear instructions for an implementation agent.',
query: 'Plan the following task: ${task}',
};
},
runConfig: { maxTurns: 15 },
});
Loading