rename binary to htsy-cli

This commit is contained in:
dcsunny
2026-07-01 15:03:36 +08:00
parent 9e9ae38858
commit 6fae590d2e
2 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
BINARY ?= htsy
BINARY ?= htsy-cli
VERSION ?= dev
LDFLAGS := -s -w -X main.version=$(VERSION)
PLATFORMS := linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64 windows/arm64
+12 -12
View File
@@ -44,7 +44,7 @@ func run(args []string) error {
case "config":
return runConfig(args[1:])
case "version", "--version", "-v":
fmt.Printf("htsy %s %s/%s\n", version, runtime.GOOS, runtime.GOARCH)
fmt.Printf("htsy-cli %s %s/%s\n", version, runtime.GOOS, runtime.GOARCH)
return nil
case "help", "--help", "-h":
printUsage()
@@ -369,7 +369,7 @@ func runCall(args []string) error {
token = cfg.Token
}
if !noAuth && token == "" {
return fmt.Errorf("not logged in; run htsy login first or pass --token")
return fmt.Errorf("not logged in; run htsy-cli login first or pass --token")
}
body, err := readJSONData(data)
if err != nil {
@@ -570,18 +570,18 @@ func printObject(value any) error {
func printUsage() {
fmt.Println(strings.TrimSpace(`
htsy 是海豚私域接口命令行工具。
htsy-cli 是海豚私域接口命令行工具。
用法:
htsy login --username USER --password PASS [--base-url URL]
htsy account-login --phone PHONE --password PASS
htsy send-code --phone PHONE --scene register
htsy register --username PHONE --password PASS --sms-code CODE [--invite-token TOKEN]
htsy call /api/account/user/info -d '{}'
htsy status
htsy logout
htsy config path
htsy config set-base-url https://htsy-gateway.cpshelp.cn
htsy-cli login --username USER --password PASS [--base-url URL]
htsy-cli account-login --phone PHONE --password PASS
htsy-cli send-code --phone PHONE --scene register
htsy-cli register --username PHONE --password PASS --sms-code CODE [--invite-token TOKEN]
htsy-cli call /api/account/user/info -d '{}'
htsy-cli status
htsy-cli logout
htsy-cli config path
htsy-cli config set-base-url https://htsy-gateway.cpshelp.cn
配置:
登录信息会保存到当前用户主目录下的 ~/.htsy/config.json。