Quick start
Install egin, write an agent from a template and run your first prompt.
Install
Create an agent without installing anything first:
npx egin@latest init my-agent
pnpm dlx and bunx work the same way. To keep egin on your PATH instead, install the binary with Cargo:
cargo install egin
To build from source, run cargo build --release in the repository. The binary lands at target/release/egin.
Set one key
Set the API key of the model provider you use, in your shell or in a .env.local file in the directory you run egin from:
export ANTHROPIC_API_KEY=...
That is all the setup there is. egin picks a model for the key it finds:
| Key | Model |
|---|---|
YDC_API_KEY |
kimi-k3.1-pro on the You.com router, with You.com web search |
ANTHROPIC_API_KEY |
anthropic/claude-sonnet-5-5, searching with Claude’s own web search |
OPENAI_API_KEY |
openai/gpt-6-luna |
AI_GATEWAY_API_KEY |
anthropic/claude-sonnet-5.5 through the Vercel AI Gateway |
AWS_BEDROCK_API_KEY |
us.anthropic.claude-sonnet-5-5 on Amazon Bedrock |
Keys can also go in .env.local or .env in the folder you run egin from. A Gemini key alone picks no model: name a gemini/… model in agent.toml.
To use another model, name it in agent.toml. The prefix picks the provider and the key: anthropic/…, openai/…, gemini/…, bedrock/…, and any other vendor/model goes through the AI Gateway. See Providers.
model = "openai/gpt-6.1-sol"
Web search needs no key of its own: egin uses your You.com, Parallel, Firecrawl, context.dev or Brave key, or SEARXNG_URL, if one is set. Otherwise Claude and AI Gateway models use the provider’s own search, and other models go without web tools. egin info my-agent shows what the agent will use and which key, if any, is missing.
Pick a template
egin init writes a starter folder from one of five templates, with agent.toml already naming the model for your key. Without --template, you get basic. --template also takes a path to any folder, to start from your own.
egin init my-agent --template research
| Template | What it is |
|---|---|
basic |
A minimal agent with one example tool, two evals and two variants |
research |
Answers with sourced facts, writes reports to the workspace, remembers which sources were reliable |
ops |
Follows runbooks, checks hosts on a schedule, blocks destructive commands with middleware |
support |
Answers from a knowledge base over Slack, escalates what it cannot answer |
web |
A Next.js chat app built on shadcn/ui, with the agent in agent/. npm run dev starts both. See Frontends |
Run it
egin run my-agent "Who maintains SQLite, and under what license?"
The answer streams to the terminal. The session is stored in my-agent/.egin/egin.db, so you can continue it later:
egin run my-agent --session <id> "And when was it first released?"
By default egin asks before running a tool that is not marked safe. Pass --yes to approve everything for one run, or set approval = "never" in agent.toml.
Check it
Every template ships with evals. Run them:
egin eval my-agent
Each eval is a prompt plus a check. The run prints a pass or fail per task and writes results to my-agent/evals/results/. See Evals for the format.
Serve it
egin serve my-agent --port 8787
Now any program can start sessions over HTTP and follow them over SSE. See the HTTP API.