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

@ricequant2026/rqams-cli

v0.0.1

Published

RQAMS CLI for AI agents

Readme

RQAMS CLI

rqamsc 是面向终端脚本和 AI Agent 的 RQAMS 命令行工具。所有业务命令统一使用 JSON payload 输入,默认返回 JSON envelope,列表类命令可按需输出 NDJSON。

rqamsc <verb> <resource> --payload <json|@file|->

文档分工

| 文档 | 用途 | | --- | --- | | 使用手册 | 完整文档入口:安装方式、通用协议、命令导航、业务文档索引和高频示例 |

仓库根目录的 README.md 描述 Go/npm 形态的 rqamsc CLI。详细业务说明、payload 字段、返回结构和示例维护在 docs/commands/ 目录。

安装与构建

通过 npm 安装

用户只需要安装主包,npm 会按当前平台自动安装对应的可选平台二进制包:

npm install -g @ricequant2026/rqams-cli
rqamsc --version

如果安装后提示缺少平台包,通常是 optional dependencies 被禁用,可以显式开启后重新安装:

npm install -g @ricequant2026/rqams-cli --include=optional

从源码构建

本项目使用 Go 1.22+。本地直接运行:

go run ./cmd/rqamsc --version
go run ./cmd/rqamsc schema list

构建当前平台二进制:

go build -trimpath -ldflags "-s -w -X rqams-cli/internal/app.Version=0.0.1" -o rqamsc.exe ./cmd/rqamsc
.\rqamsc.exe --version

非 Windows 平台可把输出文件名改为 rqamsc

交叉编译

Windows x64:

$env:CGO_ENABLED = "0"
$env:GOOS = "windows"
$env:GOARCH = "amd64"
go build -trimpath -ldflags "-s -w -X rqams-cli/internal/app.Version=0.0.1" -o dist/rqamsc-windows-amd64.exe ./cmd/rqamsc

Linux x64:

$env:CGO_ENABLED = "0"
$env:GOOS = "linux"
$env:GOARCH = "amd64"
go build -trimpath -ldflags "-s -w -X rqams-cli/internal/app.Version=0.0.1" -o dist/rqamsc-linux-amd64 ./cmd/rqamsc

macOS arm64:

$env:CGO_ENABLED = "0"
$env:GOOS = "darwin"
$env:GOARCH = "arm64"
go build -trimpath -ldflags "-s -w -X rqams-cli/internal/app.Version=0.0.1" -o dist/rqamsc-macos-arm64 ./cmd/rqamsc

npm run build:npm 会执行同样的交叉编译流程,并用 package.json 里的版本号注入二进制。

npm 包结构

本仓库通过 npm 分发 Go 二进制,采用“主包 + 平台包”的结构:

  • 主包 @ricequant2026/rqams-cli 维护 JS launcher、文档和构建脚本。
  • 平台包 @ricequant2026/rqams-cli-<platform> 保存对应平台的 Go 二进制。
  • npm/dist/npm run build:npm 生成的发布产物,不需要手工维护。

构建所有平台 npm 包:

npm run build:npm

链接当前平台包用于本地测试:

npm run link:platform
npm link

验证命令:

rqamsc --version
rqamsc schema list
rqamsc get product-list --payload '{}'

打包发布产物:

npm run pack:all

发布到 npm:

npm run publish:dry-run
npm run publish:all

publish:all 会先生成平台包,按平台包优先、主包最后的顺序发布。主包的 optionalDependencies 指向平台包,用户只需要安装主包:

npm install -g @ricequant2026/rqams-cli

功能范围

  • 统一命令入口:rqamsc <verb> <resource> --payload ...
  • 命令发现:--help--versionschema listschema get
  • Workspace、产品、产品组管理
  • 交易流水、估值表、托管事件、份额事件
  • 自定义合约、自定义基准、自定义指标
  • 指标、投资概览、绩效归因、交易分析
  • 模拟交易创建、配置、信号上传、重算和删除
  • 文件上传和下载使用本地路径,返回保存路径或任务结果
  • npm 分发采用主包提供 JS launcher、平台包提供 Go 二进制的方式

Agent 集成

rqamsc 提供运行时 schema,Agent 可以用它发现命令、参数和返回结构:

rqamsc schema list
rqamsc schema get --payload '{"command":"get product-list"}'

更完整的 skill 或 Agent 集成说明维护在 ricequant-skills

配置

本地状态默认保存在操作系统用户配置目录的 rqams-cli/config.json。用户执行 authuse workspace 后,后续命令会自动复用本地配置,不需要设置环境变量。

当前 CLI 会把密码和登录 session 明文写入本地配置。session 过期时,CLI 会用本地保存的密码自动重新登录并刷新 session。若用于生产凭据长期保存,需要改为系统 keychain 或等价安全存储。

单账号单 workspace 可以直接使用默认配置。需要单账号多 workspace 或多账号多 workspace 并行使用时,建议为每个上下文设置独立 profile:

rqamsc auth --payload '{"profile":"acct-a-w1","base_url":"https://www.ricequant.com","username":"...","password":"..."}'
rqamsc use workspace --payload '{"profile":"acct-a-w1","workspace_name_or_id":"workspace-a"}'
rqamsc get product-list --payload '{"profile":"acct-a-w1"}'

业务命令可以在 payload 顶层传 profile,从同一个配置文件中选择互相隔离的登录态和 workspace。