{"id":13507548,"url":"https://github.com/elvio/guri","last_synced_at":"2026-02-21T01:05:06.760Z","repository":{"id":57503934,"uuid":"49218060","full_name":"elvio/guri","owner":"elvio","description":"Guri - Slackbot command handler powered by Elixir","archived":false,"fork":false,"pushed_at":"2016-01-12T16:39:28.000Z","size":35,"stargazers_count":21,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-12T03:42:24.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elvio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-07T17:03:02.000Z","updated_at":"2023-11-03T09:05:36.000Z","dependencies_parsed_at":"2022-09-13T08:31:20.487Z","dependency_job_id":null,"html_url":"https://github.com/elvio/guri","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elvio/guri","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elvio%2Fguri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elvio%2Fguri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elvio%2Fguri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elvio%2Fguri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elvio","download_url":"https://codeload.github.com/elvio/guri/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elvio%2Fguri/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29669896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"ssl_error","status_checked_at":"2026-02-20T23:52:33.807Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-08-01T02:00:36.004Z","updated_at":"2026-02-21T01:05:06.720Z","avatar_url":"https://github.com/elvio.png","language":"Elixir","funding_links":[],"categories":["Chatting"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/elvio/guri.svg?branch=master)](https://travis-ci.org/elvio/guri)\n\nGuri\n========\n\nGuri was created to automate tasks and let people know about what's happening. It is a bot system that uses chat messages as commands. You can easily write command handlers to automate anything you want. Nice things you can automate (but not limited to):\n\n* Deploy a project to a specific environment (e.g. production, staging)\n* Scale a specific environment up/down\n* Enable or Disable features (feature toggle)\n* Create/close a Github issue\n\nGuri is not only limited to command handling. It can also be used to automatically post useful information to a chat room.\n\nUsage\n-----\n\nAdd Guri to your `mix.exs` dependencies:\n\n```elixir\ndefp deps do\n  [{:guri, \"~\u003e 0.2.1\"}]\nend\n```\n\nAdd Guri to your `mix.exs` applications:\n\n```elixir\ndef application do\n  [applications: [:guri]]\nend\n```\n\nAnd run:\n\n```\nmix deps.get\n```\n\n### Configuration\n\nIn your `config/config.exs` add the following config:\n```elixir\n\n# Bot adapter (currently only Slack is supported)\nconfig :guri, :adapter, Guri.Adapters.Slack\n\n# Configure your Slack bot\nconfig :guri, :slack,\n  bot_name: \"BOT_NAME\", # the one you created in Slack\n  channel_name: \"CHANNEL_NAME\", # the name of the channel the bot is in\n  url: \"https://slack.com/api\",\n  token: \"TOKEN\" # Token from Slack (e.g.: abced-00000000-AASDADzxczxcasd)\n\n# Command Handlers you want to use\n#\n# MyApp.Deploy is a supervised handler\n# MyApp.Stat is a non-supervised handler\n#\nconfig :guri, :handlers, %{\"deploy\" =\u003e {:supervised, MyApp.Deploy},\n                           \"stat\"   =\u003e MyApp.Stat}\n```\n\nWith the described configuration, every time someone sends a `deploy` command, `MyApp.Deploy` will receive the command information. The same happens to the `stat` command and `MyApp.Stat` module.\n\n### Command Handlers\n\nCommand handlers are responsible for processing the commands published in a chat room. Using the previous example, `MyApp.Deploy` and `MyApp.Stat` are command handlers. Each command handler is able to handle a single command. A handler can be of two types:\n\n#### Supervised\n\nSupervised handlers need to keep state. You will probably use an `Agent` or `GenServer` in order to keep the state. These handlers will be started as part of the application supervision three. When defining the handler in the `config.exs` file, it uses a tuple like `{:supervised, MODULE_NAME}`.\n\nExample of `MyApp.Deploy` handler:\n\n```elixir\ndefmodule MyApp.Deploy do\n  use Guri.Handler\n\n  def start_link do\n    Agent.start_link(fn -\u003e [] end, name: __MODULE__)\n  end\n\n  def handle_command(%{name: \"deploy\", args: []}) do\n    send_message(\"Deploying all projects to production\")\n  end\n  def handle_command(%{name: \"deploy\", args: [project]}) do\n    send_message(\"Deploying `#{project}` to production\")\n  end\n  def handle_command(%{name: \"deploy\", args: [project, \"to\", env]}) do\n    send_message(\"Deploying `#{project}` to `#{env}`\")\n  end\n  def handle_command(_) do\n    send_message(\"Sorry, I couldn't understand what you want to deploy\")\n  end\nend\n```\n\n#### Non-Supervised\n\nNon-Supervised handlers don't need to keep state. They are just simple modules.\n\nExample of `MyApp.Stat` handler:\n\n```elixir\ndefmodule MyApp.Stat do\n  use Guri.Handler\n\n  def handle_command(%{name: \"stat\", args: []}) do\n    stats = StatService.get_and_process_stats()\n    send_message(stats)\n  end\n  def handle_command(_) do\n    send_message(\"Sorry, I couldn't understand the stat you are looking for\")\n  end\nend\n```\n\n### Run Test\n\n```\nmix test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felvio%2Fguri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felvio%2Fguri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felvio%2Fguri/lists"}