npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@daabin/bincode

v0.2.1

Published

A powerful CLI code agent with multi-LLM support, code search, and intelligent tools

Readme

bincode

一个强大的 CLI 代码智能助手,支持多 LLM Provider、代码搜索、智能工具和会话管理。

npm version Node.js License: MIT CI

功能特性

🤖 多 LLM 支持

  • DeepSeek (默认) - 高性价比,中文友好
  • OpenAI - GPT-4o, GPT-4-turbo
  • Anthropic - Claude 3.5 Sonnet
  • Ollama - 本地模型,隐私优先

🔧 20+ 智能工具

| 类别 | 工具 | |------|------| | 📁 文件操作 | read, write, edit, delete, move, list, glob | | 🔍 代码搜索 | grep, search_files, code_search | | ⚡ 命令执行 | run_command (安全白名单) | | 🔄 Git 集成 | git_status, git_diff, git_log | | 🌐 Web 工具 | web_search, web_fetch | | 🖼️ 图片分析 | analyze_image (多模态) | | 📝 文档生成 | generate_docs | | 🔀 文件对比 | compare_files |

📊 高级功能

  • 代码索引 - 符号搜索、语义查找
  • 代码补全 - AI 驱动的智能补全
  • 会话管理 - 持久化、导出 Markdown
  • Token 监控 - 使用统计、成本追踪
  • 插件系统 - 自定义工具扩展
  • MCP 协议 - Model Context Protocol 支持

安装

方式一:npm 全局安装(推荐)

npm install -g @daabin/bincode
bincode

方式二:npx 直接运行

npx @daabin/bincode

方式三:下载独立二进制

GitHub Releases 下载对应平台的可执行文件:

| 平台 | 文件 | |------|------| | Linux x64 | bincode-linux-x64.tar.gz | | macOS Intel | bincode-macos-x64.tar.gz | | macOS Apple Silicon | bincode-macos-arm64.tar.gz | | Windows x64 | bincode-windows-x64.zip |

# Linux/macOS
tar -xzf bincode-*.tar.gz
chmod +x bincode
./bincode

# Windows
# 解压后双击 bincode.exe 或在终端运行

方式四:从源码构建

git clone https://github.com/daabin/bincode.git
cd bincode
npm install
npm run build
npm link
bincode

快速开始

1. 配置 API Key

方式一:CLI 命令(推荐)

bincode
> /setkey sk-your-api-key

方式二:环境变量

export DEEPSEEK_API_KEY="sk-your-api-key"
bincode

方式三:配置文件

# 编辑 ~/.bincode/config.json
{
  "provider": "deepseek",
  "apiKey": "sk-your-api-key",
  "model": "deepseek-chat"
}

2. 切换 LLM Provider

> /setprovider openai    # 使用 OpenAI
> /setprovider anthropic # 使用 Claude
> /setprovider ollama    # 使用本地模型
> /setprovider deepseek  # 切回 DeepSeek

3. 开始使用

> 帮我查看 README.md 并优化文档结构
> 在 src 目录里搜索 agent loop 的实现
> 运行 npm test 看看测试是否通过
> 分析 /path/to/image.png 这张图片

CLI 命令

| 命令 | 说明 | |------|------| | /setkey <key> | 保存 API Key | | /setprovider <name> | 切换 LLM Provider | | /stats | 查看 Token 使用统计 | | /config | 显示当前配置 | | /clear | 清空对话历史 | | /exit | 退出 CLI |


环境变量

| 变量 | 默认值 | 说明 | |------|--------|------| | DEEPSEEK_API_KEY | - | DeepSeek API Key | | OPENAI_API_KEY | - | OpenAI API Key | | ANTHROPIC_API_KEY | - | Anthropic API Key | | OLLAMA_BASE_URL | http://localhost:11434 | Ollama 服务地址 | | BINCODE_PROVIDER | deepseek | 默认 Provider | | BINCODE_MODEL | - | 默认模型 |


配置文件

配置文件位置:~/.bincode/config.json

{
  "provider": "deepseek",
  "apiKey": "sk-your-api-key",
  "baseUrl": "https://api.deepseek.com",
  "model": "deepseek-chat",
  "allowedCommands": ["npm", "node", "git"],
  "deniedCommands": ["rm -rf /"]
}

作为库使用

import { Agent, createProvider, toolDefinitions } from '@daabin/bincode';

// 创建 Agent
const agent = new Agent({
  provider: 'deepseek',
  apiKey: process.env.DEEPSEEK_API_KEY,
  model: 'deepseek-chat'
});

// 运行对话
for await (const event of agent.run('帮我分析这个项目')) {
  if (event.type === 'content') {
    process.stdout.write(event.delta);
  }
}

// 使用代码索引
import { indexWorkspace, searchSymbols } from '@daabin/bincode';
const entries = indexWorkspace('./src');
const results = searchSymbols(entries, 'Agent');

项目结构

bincode/
├── src/
│   ├── cli.tsx           # CLI 入口
│   ├── agent.ts          # Agent 主循环
│   ├── tools.ts          # 20+ 工具定义
│   ├── llm/              # LLM Provider 实现
│   │   ├── deepseek.ts
│   │   ├── openai.ts
│   │   ├── anthropic.ts
│   │   └── ollama.ts
│   ├── indexer.ts        # 代码索引
│   ├── image.ts          # 图片分析
│   ├── completion.ts     # 代码补全
│   ├── plugin.ts         # 插件系统
│   ├── mcp.ts            # MCP 协议
│   └── session.ts        # 会话管理
├── dist/                 # 编译输出
└── package.json

开发

# 安装依赖
npm install

# 开发模式
npm run dev

# 构建
npm run build

# 测试
npm test

# 类型检查
npm run typecheck

# 测试覆盖率
npm run test:coverage

许可证

MIT

贡献

欢迎提交 Issue 和 Pull Request!


版本: 0.2.1
Node.js: >= 18.17
维护: 活跃开发中