This repository contains a command-line AI agent (agi) built with TypeScript and powered by the lmnr framework and the AI/OpenAI SDKs. The project provides a CLI entrypoint, evaluation scripts, and examples for using shell/file tools and multi-turn agents.
- Project name: agi
- CLI binary (after build):
dist/cli.js(exposed as theagibin in package.json) - Primary source:
src/(TypeScript) - Built output:
dist/ - Evaluations and tests:
evals/
Top-level files and folders you will commonly use:
- .claude/ - (project-specific metadata/config for Claude integrations, if any)
- .env - environment variables (API keys). DO NOT commit this file. Create your own
.envlocally. - .gitignore - files and patterns ignored by git (includes
.envanddist/) - AGENTS.md - documentation / configuration for agents shipped with the repo
- CLAUDE.md - notes or configuration related to Claude usage
- biome.json - developer/tooling config (biome formatter/runner)
- course.yaml - optional course/config data used by the project
- dist/ - compiled JavaScript output (generated by
npm run build) - evals/ - evaluation scripts (multi-turn, file-tools, shell-tools, etc.)
- node_modules/ - installed npm dependencies
- notes/ - project notes and scratch files
- openspec/ - open API specs or similar artifacts
- package.json - npm package metadata and scripts (see "Scripts" below)
- package-lock.json - npm lock file
- src/ - TypeScript source code (entrypoint is
src/index.ts) - tsconfig.build.json - TypeScript build configuration used for
npm run build - tsconfig.json - TypeScript config
If you need a specific file's purpose, check that file; the repo already includes AGENTS.md and
CLAUDE.md which explain agent-specific config and usage in greater detail.
This repository implements a CLI AI agent scaffold which typically supports the following capabilities
(actual capabilities depend on the code in src/ and available tool registrations):
-
Run as a CLI application (development mode or built JS in
dist/). -
Use language models via
@ai-sdk/openai,ai, and the@lmnr-ai/lmnrframework. -
Execute shell commands and interact with the filesystem via tools (dependencies include
shelljs). -
Run automated evaluations contained in
evals/(examples for multi-turn conversations, file-tools, and shell-tools exist). -
Be extended with additional tools, agents, and evaluation scripts by modifying
src/andevals/.
Note: The exact feature set and tools are implemented in src/. Inspect that folder to see how tools
are registered and how agents are configured.
- Node.js (recommended: 18+)
- npm
- API keys for the model providers you intend to use (OpenAI, LMNR project keys, etc.)
Important: put your secrets in a local .env file (the code uses dotenv). Do not commit .env to
the repository. If you accidentally commit secret keys, rotate them immediately.
-
Install dependencies: npm install
-
Create a
.envin the project root with at least the API keys you need. Example (DO NOT copy/paste real keys you find in repos or screenshots): OPENAI_API_KEY=sk-... LMNR_PROJECT_API_KEY=... -
(Optional) Build the project to JavaScript: npm run build
-
Development (TypeScript with watch): npm run dev This runs
tsx watch --env-file=.env src/index.tsso you can iterate quickly. -
Start (one-off run without building): npm start
-
Production / built CLI: npm run build npm install -g agi # this runs the production build of the agent
There are several npm scripts that run evaluation suites (these use npx lmnr eval):
- npm run eval # run default evaluation
- npm run eval:multi-turn # run multi-turn eval example
- npm run eval:file-tools # run file-tools eval script
- npm run eval:shell-tools # run shell-tools eval script
- npm run eval:agent # run agent multi-turn eval
Check evals/ for the TypeScript evaluation files; you can add new eval scripts and wire them into
package.json as needed.
- Add new tools: implement the tool in
src/(suggestedsrc/tools/), register it with the agent initialization code. - Add or adjust agents: update
AGENTS.mdandsrc/to define agent behaviors, prompts, and tool access policies. - Add tests/evaluations: put new eval files in
evals/and add an npm script to run them. - Build and test locally: use
npm run devduring development,npm run buildfor production.
- Keep
.envand other secret-bearing files out of git (this repo's.gitignorealready excludes.env). - Rotate API keys if you believe they were exposed.
- Use least-privilege API keys for development when possible.
- "Missing API key" errors: verify your
.envcontains the expected variables and that you restarted the dev server after editing.env. - Build/type errors: ensure you are using a recent Node.js version and that dependencies are installed
(
npm install).
Contributions are welcome. Typical workflow:
- Fork the repo
- Create a feature branch
- Add/modify code and tests/evals
- Run
npm run devornpm run buildto verify changes - Open a PR describing your changes