jeremychone / rust-devai

Command Agent runner to accelerate production coding. File based, fully customizable, NOT for building snake games.
Apache License 2.0
10 stars 3 forks source link
Static Badge Static Badge

devai - Command Agent File Runner


# install
cargo install devai

# Will fix all code comment in all matching file
devai run proof-comments -f "./src/m*.rs" 

# How: It will run the installed Command Agent file ".devai/defaults/proof-comments.md" on all source files matching "./src/m*.rs"

# IMPORTANT: Make sure everything is committed before usage.

ONE Command Agent Markdown File that defines the full agent flow:

Data, Instruction, Output (and more later) are all defined in a single file (see below), which is called the Command Agent File

Supports all models/providers supported by the genai crate (see below for more information).

You can customize the model and concurrency in .devai/config.toml.

IMPORTANT: Make sure to run this command line when everything is committed, so that overwritten files can be reverted easily.

STILL IN HEAVY DEVELOPMENT... But it's starting to get pretty cool.

P.S. If possible, try to refrain from publishing devai-custom type crates, as this might be more confusing than helpful. However, any other name is great.

API Keys

devai uses the genai crate, and therefore the simplest way to provide the API keys for each provider is via environment variables in the terminal when running devai.

Here are the environment variable names used:

OPENAI_API_KEY
ANTHROPIC_API_KEY
MODEL_GEMINI
GEMINI_API_KEY
GROQ_API_KEY
COHERE_API_KEY

Usage & Concept

Usage: devai run proof-comments -f "./src/main.rs"

(or have any glob like -f "./src/**/*.rs" )

Example of a Command Agent File

.devai/defaults/proof-comments.md (see .devai/defaults/proof-comments.md`)

Config

On devai run or devai init a .devai/config.toml will be created with the following:

[genai]
# Required (any model rust genai crate support).
model = "gpt-4o-mini" 

[runtime]
# Default to 1 if absent. Great way to increase speed when remote AI services.
items_concurrency = 1 

Future Plan