{"id":25778898,"url":"https://github.com/sawadashota/keybaser","last_synced_at":"2025-10-25T04:11:33.977Z","repository":{"id":57494345,"uuid":"208056222","full_name":"sawadashota/keybaser","owner":"sawadashota","description":"Keybase Bot Framework","archived":false,"fork":false,"pushed_at":"2019-11-17T12:12:11.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-08-10T02:44:45.110Z","etag":null,"topics":["bot","chatbot","go","keybase"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sawadashota.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-12T13:21:05.000Z","updated_at":"2020-09-06T08:35:12.000Z","dependencies_parsed_at":"2022-09-14T19:41:47.695Z","dependency_job_id":null,"html_url":"https://github.com/sawadashota/keybaser","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawadashota%2Fkeybaser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawadashota%2Fkeybaser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawadashota%2Fkeybaser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawadashota%2Fkeybaser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sawadashota","download_url":"https://codeload.github.com/sawadashota/keybaser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240990641,"owners_count":19889916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","chatbot","go","keybase"],"created_at":"2025-02-27T06:38:20.093Z","updated_at":"2025-10-25T04:11:28.947Z","avatar_url":"https://github.com/sawadashota.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Keybaser [![GitHub Actions](https://github.com/sawadashota/keybaser/workflows/Go/badge.svg)](https://github.com/sawadashota/keybaser/actions) [![GoDoc](https://godoc.org/github.com/sawadashota/keybaser?status.svg)](https://godoc.org/github.com/sawadashota/keybaser) [![codecov](https://codecov.io/gh/sawadashota/keybaser/branch/master/graph/badge.svg)](https://codecov.io/gh/sawadashota/keybaser) [![Go Report Card](https://goreportcard.com/badge/github.com/sawadashota/keybaser)](https://goreportcard.com/report/github.com/sawadashota/keybaser) [![GolangCI](https://golangci.com/badges/github.com/sawadashota/keybaser.svg)](https://golangci.com/r/github.com/sawadashota/keybaser)\n [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n===\n\nBuilt on top of the Keybase API [github.com/keybase/go-keybase-chat-bot](https://github.com/keybase/go-keybase-chat-bot) with the idea to simplify the Real-Time Messaging feature to easily create Keybase Bots, likely [github.com/shomali11/slacker](https://github.com/shomali11/slacker)\n\nFeatures\n---\n\nFeatures are almost same as [github.com/shomali11/slacker](https://github.com/shomali11/slacker) \n\n* Easy definitions of commands and their input\n* Available bot initialization, errors and default handlers\n* Simple parsing of String, Integer, Float and Boolean parameters\n* Contains support for `context.Context`\n*Built-in `help` command\n* supports authorization\n* bot responds to mentions and direct messages\n* handlers run concurrently via goroutine\n* Full access to the Keybase API [github.com/keybase/go-keybase-chat-bot](https://github.com/keybase/go-keybase-chat-bot)\n\nDependencies\n---\n\n* `commander` [github.com/shomali11/slacker](https://github.com/shomali11/slacker)\n* `go-keybase-chat-bot` [github.com/keybase/go-keybase-chat-bot](https://github.com/keybase/go-keybase-chat-bot)\n\nRequirements\n---\n\n* [Keybase App](https://keybase.io/download)\n\nInstall\n---\n\n```\ngo get github.com/sawadashota/keybaser\n```\n\nExamples\n---\n\n### Example 1\n\nDefining a simple command\n\n[examples/simple](./examples/simple)\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/keybase/go-keybase-chat-bot/kbchat\"\n\t\"github.com/sawadashota/keybaser\"\n)\n\nfunc main() {\n\tclient, err := kbchat.Start(kbchat.RunOptions{\n\t\tOneshot: \u0026kbchat.OneshotOptions{\n\t\t\tUsername: \"\u003cBot's Username\u003e\",\n\t\t\tPaperKey: \"\u003cBot's PaperKey\u003e\",\n\t\t},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tbot, err := keybaser.New(client)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tdefinition := \u0026keybaser.CommandDefinition{\n\t\tHandler: func(request keybaser.Request, response keybaser.ResponseWriter) {\n\t\t\tresponse.Reply(\"pong\")\n\t\t},\n\t}\n\n\tbot.Command(\"ping\", definition)\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\tif err := bot.Listen(ctx); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\nExample 2\n---\n\nDefining a command with parameter, description and example\n\n[examples/parameter](./examples/parameter)\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/keybase/go-keybase-chat-bot/kbchat\"\n\t\"github.com/sawadashota/keybaser\"\n)\n\nfunc main() {\n\tclient, err := kbchat.Start(kbchat.RunOptions{\n\t\tOneshot: \u0026kbchat.OneshotOptions{\n\t\t\tUsername: \"\u003cBot's Username\u003e\",\n\t\t\tPaperKey: \"\u003cBot's PaperKey\u003e\",\n\t\t},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tbot, err := keybaser.New(client)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tdefinition := \u0026keybaser.CommandDefinition{\n\t\tDescription: \"Greet to you\",\n\t\tExample:     \"greet alice\",\n\t\tHandler: func(request keybaser.Request, response keybaser.ResponseWriter) {\n\t\t\tname := request.Param(\"name\")\n\t\t\tresponse.Reply(\"Hello \" + name)\n\t\t},\n\t}\n\n\tbot.Command(\"greet \u003cname\u003e\", definition)\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\tif err := bot.Listen(ctx); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\nExample 3\n---\n\nSample of running on Docker.\n\nKeybaser doesn't work Go's binary alone because [github.com/keybase/go-keybase-chat-bot](https://github.com/keybase/go-keybase-chat-bot) requires keybase app.\nSo this sample is using [keybaseio/client](https://hub.docker.com/r/keybaseio/client) as execution image.\nThe image's Dockerfile is [here](https://github.com/keybase/client/tree/master/packaging/linux/docker)\n\n[examples/docker](./examples/docker)\n\n```dockerfile\n# Build Chat Bot app\nFROM golang:1.13-buster as builder\n\nWORKDIR /app\n\nCOPY . .\n\nRUN go mod download \u0026\u0026 \\\n    go mod verify \u0026\u0026 \\\n    CGO_ENABLED=0 GO111MODULE=on GOOS=linux GOARCH=amd64 \\\n        go build \\\n        -o app \\\n        main.go\n\n# Copy chat bot app binary to executor image\nFROM keybaseio/client:nightly-slim\n\nCOPY --from=builder /app/app /usr/bin/app\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsawadashota%2Fkeybaser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsawadashota%2Fkeybaser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsawadashota%2Fkeybaser/lists"}