@noobdemon/noob-cli
v1.12.0
Published
Trợ lý lập trình agentic trong terminal (kiểu Claude Code), tiếng Việt, dùng sức mạnh Noob Demon — 34 mô hình AI.
Downloads
2,681
Maintainers
Readme
noob — agentic coding CLI
A Claude-Code-style coding agent that lives in your terminal, powered by Noob Demon (34 models across 8 providers — GPT, Claude, Gemini, DeepSeek, Grok, Qwen, Kimi, Llama).
It reads and edits files, runs shell commands, and iterates on a task — asking permission before anything destructive — all inside a polished terminal UI.
███╗ ██╗ ██████╗ ██████╗ ██████╗
████╗ ██║██╔═══██╗██╔═══██╗██╔══██╗
██╔██╗ ██║██║ ██║██║ ██║██████╔╝
██║╚██╗██║██║ ██║██║ ██║██╔══██╗
██║ ╚████║╚██████╔╝╚██████╔╝██████╔╝
╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝Install
cd "noob cli"
npm install
npm link # optional: makes `noob` available globallyRequires Node.js ≥ 18 (tested on 22).
Xác thực & gói cước (Authentication)
noob đi qua một gateway (Cloudflare Worker claude-code-proxy) để ẩn backend
thật và quản lý API key qua Supabase. Bạn cần một API key để dùng:
noob login nk_xxx_xxxxxxxx # đăng nhập, key lưu ở ~/.noob/config.json
noob usage # xem hạn mức còn lại
noob logout # đăng xuấtTrong phiên: /login <key>, /usage, /logout.
Các gói:
| Gói | Hạn mức |
| --------- | ----------------------------------------- |
| pro | 5 000 request / 5 giờ (cửa sổ trượt) |
| proplus | 10 000 request / 5 giờ |
| admin | không giới hạn |
| trial | 200 request dùng thử, hết là key dead |
Mỗi lệnh gọi mô hình (kể cả từng bước tool trong một tác vụ) tính là 1 request.
Cấp/huỷ key (admin) — trong repo gateway D:\Dev\free claude code:
node scripts/admin.mjs create pro "khách A"
node scripts/admin.mjs list
node scripts/admin.mjs revoke nk_pro_xxxUse
noob # interactive session
noob "add input validation to api.js" # start with a request
noob -m gateway-claude-opus-4-7 # pick a model
noob --yolo # auto-approve edits & commandsWithout npm link, run node bin/noob.js ….
In-session commands
| Command | What it does |
| --------------- | ------------------------------------------------------------------ |
| /model [name] | switch model (fuzzy match), or list all |
| /models | list every model grouped by provider |
| /merge | toggle Merge AI — synthesizes GPT-5.5 + Claude + Gemini via o3 |
| /search | toggle web search mode |
| /chat | back to normal chat mode |
| /yolo | toggle auto-approve for file/command tools (or Shift+Tab) |
| /clear /new | wipe conversation context |
| /status | show current model + working directory |
| /exit | quit (Ctrl+C once = stop turn, twice = quit) |
How it works
The Noob Demon gateway is a stateless single-message endpoint with no native function-calling. noob layers an agent on top:
- The full transcript (system prompt + history + tool results) is serialized into
one
messageand streamed to the gateway's/api/chat. - The model replies with either a final answer or a single ```tool JSON block.
- noob parses the tool call, asks permission if it's destructive, executes it, and feeds the result back — looping until the model answers without a tool block.
Architecture (high-level)
flowchart LR
User[User<br/>terminal] -->|prompt| REPL[repl.js<br/>input loop + slash commands]
REPL -->|message + history| Agent[agent.js<br/>tool-loop driver]
Agent -->|/api/chat| API[api.js<br/>gateway client]
API -->|HTTPS stream| GW[(Noob Demon<br/>Gateway)]
GW -->|delta tokens| API
API -->|onDelta callbacks| Agent
Agent -->|parse tool block| Tools[tools.js<br/>read/write/edit/run]
Tools -->|fs / spawn| FS[(workspace)]
Tools -->|result text| Agent
Agent -->|final answer| REPL
REPL -->|persist| Sessions[(~/.noob/sessions/)]
REPL -->|memory| Memory[(noob.md per project)]
Agent -.optional.-> Subagent[subagent.js<br/>spawn_agent]
Subagent -->|isolated context| APITools the agent can call
read_file · write_file · edit_file · list_dir · glob · grep · run_command
Destructive tools (write_file, edit_file, run_command) prompt for approval
(y / n / always) unless /yolo is on.
Configuration
| Env var | Effect |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| NOOB_API_BASE | override the gateway URL |
| NOOB_API_KEY | API key (overrides ~/.noob/config.json) |
| NOOB_INSECURE_TLS=1 | disable TLS verification — last resort for machines behind a TLS-intercepting proxy. Prefer adding your proxy CA to the trust store. |
Model compatibility
The agent drives tools through a text protocol (the proxy has no native function-calling). Models differ in how willingly they follow it:
| Provider | Agentic tools | Notes |
| ---------------------- | ---------------- | ---------------------------------------- |
| Anthropic (Claude) | ✅ best | default — gateway-claude-opus-4-7 |
| DeepSeek | ✅ works | good free alternative |
| OpenAI (GPT/o-series) | ⚠️ often refuses | replies "I can't access your filesystem" |
| Google (Gemini) | ⚠️ often refuses | same |
Stick with Claude or DeepSeek for file edits & commands. Any model is fine for
plain chat, /merge, and /search.
Project structure
src/
├── api.js # gateway client + stream parser + memory token
├── agent.js # tool-loop driver, summarization, prompt assembly
├── tools.js # read/write/edit/list_dir/glob/grep/run_command + bg
├── repl.js # input loop, slash commands, session state (88 KB)
├── repl/
│ ├── complete.js # SLASH catalog + autocomplete
│ ├── todos.js # parseTodosFromHistory (pure)
│ ├── ultra.js # ULTRA mode constants + prompt templates
│ └── workflow-commands.js # /workflow help/list/load/delete (pure)
├── subagent.js # spawn_agent / spawn_agents — sub-agent isolation
├── tui.js # terminal UI (input, status bar, prompt rendering)
├── ui.js # color helpers, markdown renderer, banner
├── config.js # ~/.noob/config.json (api key, gateway, model)
├── sessions.js # ~/.noob/sessions/ — save/list/resume
├── skills.js # ~/.noob/skills/ — user-defined skill loader
├── workflows.js # ~/.noob/workflows/ — user-saved workflows
├── workflows-builtin.js # ship-with-binary workflows (deep-research, etc)
├── memory.js # noob.md per-project agent memory
├── tokens.js # local token counter (o200k_base / cl100k_base)
├── models.js # 34-model catalog + fuzzy resolver
├── i18n.js # Vietnamese string table
├── update.js # `noob update` self-updater
└── prompts/
└── system.md # base system prompt template
tests/ # vitest unit tests (96 tests)
scripts/ # check-imports, notify-discord, release.ps1Development
npm test # run vitest unit tests (96 tests across 7 files)
npm run lint # eslint --check
npm run lint:fix # eslint --fix
npm run format # prettier --write
npm run format:check # prettier --check
npm run check # lint + format:check + test (pre-commit gate)Husky chạy lint-staged + npm test trước mỗi commit. Bỏ qua bằng
git commit --no-verify nếu thực sự cần (vd commit WIP).
Troubleshooting
"CLI tự thoát sau khi hỏi quyền" — thường là readline trên Windows phát sự
kiện close từ tiến trình con chạm vào console. Đã có workaround trong
repl.js (input layer tự re-arm). Nếu còn xảy ra, mở issue kèm OS + Node version.
"TLS error / certificate" — máy bạn sau proxy chặn TLS (Zscaler, Cisco
Umbrella…). Ưu tiên add CA của proxy vào trust store. Cuối cùng mới dùng
NOOB_INSECURE_TLS=1 (tắt verify TLS toàn process, MITM-vulnerable).
"Model OpenAI/Gemini từ chối tool" — bình thường. GPT-o-series và Gemini
thường refuse access filesystem qua text protocol. Dùng /model claude-opus hoặc
/model deepseek-v3 cho tasks cần tool.
"Token count có vẻ sai" — tokens.js chọn encoder theo model id
(o200k_base cho GPT-4o/5/o-series, cl100k_base cho phần còn lại). Đếm chính
xác cho OpenAI, xấp xỉ ±5-15% cho Claude/Gemini/khác (các provider này không
publish tokenizer public).
Notes & limits
- Free shared proxy: rate limits and occasional hiccups are expected.
- Context is sent in full each turn, so very long sessions cost more tokens — use
/clearto reset. - This is an unofficial tool built against a public community endpoint; it is not affiliated with Anthropic or the model providers.
License
MIT
