AgentDock is a modular AI agent runtime built with Bun and TypeScript for running AI-powered workflows through multiple interaction modes.
It provides a unified environment for interacting with AI agents through the terminal and Telegram, with support for planning, tool execution, approvals, web research, and multi-step agent workflows.
Run autonomous agent workflows capable of breaking down tasks, selecting tools, executing actions, and presenting results.
- Agent orchestration
- Tool execution
- Action tracking
- Approval workflow
- Diff-based changes
- Multi-step execution
Interact with AgentDock in a direct question-and-answer workflow for tasks that don't require a full autonomous agent execution loop.
Create structured plans before executing complex tasks.
- Task planning
- Plan selection
- Plan orchestration
- Web research tools
- Structured execution workflow
Interact with AgentDock remotely through a Telegram bot.
- Telegram authentication
- Agent execution
- Approval sessions
- Plan sessions
- Message handlers
- User authorization
AgentDock integrates with Firecrawl to provide web-based research capabilities for agent workflows.
AgentDock uses the AI SDK with the OpenRouter provider, allowing the configured model to be selected through environment variables.
At a high level, AgentDock is organized into four major layers:
┌─────────────────────┐
│ User │
└──────────┬──────────┘
│
┌────────────────┼────────────────┐
│ │ │
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌────────────┐
│ CLI │ │ Agent │ │ Telegram │
│ TUI │ │ Mode │ │ Mode │
└─────┬─────┘ └─────┬─────┘ └──────┬─────┘
│ │ │
└────────────────┼────────────────┘
▼
┌──────────────────┐
│ Orchestrator │
└────────┬─────────┘
│
┌─────────────┼─────────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ LLM │ │ Tools │ │ Approval │
└──────────┘ └──────────┘ └──────────┘
│ │
▼ ▼
┌──────────┐ ┌────────────┐
│ OpenRouter│ │ Firecrawl │
└──────────┘ └────────────┘
AgentDock/
│
├── ai/
│ ├── ai.config.ts # AI/provider configuration
│ └── index.ts # AI layer exports
│
├── modes/
│ ├── agent/
│ │ ├── action-tacker.ts
│ │ ├── agent-tools.ts
│ │ ├── approval.ts
│ │ ├── diff-view.ts
│ │ ├── orchestrator.ts
│ │ ├── tool-executor.ts
│ │ └── types.ts
│ │
│ ├── ask/
│ │ └── orchestrator.ts
│ │
│ ├── plan/
│ │ ├── orchestrator.ts
│ │ ├── planner.ts
│ │ ├── selection.ts
│ │ ├── types.ts
│ │ └── web-tools.ts
│ │
│ ├── telegram/
│ │ ├── agent-run.ts
│ │ ├── approval-session.ts
│ │ ├── auth.ts
│ │ ├── constants.ts
│ │ ├── handlers.ts
│ │ ├── index.ts
│ │ ├── plan-session.ts
│ │ └── text.ts
│ │
│ └── cli.ts
│
├── tui/
│ ├── terminal-md.ts
│ └── wakeup.ts
│
├── index.ts # Application entry point
├── package.json
├── bun.lock
├── tsconfig.json
├── .env.example
└── README.md
| Technology | Purpose |
|---|---|
| Bun | JavaScript/TypeScript runtime and package management |
| TypeScript | Application development |
| Vercel AI SDK | AI model interaction |
| OpenRouter | LLM provider |
| Firecrawl | Web research and crawling |
| Telegraf | Telegram bot integration |
| Commander | CLI command handling |
| Clack | Interactive terminal prompts |
| Marked | Markdown processing |
| Marked Terminal | Terminal Markdown rendering |
| Chalk | Terminal styling |
| Diff | Diff generation and handling |
| Figlet | Terminal branding |
Before running AgentDock, install:
- Bun
- An OpenRouter API key
- A Firecrawl API key if using web research functionality
- A Telegram Bot Token if using Telegram mode
Clone the repository:
git clone https://github.com/its-arunchauhan/AgentDock.git
cd AgentDockInstall dependencies:
bun installCreate your environment file:
cp .env.example .envOn Windows PowerShell:
Copy-Item .env.example .envConfigure the required variables:
OPENROUTER_API_KEY=your_openrouter_api_key
OPENROUTER_DEFAULT_MODEL=openrouter/free
FIRECRAWL_API_KEY=your_firecrawl_api_key
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_USER_ID=your_telegram_user_id| Variable | Description |
|---|---|
OPENROUTER_API_KEY |
API key used to access OpenRouter |
OPENROUTER_DEFAULT_MODEL |
Default model used by AgentDock |
FIRECRAWL_API_KEY |
API key for Firecrawl web research |
TELEGRAM_BOT_TOKEN |
Token for the Telegram bot |
TELEGRAM_USER_ID |
Authorized Telegram user ID |
Never commit
.envor API keys to Git.
Start AgentDock using Bun:
bun run index.tsAlternatively, because AgentDock exposes a CLI binary through package.json, you can use the project through its CLI interface after installation/configuration.
AgentDock currently contains four major modes:
AgentDock
│
├── Agent
│ └── Autonomous task execution
│
├── Ask
│ └── Direct AI interaction
│
├── Plan
│ └── Structured task planning
│
└── Telegram
└── Remote agent interaction
Agent mode is designed for tasks requiring multiple steps and tool interaction.
User Request
│
▼
Agent Orchestrator
│
├── Understand task
├── Select tools
├── Execute actions
├── Request approval when required
├── Track actions
└── Present result
Plan mode separates planning from execution:
Task
│
▼
Planner
│
▼
Plan Selection
│
▼
Plan Orchestrator
│
▼
Tools / Web Research
│
▼
Result
Telegram provides a remote interface for interacting with AgentDock:
Telegram User
│
▼
Telegram Bot
│
▼
Authentication
│
▼
Telegram Handlers
│
├── Agent Session
├── Plan Session
└── Approval Session
│
▼
AgentDock Runtime
AgentDock integrates Firecrawl for web-based research.
The Firecrawl integration is currently located within the Plan mode:
modes/
└── plan/
└── web-tools.ts
This allows planning workflows to incorporate web research capabilities.
AgentDock includes an approval mechanism for agent actions.
The approval system is particularly important for workflows where an agent may need permission before executing an action.
Relevant components include:
modes/agent/approval.ts
modes/telegram/approval-session.ts
This allows the runtime to separate:
Agent Decision
│
▼
Approval Required?
┌──┴──┐
│ │
Yes No
│ │
▼ ▼
User Execute
Approval
│
▼
Execute
AgentDock includes a terminal-oriented UI layer:
tui/
├── terminal-md.ts
└── wakeup.ts
The project also uses libraries such as Clack, Chalk, Marked, and Marked Terminal to provide an interactive terminal experience.
Install dependencies:
bun installRun the application:
bun run index.tsFor development, modify the relevant mode under:
modes/
AI/provider configuration can be found under:
ai/
Terminal UI functionality can be found under:
tui/
AgentDock is actively evolving.
- TypeScript/Bun foundation
- CLI/TUI interface
- Agent mode
- Ask mode
- Plan mode
- Telegram mode
- OpenRouter integration
- Firecrawl integration
- Agent tool execution
- Approval workflows
- Action tracking
- Telegram authentication
- Telegram agent/plan sessions
- Expand agent tool ecosystem
- Improve agent memory
- Add more communication channels
- Improve observability and execution tracing
- Expand approval policies
- Add persistent agent state
- Improve configuration and provider management
- Add more built-in agent workflows
- Improve documentation and developer experience
Contributions are welcome.
git clone https://github.com/its-arunchauhan/AgentDock.git
cd AgentDockgit checkout -b feature/your-featurebun installKeep functionality organized according to the existing architecture.
For example:
New agent functionality
↓
modes/agent/
New planning functionality
↓
modes/plan/
New Telegram functionality
↓
modes/telegram/
AI/provider changes
↓
ai/
Terminal UI changes
↓
tui/
git add .
git commit -m "feat: add your feature"git push origin feature/your-featureThen open a Pull Request.
Never commit credentials or secrets.
Make sure the following remains ignored:
.env
node_modules/
If you accidentally expose an API key, revoke it immediately and generate a new one.
License information will be added as the project license is finalized.
Arun Chauhan
GitHub: its-arunchauhan
If you find AgentDock useful, consider starring the repository and contributing improvements.
AgentDock — a modular home for AI agents.