{"id":18485869,"url":"https://github.com/720kb/butler","last_synced_at":"2025-04-08T19:32:57.793Z","repository":{"id":34534977,"uuid":"38478226","full_name":"720kb/butler","owner":"720kb","description":"I/O customizable voice driven butler - http://720kb.github.io/butler/","archived":false,"fork":false,"pushed_at":"2017-03-23T09:34:06.000Z","size":293,"stargazers_count":88,"open_issues_count":7,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-23T17:45:50.465Z","etag":null,"topics":["audio","commands","dom","javascript","tasks","voice","voice-commands"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/720kb.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":"2015-07-03T07:11:25.000Z","updated_at":"2025-03-21T19:15:34.000Z","dependencies_parsed_at":"2022-09-01T00:52:11.591Z","dependency_job_id":null,"html_url":"https://github.com/720kb/butler","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/720kb%2Fbutler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/720kb%2Fbutler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/720kb%2Fbutler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/720kb%2Fbutler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/720kb","download_url":"https://codeload.github.com/720kb/butler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247912789,"owners_count":21017045,"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":["audio","commands","dom","javascript","tasks","voice","voice-commands"],"created_at":"2024-11-06T12:46:52.654Z","updated_at":"2025-04-08T19:32:57.418Z","avatar_url":"https://github.com/720kb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cbr\u003e\n\n![Butler.js](http://i.imgur.com/75NI4tj.jpg)\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003e\u003ca href=\"#installation\"\u003eInstallation \u003c/a\u003e\u003c/b\u003e \u0026nbsp; \n  |\n  \u0026nbsp; \u003cb\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/b\u003e\u0026nbsp; \n  |\n  \u0026nbsp; \u003cb\u003e\u003ca href=\"#-commands\"\u003eCommands\u003c/a\u003e\u003c/b\u003e\u0026nbsp; \n  |\n  \u0026nbsp; \u003cb\u003e\u003ca href=\"#i18n\"\u003eLangs\u003c/a\u003e\u003c/b\u003e\u0026nbsp; \n  |\n  \u0026nbsp; \u003cb\u003e\u003ca href=\"#plugins\"\u003ePlugins\u003c/a\u003e\u003c/b\u003e\u0026nbsp; \n  |\n  \u0026nbsp; \u003cb\u003e\u003ca href=\"#browser-support\"\u003eBrowser support\u003c/a\u003e\u003c/b\u003e\n\u003c/p\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n# What is Butler?\n\n**Butler.js** is the voice driven, portable butler for your personal needs.\n\nYou can easily customize it to your needs and he will never betray you.\n\nButler is developed with the aim of making life simpler for developers and designers, specifically  in debugging/drafting.\n\nWhat you would have done before through the keyboard and scripts can now be done by commanding Butler by voice.\n\nWith a bit of healthy humor and fun.\n\n\nButler.js is developed by [720kb](http://720kb.net).\n\n[![Join the chat at https://gitter.im/720kb/butler](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/720kb/butler?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n### Why Butler?\n\nMany libraries offer the possibility to activate voice commands, Butler offers the same but it starts with already defined commands that can help you debugging or anyway to have fun while debugging and make your life simpler in the browser daily routine.\n\nPlus you have the ability to write your own [plugins](https://github.com/720kb/butler#plugins) (and this is very easy) to expand the abilities of Butler at your leisure.\n\n### Installation\n\n#### HTML\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"../path/to/butler.min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n```\n#### Bower\n```bash\nbower install butler.js\n```\n\n#### npm\n```bash\nnpm install butler.js\n```\n\n### Usage\n```javascript\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n  Butler.start();\n});\n```\n### Demo\n\n[Live demo](http://720kb.github.io/butler/)\n\n### \u003cimg src=\"http://i.imgur.com/1p126e1.png\" valign=\"text-top\" width=\"25\"/\u003e Commands\nDefault voice commands you can abuse of. (many others are coming...)\n\n#### Butler\nCommon commands for Butler\n\nCommand  | Result\n------------- | -------------\n_Butler speak_ | Turn on Butler voice\n_Butler silence_ | Turn off Butler voice\n\n#### Selector\nCommands to select, visualize and manipulate the DOM elements\n\nCommand  | Result\n------------- | -------------\n _Selector on_  | Turn on selector highlighter\n _Selector off_ | Turn off selector highlighter\n _Selector next_  | Select next element in the DOM\n _Selector back_  | Select previous element in the DOM\n _Selector next id :detection:_  | Select next element in the DOM by detected id value\n _Selector next class :detection:_  | Select next element in the DOM by detected class name\n _Selector next tag :detection:_  | Select next element by detected tag name\n _Selector back id :detection:_  | Select previous element by detected id value\n _Selector back class :detection:_  | Select next element by detected class name\n _Selector back tag :detection:_  | Select next element by detected tag name\n _Selector add class :detection:_  | Add detected class name to the current selected DOM element\n _Selector remove class :detection:_  | Remove detected class name from the current selected DOM element\n _Selector add id :detection:_  | Add detected id value to the current selected DOM element\n _Selector put value :detection:_  | Add detected value to the current selected DOM element (helpful for inputs)\n _Selector insert text :detection:_  | Insert detected text inside the current selected DOM element\n _Selector empty text_  | Remove all the text from the current selected DOM element\n _Selector copy text_  | Copy all the text from the current selected DOM element\n _Selector paste text_  | Paste the previously copied text to the current selected DOM element\n _Selector make editable_  | Make the current selected DOM element editable\n _Selector not editable_  | Make the current selected DOM element not editable\n _Selector make disabled_  | Make the current selected DOM element disabled\n _Selector not disabled_  | Make the current selected DOM element not disabled\n _Selector clone_  | Clone the current selected DOM element\n _Selector append clone_  | Append the cloned element to the current selected DOM element\n _Selector prepend clone_  | Prepend the cloned element to the current selected DOM element\n _Selector delete_  | Delete the current selected DOM element\n _Selector hide_  | Hide the current selected DOM element\n _Selector show_  | Show the current selected DOM element\n _Selector let me choose_  |  Select yourself which DOM element by clicking the element\n _Selector which_  | Show and alert the current selected DOM element informations\n\n#### Trigger\n\nCommands to trigger events and actions\n\nCommand  | Result\n------------- | -------------\n _Trigger click_  | Trigger click on the current selected DOM element\n _Trigger focus_  | Trigger focus on the current selected DOM element\n _Trigger fade_  | Trigger fade on the current selected DOM element\n _Trigger pin_  | Trigger pin on the current selected DOM element\n _Trigger blur_  | Trigger blur on the current selected DOM element\n _Trigger submit_  | Trigger submit on the current selected DOM element\n _Trigger select_  | Trigger select on the current selected DOM element\n _Trigger change_  | Trigger change on the current selected DOM element\n _Trigger show_  | Trigger show on the current selected DOM element\n _Trigger reset_  | Trigger reset on the current selected DOM element\n _Trigger play_  | Trigger play on the current selected DOM element\n _Trigger pause_  | Trigger play on the current selected DOM element\n _Trigger mouse over_  | Trigger mouseover on the current selected DOM element\n _Trigger mouse up_  | Trigger mouseup on the current selected DOM element\n _Trigger mouse down_  | Trigger mousedown on the current selected DOM element\n _Trigger mouse leave_  | Trigger mouseover on the current selected DOM element\n _Trigger mouse move_  | Trigger mousemove on the current selected DOM element\n _Trigger mouse enter_  | Trigger mouseenter on the current selected DOM element\n _Trigger mouse out_  | Trigger mouseout on the current selected DOM element\n _Trigger drag_  | Trigger drag on the current selected DOM element\n _Trigger drag start_  | Trigger dragstart on the current selected DOM element\n _Trigger drag end_  | Trigger dragend on the current selected DOM element\n _Trigger drag enter_  | Trigger dragenter on the current selected DOM element\n _Trigger drag leave_  | Trigger dragleave on the current selected DOM element\n _Trigger drag over_  | Trigger dragmove on the current selected DOM element\n _Trigger drop_  | Trigger drop on the current selected DOM element\n _Trigger touch start_  | Trigger touchstart on the current selected DOM element\n _Trigger touch end_  | Trigger touchend on the current selected DOM element\n _Trigger touch enter_  | Trigger touchenter on the current selected DOM element\n _Trigger touch leave_  | Trigger touchleave on the current selected DOM element\n _Trigger touch move_  | Trigger touchmove on the current selected DOM element\n _Trigger touch cancel_  | Trigger touchcancel on the current selected DOM element\n _Trigger scroll y_  | Trigger Y scroll on the current selected DOM element\n _Trigger scroll x_  | Trigger X scroll on the current selected DOM element\n\n#### Window\n\nCommands to manipulate, trigger ```window``` events and actions\n\nCommand  | Result\n------------- | -------------\n _Window scroll y_  | Trigger window Y scroll\n _Window scroll x_  | Trigger window X scroll\n _Window size_  | Alert window dimensions\n\n#### Location\nCommands to manipulate, navigate urls and history\n\nCommand  | Result\n------------- | -------------\n _Location refresh_  | Location refresh\n _Location back_  | Go to previous location url\n _Location forward_  | Go to next location url\n _Location hashbang_  | Add hashbang at the end of the location url\n \n \n#### Navigator\n\nCommands to manipulate, trigger ```window.navigator```\n\nCommand  | Result\n------------- | -------------\n _Navigator go online_  | Set online status\n _Navigator go offline_  | Set offline status\n _Navigator vibrate_  | Vibrate device\n _Navigator which_  | Show and alert navigator informations\n\n#### Browser\n\nCommands to manipulate and interact with the browser\n\nCommand  | Result\n------------- | -------------\n _Browser clean cookies_  | Clean browser cookies\n _Browser clean session storage_  | Clean browser session storage\n _Browser clean local storage_  | Clean browser local storage\n \n\n### i18n\nButler can be used in various languages [available here](https://github.com/720kb/butler/tree/master/src/js/i18n) (Soon there will be more languages)\n\nIf you want Butler to understand italian language for example, just include the i18n italian file after butler main file:\n\n```html\n\u003cscript src=\"butler.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"butler.it_IT.js\"\u003e\u003c/script\u003e\n```\n\nThis way all the default commands gets translated to italian, you can check translations for each i18n file  from their [README](https://github.com/720kb/butler/blob/master/src/js/i18n/it/README.md) file\n\n### Tools\nButler exposes some good stuff you can interact with.\n\nYou can check them all by:\n```javascript\nwindow.console.info(Butler);\n```\n#### Butler.Highlighter\nHighlighter is the Butler selector (taken from [Highlighter.js](https://github.com/720kb/highlighter.js)), is the DOM surfer who take trace of the selected and current elements.\n\n```javascript\nwindow.console.info('Which element are you on Butler?', Butler.Highlighter.element);\n```\n#### Butler.Clipboard\nClipboard is where Butler saves the last copied text and/or cloned element.\n```javascript\nwindow.console.info('What you copied or cloned Butler?', Butler.Clipboard);\n```\n#### Butler.Voice\nVoice is the Butler voice, simple.\n```javascript\nButler.Voice.volume = 0.5;\nButler.Voice.play();\n```\n#### Butler.Commands\nCommands is the Object containing all the default Butler voice commands.\n\n```javascript\nwindow.console.info('Which commands do you know Butler?', Butler.Commands);\n```\n\nIf you need some of [them](https://github.com/720kb/butler#-commands) to be run just do:\n\n```javascript\nvar ButlerCommand = Butler.Commands['selector on'];\nButlerCommand();\n```\n\n### Events\nAvailable events\n```javascript\ndocument.addEventListner('Butler:start', function (data) {\n\tconsole.info('Butler is started and microfone is allowed', data);\n});\n\ndocument.addEventListner('Butler:end', function (data) {\n\tconsole.info('Butler has stopped working', data);\n});\n\ndocument.addEventListner('Butler:detection', function (data) {\n\tconsole.info('Butler has new detections', data);\n});\n\ndocument.addEventListner('Butler:detection-match', function (data) {\n\tconsole.log('Butler detection is matching', data);\n});\n\ndocument.addEventListner('Butler:detection-not-match', function (data) {\n\tconsole.log('Butler detection is not matching', data);\n});\n\ndocument.addEventListner('Butler:error', function (error) {\n\tconsole.error('Butler returned an error', error);\n});\n```\n\n### Plugins\nWriting a plugin is very simple, all you have to do is to define new commands using the ```plug()``` method.\n\n_If you want to access Butler tools have a look [here](https://github.com/720kb/butler#tools)_\n\n**Example**\n\n\n_butler.plugin.js_\n```javascript\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n   Butler.plug({\n    'do something when i say this sentence': function callback(){\n       window.alert('You said that sentence');\n    }\n  });\n});\n```\n_index.html_\n```html\n\u003chead\u003e\n\u003cscript src=\"butler.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"butler.plugin.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n  Butler.start();\n});\n\u003c/script\u003e\n\u003c/head\u003e\n```\nNow all the _butler.plugin.js_ defined commands and callbacks are plugged and can be used.\n\n#### Plugin commands\nPlease refer to [annyang](https://github.com/TalAter/annyang/blob/master/docs/README.md#commands-object) documentation to define new commands\n\n### Debug\nEnable debug mode\n```javascript\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n  Butler.start({\n   'debug':true\n  });\n});\n```\n### Browser Support\n\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Google_Chrome_icon_(2011).svg/1024px-Google_Chrome_icon_(2011).svg.png\" width=\"50\"/\u003e\n\nGoogle Chrome (latest versions)\n\nhttp://caniuse.com/#feat=web-speech\n\n### Contributing\n\nWe would be pleased if you help to develop and grow the project more and more.\n\nThe goal is to make the life of programmers and designers more simple and fun, so any suggestion, PR, and specially plugin is welcome and appreciated a lot.\n\nThank you.\n\n### License\nThe MIT License (MIT)\n\nCopyright (c) 2015 Filippo Oretti, Dario Andrei\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n#### Gtk\n- Not ready for a production project\n- Default [commands](https://github.com/720kb/butler#-commands) may be changed or modified at any time, others will come soon\n- The Speech Detection is still very slow sometimes, using https:// will be slighty faster\n- If you have multiple tabs working on speech recognition and microphone there will be problems, please use Butler on a single browser tab and close the other tabs that are asking for your microphone \n\n#### Thank you\n- to [Google](google.com) and Google developers, for the awesome webkit-speech API\n- to https://github.com/TalAter/annyang developers and maintainers for the awesome library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F720kb%2Fbutler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F720kb%2Fbutler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F720kb%2Fbutler/lists"}