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

@suixinyu/lacan-cli

v0.1.2

Published

随心语平台命令行工具

Readme

@suixinyu/lacan-cli

随心语平台命令行工具。可执行命令为 lacan-ai,用于调用平台 API 查询咨询师、提交公开线索、维护咨询师资料、管理排班和执行管理员运营动作。

快速开始

无需安装,直接使用 npm 包运行:

npx -y --package @suixinyu/lacan-cli lacan-ai --help
npx -y --package @suixinyu/lacan-cli lacan-ai visitor consultants list --keyword "焦虑" --json

也可以全局安装:

npm i -g @suixinyu/lacan-cli
lacan-ai --help

环境变量

  • LACAN_API_BASE:API 地址,默认 https://lacan.vip/api/v1
  • LACAN_TOKEN:访问凭证。管理员、咨询师工作台和需要身份的 visitor 命令必须配置;公开 visitor 命令可不配置。

临时配置示例:

export LACAN_TOKEN="<token>"
export LACAN_API_BASE="https://lacan.vip/api/v1"

公共咨询师检索

这些命令不需要 LACAN_TOKEN

lacan-ai visitor consultants list --keyword "亲密关系" --json
lacan-ai visitor consultants detail --consultant-id <id> --json
lacan-ai visitor support-channel get --json

提交线索需要用户明确同意留资:

lacan-ai visitor leads create \
  --payload-json '{"summary":"想找精神分析取向咨询师","contactType":"wechat","contactValue":"wx_example","consentConfirmed":true,"sourceChannel":"cli"}' \
  --json

咨询师工作台

需要 LACAN_TOKEN,且账号已开通咨询师工作台。

lacan-ai workspace profile get --json
lacan-ai workspace profile describe-update --json
lacan-ai workspace profile preview-update --payload-json '{"headline":"专注陪伴职场与关系困扰来访者"}' --json
lacan-ai workspace profile update --payload-json '{"headline":"专注陪伴职场与关系困扰来访者"}' --json
lacan-ai workspace profile upload-avatar --file ./avatar.png --json
lacan-ai workspace availability get --json

管理员运营

需要具备管理员权限的 LACAN_TOKEN

lacan-ai admin counselors list --keyword "方世玉" --json
lacan-ai admin counselors get --counselor-id <id> --json
lacan-ai admin counselors describe-update --json
lacan-ai admin counselors preview-update --counselor-id <id> --payload-json '{"headline":"新的展示标题"}' --json
lacan-ai admin counselors update --counselor-id <id> --payload-json '{"headline":"新的展示标题"}' --json
lacan-ai admin counselors upload-avatar --counselor-id <id> --file ./avatar.png --json

文章运营命令:

lacan-ai admin articles list --status DRAFT --json
lacan-ai admin articles get --article-id <id> --json
lacan-ai admin articles create-draft --payload-json '{"title":"标题","summary":"摘要","content":"正文","categoryType":"SCIENCE_GUIDE"}' --json
lacan-ai admin articles preview-update --article-id <id> --payload-json '{"title":"新标题"}' --json
lacan-ai admin articles publish --article-id <id> --payload-json '{"heroPinned":true}' --json

资料更新流程

资料更新接口使用最小 patch。不要把完整详情原样回写。

推荐顺序:

  1. getlistresolve 确认目标。
  2. describe-update 查看可编辑字段、枚举值和约束。
  3. preview-update 检查变更字段。
  4. update 正式写入。
  5. 写入后按返回结果或回读结果确认。

地区字段不要手写编码,先解析地区:

lacan-ai resolve region --province-name "上海市" --district-name "徐汇区" --json

数组和对象字段是替换语义。需要追加数组项或补充对象字段时,先读取当前值,合并后提交完整数组或完整对象。

咨询师资料字段

admin counselors describe-updateworkspace profile describe-update 会返回当前可写字段。常用字段包括:

  • 基础资料:displayNameheadlineintroworkApproachBio
  • 地区:provinceCodeprovinceNamecityCodecityNamedistrictCodedistrictNameregionCatalogVersion
  • 标签与服务:specialtyPlainTextsconcernTagstaxonomyTagsserviceTypesfulfillmentModes
  • 资质与经历:credentialTagseducationExperiencesserviceTargetTags
  • 执业信息:practiceMetrics
  • 平台运营信息:platformSignals
  • 结构化档案:profileDocument
  • 管理员专属:listingStatusriskLevel

头像不在 JSON patch 中更新,使用 upload-avatar 命令。支持 jpgjpegpngwebp,单文件不超过 5MB。

排障

检查当前环境:

lacan-ai-bootstrap-check
lacan-ai whoami --json
lacan-ai doctor --json

常见问题:

  • LACAN_TOKEN 未配置:先设置访问凭证。
  • AUTH_SCOPE_NOT_ALLOWED:当前凭证缺少目标命令需要的 scope。
  • ROLE_NOT_ALLOWED:当前账号角色不匹配。
  • RESOURCE_NOT_FOUND:目标 ID 不存在,先用 listresolve 重新确认。