Registry / llm-agents / genkit-cli

genkit-cli

JSON →
library1.32.0jsnpmunverified

Genkit is an open-source framework by Google for building and deploying AI-powered applications, available with JavaScript/TypeScript, Go, and Python SDKs. The `genkit-cli` package provides the command-line interface for interacting with the Genkit framework, facilitating development tasks such as project initialization, running local development servers, deploying flows, and inspecting traces. The current stable version of the JavaScript/TypeScript CLI is 1.32.0, with minor updates and release candidates released frequently, indicating active development. Key differentiators include its multi-language SDK support, integration with Google's AI services (like Vertex AI and Google GenAI), and a local development UI for visualizing AI application flows and traces.

llm-agentsgcpai-mldevops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

This quickstart demonstrates how to install the Genkit CLI, initialize a new Genkit project, configure it with the Google AI plugin, define a simple AI flow, and then run it using the local development UI. It includes setting up environment variables for API keys and assumes a basic TypeScript project setup.

# 1. Install the Genkit CLI globally npm install -g genkit-cli # 2. Initialize a new Genkit project (select 'TypeScript' and a plugin like 'Google AI') # This creates a genkit.ts config file and boilerplate. genkit init # 3. Configure your Genkit project and define a simple flow (e.g., in src/index.ts) # Make sure to set environment variables like GOOGLE_API_KEY or GEMINI_API_KEY. # For example, in a .env file or by exporting: # export GOOGLE_API_KEY="YOUR_API_KEY" // src/index.ts (example configuration and flow) import { configureGenkit, defineFlow, generate, z } from '@genkit-ai/core'; import { googleGenai } from '@genkit-ai/google-genai'; export default configureGenkit({ plugins: [ googleGenai({ apiKey: process.env.GOOGLE_API_KEY ?? '' }), ], flowRegistry: [ defineFlow( { name: 'helloWorldFlow', inputSchema: z.string().describe('Name to greet'), outputSchema: z.string().describe('Greeting message'), }, async (name) => { const response = await generate({ model: 'gemini-pro', prompt: `Hello, ${name}! Generate a short, friendly greeting.`, config: { temperature: 0.7 } }); return response.text(); } ), ], logLevel: 'debug', enableTracing: true, }); // 4. Start the local Genkit development UI # This command starts your app in dev mode and launches a local web UI (typically http://localhost:3400 or 4000). # You can then interact with 'helloWorldFlow' via the UI. genkit start -- npx tsx --watch src/index.ts # 5. Run a flow directly from the CLI (optional) # genkit flow:run helloWorldFlow '{"name": "Genkit User"}'
genkit --version
Debug
Known footguns
deprecatedSome Imagen and Veo models were deprecated in `genkit-cli` v1.32.0 and later versions of `@genkit-ai/google-genai` plugin. Users relying on these specific models should migrate to supported alternatives.
breakingThe Genkit framework, particularly for Node.js/TypeScript, requires Node.js v20 or higher. Older Node.js versions (e.js., v16, v18) will result in errors and prevent `genkit-cli` from functioning correctly.
breakingThe `genkit-cli` install script `cli.genkit.dev` may serve an incorrect binary (e.g., arm64 instead of x64) on certain macOS architectures, leading to installation failures.
gotchaThe introduction of a new `generate` middleware and `@genkit-ai/middleware` package in `v1.33.0-rc.0` (and subsequent stable releases) may necessitate refactoring for existing users who implemented custom middleware patterns. While not strictly a breaking change in the CLI itself, it signals evolving API patterns within the Genkit ecosystem.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
15 hits · last 30 days
gptbot
3
ahrefsbot
3
dotbot
2
script
1
googlebot
1
Resources