-
Notifications
You must be signed in to change notification settings - Fork 349
feat(genkit-tools/cli): MVP init:ai-tools
command for Genkit integration with AI tools
#3388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
||
1. **Initialize Project** | ||
|
||
```bash | ||
mkdir my-genkit-app && cd my-genkit-app | ||
npm init -y | ||
npm install -D typescript tsx @types/node | ||
``` | ||
|
||
2. **Install Dependencies** | ||
|
||
```bash | ||
npm install genkit @genkit-ai/googleai data-urls node-fetch | ||
``` | ||
|
||
3. **Install Genkit CLI** | ||
|
||
```bash | ||
npm install -g genkit-cli | ||
``` | ||
|
||
4. **Configure Genkit** | ||
|
||
All code should be in a single `src/index.ts` file. | ||
|
||
```ts | ||
// src/index.ts | ||
import { genkit, z } from 'genkit'; | ||
import { googleAI } from '@genkit-ai/googleai'; | ||
|
||
export const ai = genkit({ | ||
plugins: [googleAI()], | ||
}); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the package names, do we need to go into details on how to install and init a project with Genkit in this file?
## Running and Inspecting Flows | ||
|
||
1. **Add Build Script**: Add the following to `package.json`: | ||
|
||
```json | ||
{ | ||
"scripts": { | ||
"build": "tsc" | ||
} | ||
} | ||
``` | ||
|
||
2. **Start Genkit**: Run this command from your terminal to start the Genkit Developer UI. | ||
|
||
```bash | ||
genkit start | ||
``` | ||
|
||
Then, in a separate terminal, run the build command in watch mode: | ||
|
||
```bash | ||
npm run build -- --watch | ||
``` | ||
|
||
Visit [http://localhost:4000](http://localhost:4000) to inspect and run your flows. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question: This can be project specific and we should probably omit this info, and just specify the genkit start
command and the Dev UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can try removing it but i had various issues. everything in the file was added through trial and error. though i dont recall which things fixed what.
* limitations under the License. | ||
*/ | ||
|
||
export const GENKIT_DOCS = `# Genkit Node.js Cheatsheet (updated July 2025) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the same thing as GENKIT.md?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this const seems unused, delete?
.description( | ||
'initialize AI tools in a workspace with helpful context related to the Genkit framework' | ||
) | ||
.option('-y', '--yes', 'Run in non-interactive mode (experimental)') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this flag experimental? I think the whole command should be experimental to start.
Adds scaffolding and gemini, claude support.
TODOs:
Checklist (if applicable):