sf-explorer is a tool that helps you find the right sf commands without having to dig through the documentation. Under the hood, sf-explorer uses a vector store (ChromaDB) to store and index the Salesforce CLI documentation. This indexed data is then used to provide accurate and relevant command suggestions based on your queries.
The tool leverages OpenAI embeddings to understand the context and semantics of your queries. It uses the ConversationalRetrievalQAChain from Langchain to generate responses, ensuring that the answers you get are not only accurate but also contextually relevant to your query.
The tool showcases the power of document search and indexing using OpenAI embeddings to understand the context and semantics of your queries.
Demo : https://explorer.sfdxy.com/
Before getting started with sf-explorer, make sure you have the following prerequisites in place:
- Node.js installed
- Yarn package manager installed
- Chroma installed and running
To use sf-explorer, you need to set up your environment variables. Follow the steps below:
- Obtain an OpenAI API key.
- Open the
.env
file in your project directory. - Set the value of
OPENAI_API_KEY
to your OpenAI API key.
To set up sf-explorer for your project, follow the steps below:
- Install the necessary packages by running
yarn install
in your project directory. - Run
yarn refresh-chroma
to ensure Chroma is up to date. - Run
yarn dev
to start sf-explorer locally. - Open http://localhost:7456/ to access the app.
ingest.ts
is a script responsible for loading and processing Salesforce CLI documentation from a specified directory. It splits the documents into chunks and stores them in a Chroma vector store. This process helps in creating an indexed data store that can be used to provide accurate and relevant command suggestions based on user queries.
download.ts
is a script that downloads all the Salesforce CLI command documentation in JSON format. It fetches the metadata, processes the content, and stores it in a specified directory for further use. This script ensures that the most recent and relevant documentation is available for the ingest.ts
script to process and store in the Chroma vector store.
To publish your sf-explorer app, follow these steps:
- Run
yarn build
. - Publish the generated build files to your desired hosting platform.
sf-explorer was inspired by gitexplorer, a similar tool for finding the right Git commands.