#generative-ai #openai #genai #ai-coding

app devai

Command Agent runner to accelerate production coding with genai

15 releases

Uses new Rust 2024

0.5.12 Feb 23, 2025
0.5.11 Feb 23, 2025
0.5.9 Jan 28, 2025
0.5.3 Dec 12, 2024
0.0.10 Sep 24, 2024

#718 in Command line utilities

Download history 2/week @ 2024-11-20 307/week @ 2024-12-04 369/week @ 2024-12-11 21/week @ 2024-12-18 109/week @ 2025-01-01 59/week @ 2025-01-08 187/week @ 2025-01-15 368/week @ 2025-01-22 55/week @ 2025-01-29 42/week @ 2025-02-05 7/week @ 2025-02-12 406/week @ 2025-02-19 77/week @ 2025-02-26 4/week @ 2025-03-05

494 downloads per month

MIT/Apache

395KB
9K SLoC

IMPORTANT NOTICE - MIGRATING TO AIPACK

  • This project is rebranding to aipack, a more suitable name for its future development.

  • This repo is now https://github.com/aipack-ai/aipack.

  • same codebase, same feature set, same licenses (MIT or Apache)

  • But it will be aipack centric, which is going to bring huge value for the users and community.

  • Key Differences:

    • Agent file extension .aip (was .devai)
      • Exact same format, just the extension has changed.
    • ~/.aipack-base/ and .aipack/ will be created accordingly (now always create ~/.aipack-base/)
    • Agents are organized in packs and addressed as namespace@pack_name; each pack can have a main.aip (formerly .devai).
    • Custom/User packs will be taken from pack/custom/namespace/packname
  • The devai crate will remain on v0.5.12 (or v0.5.x as needed), and the devai conventions.

  • v0.6.x and up will be the new aipack logic and be in the main branch. We will probably have some v0.6.0-alpha.x releases.

Please do not send any PRs during this week of transition (2025-02-23), as there will be a lot of changes.

The new aipack v0.6.x will have a superset of the old devai v0.5.x functionalities, so we will only accept PRs on v0.6.x or later.

A little pain for so much gain...

You can find more information in the following discussion #51

Below is the legacy README.

devai - Command Agent Runner

Static Badge Static Badge

  • Website: https://devai.run

  • Full intro video for v0.5

  • Built on top of the Rust genai library, which supports all the top AI providers and models (OpenAI, Anthropic, Gemini, DeepSeek, Groq, Ollama, xAI, and Cohere).

  • Top new features:

    • 2025-02-22 (v0.5.11) - Huge update with parametric agents, and coder (more info soon)
    • 2025-01-27 (v0.5.9) - Deepseek distill models support for Groq and Ollama (local)
    • 2025-01-23 (v0.5.7) - devai run craft/text or devai run craft/code (example of cool new agent module support)
    • 2025-01-06 (v0.5.4) - DeepSeek deepseek-chat support
    • 2024-12-08 (v0.5.1) - Added support for xAI
  • WINDOWS DISCLAIMER:

    • This CLI uses a path scheme from Mac/Unix-like systems, which might not function correctly in the Windows bat command line.
    • Full Windows local path support is in development.
    • RECOMMENDATION: Use PowerShell or WSL on Linux. Please log issues if small changes can accommodate Windows PowerShell/WSL.
  • Thanks to

Install

For now, the simplest way to install is with cargo install.

Usage

# Init (optional; will be executed on each run as well)
devai init

# Will proofread and update the direct .md file from the current directory
devai run proof-read -f "./*.md"
# Can use multiple globs or direct files -f "./*.md" -f "./doc/**/*.md"

# For a one-shot run (or --ni)
devai run --non-interactive proof-read -f "./doc/README.md"

The main concept of devai is to minimize friction in creating and running agents while providing maximum control over how we want those agents to run and maximizing iteration speed to mature them quickly.

IMPORTANT 1: Make sure everything is committed before usage (at least while you are learning about devai).

IMPORTANT 2: Make sure to have your OPENAI_API_KEY, ANTHROPIC_API_KEY, DEEPSEEK_API_KEY, or XAI_API_KEY, or the key of your model provider more info on API keys

NOTE: Since v0.5.4, the agent folders now have the command- prefix under .devai/ (DevAI will update the folder names when needed).

How it works

  • One Agent == One Markdown
    • A .devai Agent file is just a Markdown File with sections for each stage of the agent processing.
    • See below for all the possible stages.
  • devai run proof-read -f "./*.md" will run the installed Command Agent file .devai/default/proof-read.devai on all source files matching ./src/*.md (Here is the source file for the default proof-read.devai)
    • Each matching file will become an input of type FileMeta for the Lua and Handlebars parts of the agent file.
  • devai agents are simple .devai files that can be placed anywhere on disk.
    • e.g., devai run ./my-path/to/my-agent.devai ...
  • Multi AI Provider / Models - devai uses genai and therefore supports OpenAI, Anthropic, Gemini, Groq, Ollama, Cohere, and more to come.
  • Lua is used for all scripting (thanks to the great mlua crate).
  • Handlebars is used for all prompt templating (thanks to the great Rust native handlebars crate).

Multi Stage

A single devai file may comprise any of the following stages.

Stage Language Description
# Before All Lua Reshape/generate inputs and add command global data to scope (the "map" of the map/reduce capability).
# Data Lua Gather additional data per input and return it for the next stages.
# System Handlebars Customize the prompt with the data and before_all data.
# Instruction Handlebars Customize the prompt with the data and before_all data.
# Assistant Handlebars Optional for special customizations, such as the "Jedi Mind Trick."
# Output Lua Processes the ai_response from the LLM. Otherwise, ai_response.content will be output to the terminal.
# After All Lua Called with inputs and outputs for post-processing after all inputs are completed.
  • # Before All / # After All can be considered as the map/reduce of the agent, and these will be run before and after the input processing.

more info on stages

devai doc

See the devai documentation at _init/doc/README.md (With Lua modules doc)

You can also run the ask-devai agent.

# IMPORTANT - Make sure you have the `OPENAI_API_KEY` or the key of your model in your environment
devai run ask-devai

# and then open the `.devai/tmp/ask-devai.md`

Future Plans

  • More Lua functions
  • Agent module my-module may run my-module/main.devai, and running my-module/some-other will run my-module/some-other.devai
  • Support Lua Require
  • Full TUI/Ratatui
  • Split runtime to agentic

Dependencies

~28–44MB
~715K SLoC