From f13dcd6cae58152e1035b1fc5d9791fe476bc477 Mon Sep 17 00:00:00 2001 From: laily Date: Tue, 26 May 2026 11:17:03 +0800 Subject: [PATCH] chore: bootstrap agent-notify Go project Co-authored-by: Cursor --- Makefile | 11 +++++++++++ cmd/agent-notify/main.go | 32 ++++++++++++++++++++++++++++++++ go.mod | 3 +++ 3 files changed, 46 insertions(+) create mode 100644 Makefile create mode 100644 cmd/agent-notify/main.go create mode 100644 go.mod diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..01d6fcc --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +.PHONY: build test install +BINARY := agent-notify + +build: + go build -o bin/$(BINARY) ./cmd/agent-notify + +test: + go test ./... + +install: build + install -m 755 bin/$(BINARY) $(HOME)/.local/bin/$(BINARY) diff --git a/cmd/agent-notify/main.go b/cmd/agent-notify/main.go new file mode 100644 index 0000000..6168bde --- /dev/null +++ b/cmd/agent-notify/main.go @@ -0,0 +1,32 @@ +package main + +import ( + "fmt" + "os" +) + +func main() { + if len(os.Args) < 2 { + printUsage() + os.Exit(1) + } + switch os.Args[1] { + case "send", "hook", "install", "test", "doctor", "help", "-h", "--help": + fmt.Fprintf(os.Stderr, "agent-notify: %s not implemented yet\n", os.Args[1]) + os.Exit(1) + default: + printUsage() + os.Exit(1) + } +} + +func printUsage() { + fmt.Fprint(os.Stderr, `Usage: agent-notify +Commands: + send Send a notification + hook Agent hook entrypoint + install Install hook configs + test Send test notification + doctor Check environment +`) +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..d514fb6 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/longbin/agent-notify + +go 1.22.2