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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@optima-chat/optima-agent

v0.2.26

Published

基于 Claude Agent SDK 的电商运营 AI 助手

Readme

Optima Agent

基于 Claude Agent SDK 的电商运营 AI 助手。

npm version License: MIT

快速开始

安装

npm install -g @optima-chat/optima-agent@latest

认证

export ANTHROPIC_API_KEY=your-api-key

或使用 Claude Code 的认证(~/.claude/)。

使用

# 交互模式(终端对话)
optima

# Headless 模式(容器内运行,stdin/stdout JSON)
optima headless

# 服务器模式(HTTP + WebSocket)
optima serve --port 3000

# 单次查询
optima -p "查看商品列表"

功能特性

核心能力

  • 店铺管理 - 查看和更新店铺信息
  • 商品管理 - 创建、编辑、查询商品
  • 订单处理 - 发货、退款、订单查询
  • 库存管理 - 监控库存、调整数量
  • 国际化 - 多语言翻译管理
  • 店铺配置 - 首页、集合、商品详情页
  • 图像/视频 - AI 生成产品图片和视频
  • 广告投放 - Google Ads 管理
  • 选品调研 - Amazon 产品分析
  • 数据分析 - 销售数据和趋势

执行模式

| 模式 | 用途 | 特性 | |------|------|------| | Stream | 本地终端交互 | Context 可视化、命令菜单、实时统计 | | Headless | 容器内运行 | stdin/stdout JSON、多对话管理、会话恢复 | | Server | 多客户端服务 | WebSocket、完整统计、Abort 支持 | | 单次查询 | 命令行执行 | 快速查询、支持 JSON 输出 |

可用 Skills

| Skill | 用途 | |-------|------| | merchant | 店铺信息管理 | | product | 商品管理 | | order | 订单处理 | | inventory | 库存管理 | | i18n | 国际化翻译 | | storefront | 店铺前台配置 | | comfy | 图像/视频生成 | | ads | Google Ads 广告 | | scout | Amazon 选品调研 | | bi | 数据分析 |

配置

项目根目录可选配置:

OPTIMA.json - 配置选项

{
  "model": "claude-sonnet-4-5-20250929",
  "maxTurns": 50
}

OPTIMA.md - 自定义 System Prompt

# 项目规则

- 使用简体中文
- 优先使用现有库存

API 使用

import { OptimaAgent } from '@optima-chat/optima-agent';

const agent = new OptimaAgent({
  model: 'claude-sonnet-4-5-20250929',
  maxTurns: 50,
});

for await (const event of agent.chat('查看商品列表')) {
  if (event.type === 'assistant') {
    console.log(event.message);
  }
}

// 重置会话
agent.reset();

技术架构

┌─────────────────────────────────────────────────────────────────┐
│                        用户界面层                                │
│  ┌──────────────────┐              ┌──────────────────┐        │
│  │   终端 CLI       │              │   HTTP Server    │        │
│  │  (Stream Mode)   │              │   (WebSocket)    │        │
│  └────────┬─────────┘              └────────┬─────────┘        │
└───────────┼──────────────────────────────────┼──────────────────┘
            │                                  │
            └──────────────┬───────────────────┘
                           ▼
┌─────────────────────────────────────────────────────────────────┐
│                      Optima Agent 核心                           │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │                  Claude Agent SDK                          │  │
│  │  • 流式输出  • 上下文管理  • Hooks  • 会话恢复             │  │
│  └───────────────────────────────────────────────────────────┘  │
│                             │                                    │
│  ┌──────────────┬──────────┴──────────┬──────────────┐         │
│  │              │                      │              │         │
│  ▼              ▼                      ▼              ▼         │
│ Skills      System Prompt          Tools         MCP Server    │
│ (10个)      (引导逻辑)           (Bash/Read..)    (Memory)      │
└──────────────────────┬──────────────────────────────────────────┘
                       │
        ┌──────────────┼──────────────┐
        ▼              ▼               ▼
┌─────────────┐  ┌──────────┐  ┌──────────────┐
│ commerce    │  │  comfy   │  │ google-ads   │
│   -cli      │  │   -cli   │  │    -cli      │  ...
│             │  │          │  │              │
│ 商品·订单   │  │ 图像·视频 │  │   广告投放    │
└─────────────┘  └──────────┘  └──────────────┘

技术栈

  • 核心: Claude Agent SDK v0.1.55
  • 语言: TypeScript
  • UI: 自定义终端渲染
  • 工具集成: 5 个专业 CLI 工具

开发

# 安装依赖
npm install

# 开发模式
npm run dev

# 构建
npm run build

# 类型检查
npm run typecheck

License

MIT