lea_code 0.0.1
lea_code: ^0.0.1 copied to clipboard
A command-line coding assistant powered by Genkit and Google Gemini.
lea_code #
lea_code is a Dart command-line coding assistant powered by Genkit and Google Gemini. It runs as an interactive terminal chat and gives the model a small set of local file and shell tools so it can inspect and modify code in your working directory.
Features #
- Interactive CLI chat loop
- Google Gemini model selection via a command-line flag
- Optional custom system prompt
- Conversation reset with
/new - Built-in tools for:
- running shell commands
- reading files
- writing files
- searching file contents
- finding files by name
Requirements #
- Dart SDK
^3.11.4 - A Google AI API key exposed as either
GOOGLE_GENAI_API_KEYorGEMINI_API_KEY
Install #
dart pub global activate lea_code
Run #
lea_code
You can also choose a model and provide a system prompt:
lea_code \
--model gemini-flash-lite-latest \
--system_prompt "You are a careful coding assistant."
CLI Options #
-m,--model: Gemini model name to use. Defaults togemini-flash-lite-latest.-s,--system_prompt: Optional system prompt passed as output instructions.
Interactive Commands #
/new: clear the current conversation history/exit: quit the program/quit: quit the program
Built-in Tools #
The assistant registers five tools in LeaCodeEngine:
bash: executes a shell command withbash -cfile_read: reads a file from diskfile_write: writes content to a filestring_search: searches the current directory withgrep -rfile_find: finds files and directories withfind
These tools operate on the local machine, so use this project only in directories and environments you trust.
Project Structure #
bin/lea_code.dart: CLI entrypoint and REPL looplib/lea_code_engine.dart: Genkit setup and tool registrationlib/tools/: tool definitions exposed to the modellib/models/: typed tool input models and generated schema files
Notes #
- The application exits early if neither
GOOGLE_GENAI_API_KEYnorGEMINI_API_KEYis set. - Tool output is returned directly to the model, including shell stderr when present.
string_searchandfile_findrun relative to the current working directory.