npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gkh

v2.3.6

Published

genkit helper

Downloads

1,425

Readme

GKH: Genkit helper

Imagine you have genkit, and the library helps you complete your ideas with code snippets.

Main functions

Usage

npx gkh
#or
npm i -g gkh
# then starting use `gk` or `gkh` command on your top of genkit project

make:ai

Usage: gkh make:ai [options]

make a genkit ai instance

Options:
  -p,--path [path]  path for save ai instance (default: "src/ai/ai.ts")
  -h, --help        display help for command

add:getAllFlows

Usage: gkh add:getAllFlows [options]

add code snippet to read all your structured flows

Options:
  -t, --type [type]  for 'functions' | 'api' (default: "api")
  -h, --help         display help for command

make:flow

Usage: gkh make:flow [options] <name>

make a flow
genkit docs: https://firebase.google.com/docs/genkit/flows

Arguments:
  name                   name of flow, separated by / , ex: users/list

Options:
  -s, --stream [stream]  flow is streaming or not (default: false)
  -t, --type [type]      supported 'defineFlow', 'onFlow' (default: "defineFlow")
  -h, --help             display help for command

make:rag

Usage: gkh make:rag [options] <name>

make a rag (indexer & retriever)
genkit docs: https://firebase.google.com/docs/genkit/rag

Arguments:
  name                                rag name; ex: menuQA

Options:
  -t, --type [type]                   type of vectorstore; supported 'fs'('firestore'), 'simple','local',
                                      'custom'  (default: "simple")
  -l, --limit [limit]                 retriever's limit (default: 5)
  -c, --collection [collection]       firestore collection (default: "yourFirestoreCollection")
  -cf, --contentField [contentField]  contentField (default: "contentField")
  -vf, --vectorField [vectorField]    vectorField; default: $contentField + '_' + embedder.name (default: "")
  -h, --help                          display help for command

make:tool

Usage: gkh make:tool [options] <name>

make a tool
genkit docs: https://firebase.google.com/docs/genkit/tool-calling

Arguments:
  name                             tool name

Options:
  -d, --description [description]  tool description (default: "useful for...")
  -h, --help                       display help for command

make:prompt

Usage: gkh make:prompt [options] <name>

make a prompt
genkit docs: https://firebase.google.com/docs/genkit/dotprompt

Arguments:
  name                             prompt name

Options:
  -d, --description [description]  prompt description (default: "")
  -v, --variant [variant]          variant (default: "")
  -m, --model [model]              model (default: "")
  -h, --help                       display help for command

make:reranker

Usage: gkh make:reranker [options] <name>

make a reranker
genkit docs: https://firebase.google.com/docs/genkit/rag#rerankers_and_two-stage_retrieval

Arguments:
  name               reranker name

Options:
  -k, --topK [topK]  topK (default: 10)
  -r, --ref [ref]    reference of reranker (default: "vertexai/semantic-ranker-512")
  -h, --help         display help for command

docs:gen

Usage: gkh docs:gen [options]

generate openapi documents

Options:
  -n, --name <name>          name of yaml file (default: "api")
  -o, --out <out>            output docs directory (default: "./docs")
  -e, --env-file <env-file>  env file path (default: ".env")
  -h, --help                 display help for command

FAQ:

  • Q: I don't see any flows on Developer UI.

  • A: run gkh add:getAllFlows OR add this lines to your src/index.ts:

// configureGenkit({}) ...

// read all flows in `src/flows` folder
const libFlowsPath = path.join(__dirname, "flows");
fs.readdirSync(libFlowsPath).forEach((name) => {
  const flowDir = path.join(libFlowsPath, name);
  try {
    require(path.join(flowDir, "flows")); // require flows.ts
  } catch (e) {
    console.warn(
      "flow folder `" + name + "`shoud contains flows.ts or flows.js",
    );
  }
});

// startFlowsServer();

Author:

ClassFunc Softwares JSC (https://classfunc.com)

License:

MIT