{"id":16906444,"url":"https://github.com/arjunmahishi/chatops","last_synced_at":"2025-04-11T15:26:01.094Z","repository":{"id":84185383,"uuid":"185845718","full_name":"arjunmahishi/chatops","owner":"arjunmahishi","description":"Chatops is a chatbot framework which integrates with google hangouts chat and helps automate a lot of ops.","archived":false,"fork":false,"pushed_at":"2020-01-25T11:11:40.000Z","size":37,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T15:25:54.165Z","etag":null,"topics":["automation","chatbot","framework","golang","hangouts-chat"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arjunmahishi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-09T17:43:17.000Z","updated_at":"2025-02-26T04:45:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb33a58e-a84c-4e2d-8d47-e661bc04b154","html_url":"https://github.com/arjunmahishi/chatops","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunmahishi%2Fchatops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunmahishi%2Fchatops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunmahishi%2Fchatops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunmahishi%2Fchatops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arjunmahishi","download_url":"https://codeload.github.com/arjunmahishi/chatops/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248429759,"owners_count":21101891,"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":["automation","chatbot","framework","golang","hangouts-chat"],"created_at":"2024-10-13T18:42:38.139Z","updated_at":"2025-04-11T15:26:01.080Z","avatar_url":"https://github.com/arjunmahishi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chatops\nChatops is a chatbot which integrates with google hangouts chat and helps automate a lot of ops. It currently does not interpret natural langauge. So, the interaction happens through a limited set of *commands/statements*\n\n## What it can do\nIt is capable of executing commands/scripts based on a user's message. You can use `help` to get all the available commands and how to use them.\n\n## How it works\n\n- When a user messages the bot on hangouts, hangouts will make a post requests to chatops service with the message and other details. \n- Chatops will try to match the message with the defined set of regex strings. \n- Each regex string is tied to a command/script. \n- If the regex matches the message the user sent, the tied command/script will be executed. \n- The output of the command/script will be sent to the same user (async).\n- These regex strings are stored in a file called `commands.json`. This file will be read only once, when the service starts.\n\n## Installation\n\n#### Download pre-built binary\n\nDownload the latest pre-built binary for your platform from the [release page](https://github.com/arjunmahishi/chatops/).\n\n#### Build from source\n\n- Clone repository\n- Install dependencies\n    ```\n    $ go get -d\n    ```\n- Build the binary\n    ```\n    $ go install\n    ```\n\n## Get started\n\n- Create a `commands.json` file with the following format\n    ```\n    {\n        \"commands\": [\n            {\n                \"name\": \"command11\",\n                \"command\": \"echo 'hello world from command 1'\",\n                \"regex\": \"^test-command-1$\"\n            },\n            {\n                \"name\": \"command-2\",\n                \"command\": \"echo 'hello world from command 2'\",\n                \"regex\": \"^test-command-2$\"\n            }\n        ]\n    }\n    ```\n- Each command can be of the following variation\n    ```\n    // Command that runs on a remote machine \n    {\n        \"name\": \"command-name\",\n        \"hostname\": \"\u003cip address\u003e\",\n        \"command\": \"\u003cshell command\u003e\",\n        \"regex\": \"^The text that triggers this command$\",\n        \"example\": \"\u003cexample usage\u003e\"\n    }\n\n    // Command that runs locally\n    {\n        \"name\": \"command-name\",\n        \"command\": \"\u003cshell command\u003e\",\n        \"regex\": \"^The text that triggers this command$\",\n        \"example\": \"\u003cexample usage\u003e\"\n    }\n\n    // Command that takes an arguement\n    {\n        \"name\": \"command-name\",\n        \"command\": \"command {{arg1}} {{arg2}}\",\n        \"regex\": \"^text with (?P\u003carg1\u003e\\\\S+) (?P\u003carg2\u003e\\\\S+)$\",\n        \"example\": \"text with 1 2\"\n    }\n    ```\n- Create a `config.json` file with the following details\n    ```\n    {\n        \"BotName\": \"\u003cbot name\u003e\",\n        \"HangoutsToken\": \"\u003changouts chat varification token\u003e\",\n        \"DialogFlowAccessToken\": \"\u003cdialogflow access token\u003e\",\n        \"CommandsPath\": \"\u003cpath to commands.json\u003e\",\n        \"ServiceAccountCredsPath\": \"\u003cpath to google service account credentials file\u003e\"\n    }\n    ```\n- Run the binary file \n    ```\n    $ chatops -config path_to_config.json\n    ```\n\n    The server should start. The output would look something like this\n    ```\n    $ chatops -config path_to_config.json                                                                                \n    2019/05/09 23:03:19 Syncing commands list\n    2019/05/09 23:03:19 Total commands 1\n    ⇨ http server started on [::]:1323\n    ```\n- Now, go to google developer console and configure the hangouts chat API to hit this server. \n\n\n## Contributing\nNo guidelines yet. Just make a PR.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjunmahishi%2Fchatops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farjunmahishi%2Fchatops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjunmahishi%2Fchatops/lists"}