This page provides a list of the Docs Agent command lines and their usages and examples.
The Docs Agent CLI helps developers to manage the Docs Agent project and interact with language models. It can handle various tasks such as processing documents, populating vector databases, launching the chatbot, running benchmark test, sending prompts to language models, and more.
Important: All agent
commands need to run in the poetry shell
environment.
The command below splits Markdown files (and other source files) into small chunks of plain text files:
agent chunk
The command below populates a vector database using plain text files (created
by running the agent chunk
command):
agent populate
The command below deletes stale entries in the existing vector database before populating it with the new text chunks:
agent populate --enable_delete_chunks
The command below prints all the fields and values in the current
config.yaml
file:
agent show-config
The command below deletes development databases specified in the
config.yaml
file:
agent cleanup-dev
The command below writes the summaries of all captured debugging information
(in the logs/debugs
directory) to a .csv
file:
agent write-logs-to-csv
The command below launches Docs Agent's Flask-based chatbot web application:
agent chatbot
The command below launches the Docs Agent web app to run on port 5005:
agent chatbot --port 5005
The command below launches the Docs Agent web app to use a widget-friendly template:
agent chatbot --app_mode widget
The command below launches the Docs Agent web app to use a special template that uses three Gemini models (AQA, Gemini 1.5, and Gemini 1.0):
agent chatbot --app_mode full
The command below launches the Docs Agent web app while enabling
a log view page (which is accessible at <APP_URL>/logs
):
agent chatbot --enable_show_logs
The command below runs benchmark test using the questions and answers listed
in the benchmarks.yaml
file:
agent benchmark
The command below reads a question from the arguments, asks the Gemini model, and prints its response:
agent tellme <QUESTION>
Replace QUESTION
with a question written in plain English, for example:
agent tellme does flutter support material design 3?
Note: This agent tellme
command is used to set up the gemini
command
in the Set up Docs Agent CLI guide.
The command below enables you to ask a question to a specific product in your Docs Agent setup:
agent tellme <QUESTION> --product <PRODUCT>
The example below asks the question to the Flutter
product in your
Docs Agent setup:
agent tellme which modules are available? --product=Flutter
You may also specify multiple products, for example:
agent tellme which modules are available? --product=Flutter --product=Angular --product=Android
The command below reads a request and a filename from the arguments, asks the Gemini model, and prints its response:
agent helpme <REQUEST> --file <PATH_TO_FILE>
Replace REQUEST
with a prompt and PATH_TO_FILE
with a file's
absolure or relative path, for example:
agent helpme write comments for this C++ file? --file ../my-project/test.cc
The command below uses a local or online vector database (specified in
the config.yaml
file) to retrieve relevant context for the request:
agent helpme <REQUEST> --file <PATH_TO_FILE> --rag
The command below starts a new session (--new
), which tracks responses,
before running the agent helpme
command:
agent helpme <REQUEST> --file <PATH_TO_FILE> --new
For example:
agent helpme write a draft of all features found in this README file? --file ./README.md --new
After starting a session, use the --cont
flag to include the previous
responses as context to the request:
agent helpme <REQUEST> --cont
For example:
agent helpme write a concept doc that delves into more details of these features? --cont
The command below prints the questions, files, and responses that are being used as context in the current session:
agent show-session
The command below applies the request to each file found in the specified directory:
agent helpme <REQUEST> --perfile <PATH_TO_DIRECTORY>
For example:
agent helpme explain what this file does? --perfile ~/my-project --new
The command below includes all files found in the specified directory as context to the request:
agent helpme <REQUEST> --allfiles <PATH_TO_DIRECTORY>
For example:
agent helpme write a concept doc covering all features in this project? --allfiles ~/my-project --new
The command below prints the output from the model in JSON format:
agent helpme <REQUEST> --response_type json
For example:
agent helpme how do I cook pasta? --response_type json
The command below runs a task (a sequence of prompts) defined in
a .yaml
file stored in the tasks
directory:
agent runtask --task <TASK>
For example:
agent runtask --task DraftReleaseNotes
To see the list of all tasks available in your project, run
agent runtask
without any arguments:
agent runtask
If a task script has a <INPUT>
placeholder, you can provide
a custom input string to the task:
agent runtask --task <TASK> --custom_input <INPUT_STRING>
For example:
agent runtask --task IndexPageGenerator --custom_input ~/my_example/docs/development/
By default, the agent runtask
command uses Python's Rich console
to format its output. You can disable it by using the --plaintext
flag:
agent runtask --task <TASK> --plaintext
For example:
agent runtask --task DraftReleaseNotes --plaintext
The command below prints the list of all existing online corpora created using the Semantic Retrieval API:
agent list-corpora
The command below enables [email protected]
to read text chunks stored in
corpora/example01
:
agent share-corpus --name corpora/example01 --user [email protected] --role READER
The command below enables [email protected]
to read and write to
corpora/example01
:
agent share-corpus --name corpora/example01 --user [email protected] --role WRITER
The command below enables EVERYONE
to read text chunks stored in
corpora/example01
:
agent open-corpus --name corpora/example01
The command below remove an existing user permission set in corpora/example01
:
agent remove-corpus-permission --name corpora/example01/permissions/123456789123456789
The command below deletes an online corpus:
agent delete-corpus --name corpora/example01