跳转至

CLI 使用

下面的示例采用 ctl 主命令名。

帮助与查看

asactl -h
asactl -h agreement
asactl -h service

内置模块调用

asactl account userinfo
asactl a userinfo

协议查询

asactl agreement search -q '{"tags":["payment"]}'
asactl agreement get -q '{"agreementName":"try","version":"v2.4.5"}'

服务查询

asactl service search -q '{"query":"auth"}'
asactl service get -q '{"serviceId":"<service-id>"}'

serviceId 需要先从 service search 的返回结果中取得。

协议调用

asactl call try -a ping -v v2.4.5 -h https://api.asahub.ai/service.tryAuthService/

模块快速命令

# account
asactl -h account
asactl account login -q '{"email":"user@example.com"}'
asactl account register -q '{"email":"user@example.com"}'
asactl account verify -q '{"action":"login","code":"123456"}'
asactl account userinfo

# service
asactl -h service
asactl service search -q '{"query":"shop"}'
asactl service get -q '{"serviceId":"<service-id>"}'
asactl service listmy -q '{"filter":"enabled"}'
asactl service post -q '{"name":"<service-name>","summary":"service summary","provider":"asa"}'

# agreement
asactl -h agreement
asactl agreement search -q '{"tags":["payment"]}'
asactl agreement get -q '{"agreementName":"shop","version":"v1.0.0"}'
asactl agreement listmy
asactl agreement cat -q '{"agreementName":"shop","version":"v1.0.0"}'

# flow
asactl -h flow
asactl flow search

# plugin
asactl -h plugin

# build
asactl -h build
asactl build agreement

本地调试服务

asactl run server
curl http://127.0.0.1:3000/health