@tiendung-betapcode/openrouter-cli
v1.1.24
Published
A CLI for OpenRouter with Agentic capabilities - AI coding assistant
Maintainers
Readme
OpenRouter CLI
English
A powerful AI coding assistant CLI powered by OpenRouter. Features agentic capabilities with file system access, command execution, and smart context management.
Installation
npm install -g @tiendung-betapcode/openrouter-cliSetup & Usage
Option 1: Quick Start (Recommended)
- Run the login command:
openrouter login - Follow the instructions:
- Go to the Dashboard URL shown.
- Get your Access Code (8 characters).
- Paste the code into the terminal.
- Start chatting!
openrouter
Option 2: Manual API Key (Fallback)
If you cannot use the login server, create a .env file in your working directory:
OPENROUTER_API_KEY=sk-or-v1-your-api-key-hereCommands
| Command | Description |
|---------|-------------|
| /model | Switch AI model (Presets or Fetch from OpenRouter) |
| /history | Save chat history to Documents/openrouter |
| /clear | Clear chat history |
| /exit | Exit CLI |
| /help | Show help |
Tiếng Việt
Trợ lý lập trình AI mạnh mẽ sử dụng OpenRouter. Tích hợp khả năng Agent (tác nhân) với quyền truy cập hệ thống tệp, thực thi lệnh và quản lý ngữ cảnh thông minh.
Cài đặt
npm install -g @tiendung-betapcode/openrouter-cliThiết lập & Sử dụng
Cách 1: Khởi động nhanh (Khuyên dùng)
- Chạy lệnh đăng nhập:
openrouter login - Làm theo hướng dẫn:
- Truy cập URL Dashboard hiển thị trên màn hình.
- Lấy Mã Truy Cập (Access Code) (8 ký tự).
- Dán mã vào terminal.
- Bắt đầu chat!
openrouter
Cách 2: Nhập API Key thủ công (Dự phòng)
Nếu không dùng được server đăng nhập, hãy tạo file .env tại thư mục làm việc:
OPENROUTER_API_KEY=sk-or-v1-your-api-key-hereCác lệnh hỗ trợ
| Lệnh | Mô tả |
|---------|-------------|
| /model | Đổi model AI (Chọn có sẵn hoặc tải từ OpenRouter) |
| /history | Lưu lịch sử chat vào Documents/openrouter |
| /clear | Xóa bộ nhớ đệm đoạn chat |
| /exit | Thoát CLI |
| /help | Xem trợ giúp |
Architecture / Kiến trúc
┌─────────────────┐ ┌──────────────────┐ ┌───────────────┐
│ OpenRouter CLI │────>│ API Server │────>│ Firebase │
│ (Public/npm) │ │ (Private/Vercel)│ │ (Keys/History)│
└─────────────────┘ └──────────────────┘ └───────────────┘License
MIT © TIENDUNG
