Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ jobs:
run: echo "VERSION=${GITHUB_REF_NAME}" >> "$GITHUB_ENV"

- name: Build package
run: task package GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} PACKAGE_NAME=cws_${VERSION}_${{ matrix.goos }}_${{ matrix.goarch }}
run: task package GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} PACKAGE_NAME=chaitin-cli_${VERSION}_${{ matrix.goos }}_${{ matrix.goarch }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cws_${{ env.VERSION }}_${{ matrix.goos }}_${{ matrix.goarch }}
path: dist/cws_${{ env.VERSION }}_${{ matrix.goos }}_${{ matrix.goarch }}.*
name: chaitin-cli_${{ env.VERSION }}_${{ matrix.goos }}_${{ matrix.goarch }}
path: dist/chaitin-cli_${{ env.VERSION }}_${{ matrix.goos }}_${{ matrix.goarch }}.*
if-no-files-found: error

release:
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This repository is a Go CLI built around Cobra. [`main.go`](main.go) wires the r

Use `task` for common workflows:

- `task build`: build `bin/cws`.
- `task build`: build `bin/chaitin-cli`.
- `task test`: run `go test ./...`.
- `task fmt`: run `go fmt ./...`.
- `task lint`: run `go vet ./...`.
Expand Down
8 changes: 4 additions & 4 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3"

vars:
BIN_NAME: cws
BIN_NAME: chaitin-cli
BUILD_DIR: bin
DIST_DIR: dist

Expand Down Expand Up @@ -42,13 +42,13 @@ tasks:
- go test ./...

build:
desc: Build the cws binary
desc: Build the {{ .BIN_NAME }} binary
cmds:
- mkdir -p {{.BUILD_DIR}}
- go build -o {{.BUILD_DIR}}/{{.BIN_NAME}} .

build:target:
desc: Build the cws binary for a target platform
desc: Build the {{ .BIN_NAME }} binary for a target platform
requires:
vars:
- GOOS
Expand All @@ -61,7 +61,7 @@ tasks:
- env CGO_ENABLED=0 GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -o {{.TARGET_DIR}}/{{.BIN_NAME}}{{.BIN_EXT}} .

package:
desc: Build and archive the cws binary for a target platform
desc: Build and archive the {{ .BIN_NAME }} binary for a target platform
requires:
vars:
- GOOS
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const defaultConfigPath = "config.yaml"

func newApp() (*app, error) {
root := &cobra.Command{
Use: "cws",
Use: "chaitin-cli",
Short: "CLI for Chaitin Tech products",
SilenceUsage: true,
SilenceErrors: true,
Expand Down
8 changes: 4 additions & 4 deletions products/safeline-ce/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ func NewCommand() *cobra.Command {
api_key: your-api-key

# 2. 查看帮助
cws safeline-ce --help
chaitin-cli safeline-ce --help

# 3. 查看站点列表
cws safeline-ce site list
chaitin-cli safeline-ce site list

# 4. 查看攻击日志
cws safeline-ce log attack list
chaitin-cli safeline-ce log attack list

# 5. 查看统计概览
cws safeline-ce stat overview
chaitin-cli safeline-ce stat overview

文档: https://github.com/chaitin/safeline-ce`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
Expand Down
Loading