{"id":37142582,"url":"https://github.com/yasutakatou/opsapi","last_synced_at":"2026-01-14T16:44:06.102Z","repository":{"id":102114775,"uuid":"243778023","full_name":"yasutakatou/opsapi","owner":"yasutakatou","description":"operation automation tool by CLI and REST API. not need environment set up, one binary solution! for Windows and Linux.","archived":false,"fork":false,"pushed_at":"2020-03-12T14:02:37.000Z","size":504,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T16:43:29.374Z","etag":null,"topics":["automation","capture-screenshots","cli","go","rest-api","rpa"],"latest_commit_sha":null,"homepage":"https://github.com/yasutakatou/opsapi","language":"Go","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/yasutakatou.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-28T14:14:02.000Z","updated_at":"2023-08-17T01:15:05.000Z","dependencies_parsed_at":"2023-04-24T23:47:22.502Z","dependency_job_id":null,"html_url":"https://github.com/yasutakatou/opsapi","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/yasutakatou/opsapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasutakatou%2Fopsapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasutakatou%2Fopsapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasutakatou%2Fopsapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasutakatou%2Fopsapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yasutakatou","download_url":"https://codeload.github.com/yasutakatou/opsapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasutakatou%2Fopsapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28426269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"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":["automation","capture-screenshots","cli","go","rest-api","rpa"],"created_at":"2026-01-14T16:44:05.420Z","updated_at":"2026-01-14T16:44:06.095Z","avatar_url":"https://github.com/yasutakatou.png","language":"Go","readme":"\r\n# OpsApi\r\n\r\n **OpsApi** is operation automation tool by *CLI* and *REST API*. not need environment set up, one binary solution! for Windows and Linux.\r\n\r\n![demo](https://github.com/yasutakatou/opsapi/blob/pic/demo.gif)\r\n\r\n## solution\r\n\r\n when you must boring web task(ex meny registration made of checkbox!), or input for monthly bussiness imfomation.\u003cbr\u003e you should many input by human operation. and your team mate same. usual solution are\r\n\r\n - install RPA. and make flow.\r\n - python, ansible, such program language. make operation into code.\r\n - implemented OS Scripts.\r\n\r\nand then, you distribute your way to teammate.\r\n\r\n in my opinion, there are must prepare enviroment, and flexible customize difficulty. moreover must login your OS.\u003cbr\u003e \r\nand Above all, keyboard input can't emulate,and capture operation result easily (you need it, you implement by append code).\u003cbr\u003e\r\n*Is it easy way?*\u003cbr\u003e\r\ndo you want operation share casually? or your absolute trust teammate controlled instead of you?\r\nOpsApi solv it, easily.\r\n\r\n## features\r\n\r\n - keyboard input emulation (same to hardware input)\r\n - automatic capture to picture and can create animetion gif\r\n - implemented by golang, one binary file.\r\n - support HTTPS\r\n - support multi os (Windows or Linux)\r\n\r\n## install\r\n\r\n```\r\ngit clone https://github.com/yasutakatou/opsapi\r\ncd opsapi\r\ngo build .\r\n```\r\n\r\nor download binary from [release page](https://github.com/yasutakatou/opsapi/releases).\u003cbr\u003e\r\nsave binary file, copy to entryed execute path directory.\r\n\r\n\r\n## uninstall\r\n\r\ndelete that binary. del or rm command. (it's simple!)\r\n\r\n## usecase\r\n\r\n**important!**\u003cbr\u003e \r\n in advance, you must decide operations to what do.\u003cbr\u003e\r\n (send text to your application. emulate your keystroke on your web browser. such more)\u003cbr\u003e\r\nif you don't know, cli mode help you. you can test operation  on cli. or liveRecord mode make your operation into code in auto.\u003cbr\u003e\r\ncli mode can use like linux shell. tab interpolation, upper key is history one before, etc. \u003cbr\u003e\r\n\r\n![cli](https://github.com/yasutakatou/opsapi/blob/pic/cli_mode.gif)\r\n\r\nthis tool run example in local. token is test. execute command on our OS for get file lists.\u003cbr\u003e\r\n\r\n```\r\n$ opsapi -token=test \r\n```\r\n\r\nLinux example:\r\n```\r\ncurl -k -H \"Content-type: application/json\" -X POST http://127.0.0.1:8080/ -d '{\"token\":\"test\",\"command\":\"exec\",\"params\":\"ls -la\"}'\r\n```\r\n\r\nWindows example:\r\n```\r\ncurl -k -H \"Content-type: application/json\" -X POST http://127.0.0.1:8080/ -d \"{\\\"token\\\":\\\"test\\\",\\\"command\\\":\\\"exec\\\",\\\"params\\\":\\\"dir\\\"}\"\r\n```\r\n\r\nif tool  run in another server(192.168.0.1) with https. token is customized and more changed port number.\u003cbr\u003e\r\n\r\n```\r\n# opsapi -https -port=18080 -token=custompassword\r\n```\r\n\r\nLinux example:\r\n```\r\ncurl -k -H \"Content-type: application/json\" -X POST https://192.168.0.1:18080/ -d '{\"token\":\"custompassword\",\"command\":\"exec\",\"params\":\"ls -la\"}'\r\n```\r\n\r\nWindows example:\r\n```\r\ncurl -k -H \"Content-type: application/json\" -X POST https://192.168.0.1:18080/ -d \"{\\\"token\\\":\\\"custompassword\\\",\\\"command\\\":\\\"exec\\\",\\\"params\\\":\\\"dir\\\"}\"\r\n```\r\n\r\n### if you upload or download file, can use \"upload\" or \"download\" api.\r\n\r\n*note: two api not use json. use form format.*\r\n\r\nin case of you upload text.txt to target server, follow.\r\nname is file name of upload file into target server, file is data to be uploaded file.\r\n\r\nWindows example:\r\n```\r\ncurl -F token=test -F name=test.txt -F file=@test.txt  http://127.0.0.1:8080/upload\r\n```\r\n\r\n*note: you must spec \"@\" ago file name.*\r\n\r\nin case of you download text.txt, follow.\r\nname is file name of download file from target server, after -o is file name into download data.\r\n\r\nWindows example:\r\n```\r\ncurl -F token=test -F name=test.txt http://127.0.0.1:8080/download -o test.txt\r\n```\r\n\r\n## boot parameters\r\n\r\n```\r\nopsapi -h : display help \r\n```\r\n\r\n|option name|default value|detail|\r\n|:---|:---|:---|\r\n|https|false|https mode (true is enable)|\r\n|debug|false|debug mode (true is enable)|\r\n|token|(random)|authentication token (if this value is null, is set random)|\r\n|port|8080|port number|\r\n|cert|./localhost.pem|ssl_certificate file path (if you don't use https, haven't to use this option)|\r\n|key|./localhost-key.pem|ssl_certificate_key file path (if you don't use https, haven't to use this option)|\r\n|import|(empty)|import your operation history (must formated tsv)|\r\n|cli|false|cli mode for recording operation (true is enable)|\r\n|vcs|/dev/vcs1|set target vcs(Linux only. use to teminal capture)|\r\n\t\r\n*note: if you want to use https, you prepare cert file beforehand. (use mkcert and such more)*\r\n\r\n## functions\r\n\r\nfunctions is almost supported Windows and Linux. but, \"liveRecord\" \"AnimetionGIF\" and \"titles\" are only do Windows.\u003cbr\u003e\r\n\r\n### \"configGet\":\r\n view current config. argument isn't need.\r\n\r\n### \"configSet\":\r\n config value change. you can set value one by one. format is left(option name)=right(value).\r\n each value detail are [\"config\" reference](https://github.com/yasutakatou/opsapi#config).\r\n\r\n### \"ops\":\r\n keyboard emulation. argument is input strings by keyboard.\u003cbr\u003e\r\n \r\n*note: in what Windows, keyboard emulate on target window. in what Linux,  keyboard emulate on terminal console (/dev/ttyX such). therefore, must permted permisson to /dev/ttyX.*\r\n\r\nexample) [ops test] (keyboard emulaton to your terminal. input \"test\")\u003cbr\u003e\r\n*note: when running cli mode. and when your inputs aren't functions. your inputs are treat to \"ops\".*\u003cbr\u003e\r\n\r\n special define.\u003cbr\u003e\r\n\r\n|strings|detail|\r\n|:---|:---|\r\n|ctrl+|ctrl key push at same time. example [ops ctrl+s] = ctrl\u0026s|\r\n|alt+|alt key push at same time. example [ops alt+a] = ctrl\u0026a|\r\n|\\\\\\\\n|enter, newline|\r\n|\\\\\\\\\\ |backslash|\r\n|\\\\\\\\b|backspace|\r\n|\\\\\\\\t|tab|\r\n|\\\\\\\\\"|double quote|\r\n\r\nand can use **integer among LiveRawcodeChar value to ascii code emulate**.\r\nexample [\\\\\\\\\\~38\\~; \\\\\\\\\\~38\\~] \u003cbr\u003e\r\nin case of LiveRawcodeChar value is \"~\"(default).input are double \"↑\". \u003cbr\u003e\r\n\r\n*note: by what \"SeparateChar\" define, strings can input Continuously.*\u003cbr\u003e\r\nexample [hoge; \\\\n ; wait10; fuga] -\u003e input are \"hoge\" , newline , (10 second waits), \"fuga\"\u003cbr\u003e\r\nwaitXX is embedded sleep function. program waits xx integer second. \r\n\r\n### \"exec\":\r\n execute os command. argument is os command.\r\n\r\n### \"capture\":\r\n capture from target. argument is os file name. but, must exclude extension. \u003cbr\u003e\r\nif omit argument, filename is current year-month-days-hour-minits. example: now  2020/03/01 22:08 -\u003e 2020-03-01-22-08\u003cbr\u003e\r\n*note: in case of Windows capturing is picture. (PNG format) in case of Linux capturing is text. (/dev/vcs device export)*\r\n\r\n### \"titles\": (Windows Only)\r\n view running window title and handle id.\u003cbr\u003e\r\nexample) \"Google - Google Chrome : 4080c\",\u003cbr\u003e\r\nwindow title: \"Google - Google Chrome\" handle id: \"4080c\"\r\n\r\n### \"AnimetionGif\": (Windows Only)\r\n 1st time: starting capture. 2nd time: capturing stop, and create file.\u003cbr\u003e\r\nargument is os file name. but, must exclude extension. \u003cbr\u003e\r\n*note: if you capture long time, your pc maybe memory depletion.*\u003cbr\u003e\r\nif omit argument, filename is current year-month-days-hour-minits. example: now  2020/03/01 22:08 -\u003e 2020-03-01-22-08. \r\n\r\n### \"clearHistory\": (CLI only)\r\n history is cleared\r\n\r\n### \"deleteHistory\": (CLI only)\r\n delete history one or more. argumet is single integer or use \"-\" range integer value.\u003cbr\u003e\r\nexample)\r\n```\r\n[  1] Command:        ops Params: test\r\n[  2] Command:        ops Params: \\n\r\n[  3] Command:        ops Params: input\r\n```\r\nif you want delete \"\\n\", you input [deleteHistory 2]\u003cbr\u003e\r\nif you want delete \"test\" and \"\\n\", you input [deleteHistory 1-2]\r\n\r\n### \"displayHistory\": (CLI only)\r\n view current history for cli. argument isn't need. \r\n\r\n### \"exportHistory\": (CLI only)\r\n export current history. argument is two type. \u003cbr\u003e\r\n 1st: export format. 2nd: file name. (two arguments can omit.) \u003cbr\u003e\r\nexport format are \"tsv\" and \"shell\". if you set \"tsv\", your history export to tab spread value format.\u003cbr\u003e\r\nif you set \"shell\", your history export to custom format. \"ExportFormat\" in cli option can set custom format.\u003cbr\u003e\r\nif omit file name argument, filename is current year-month-days-hour-minits. \u003cbr\u003e\r\nalso export format is tsv by default. example: now  2020/03/01 22:08 -\u003e 2020-03-01-22-08. \r\n\r\nexample) \u003cbr\u003e\r\nin case of  export format is \"tsv\", and file name is \"test.txt\". you set [exportHistory tsv test.txt].\r\n\r\n### \"importHistory\": (CLI only)\r\n import of exported history file before. argument is filename. also, file format must be \"tsv\".\u003cbr\u003e\r\n*note: when you run now history is all delete.*\r\n\r\n### \"insertHistory\": (CLI only)\r\n insert one by one history into now historys. argument is three type. \u003cbr\u003e\r\n 1st: insert place 2nd: api name 3rd: api value. (three arguments can't omit every.)\u003cbr\u003e\r\n\r\nexample)\r\n```\r\n[  1] Command:        ops Params: test\r\n[  2] Command:        ops Params: \\n\r\n[  3] Command:        ops Params: input\r\n```\r\nif you want insert tab input before \"\\n\", you input [insertHistory 2 \\\\t]\r\n\r\n### \"liveRecord\": (Windows/CLI only)\r\n when by keyboard operating to target window, operation convert to and add history.\u003cbr\u003e\r\n*note: until what you press ascii code  \"LiveExitAsciiCode\" of cli config, program record your operation. (default is 27[Esc].)*\u003cbr\u003e\r\n\r\n### \"runHistory\": (CLI only)\r\n operation replay along now history.\r\nnote: when \"runHistory\" running, not add history.\r\n\r\n## config\r\n\r\n*note: if space string include, refer following.*\r\n\r\n```\r\n\u003e\u003e\u003e configSet Shebang=\"## space string include example ##\"\r\n```\r\n\r\n### \"Target\" (default: \"Chrome\". exists window title, or handle id.)\r\nif you run \"ops\", keyboard emulation do to application of this value. you can set title of window, or id of handle.\u003cbr\u003e\r\n*note: value can get by \"titles\" function. also, value can set partially included. if not found value, return error.*\u003cbr\u003e\r\n\r\nexample)\r\n\"Google - Google Chrome : 4080c\",\u003cbr\u003e\r\nwindow title: \"Google - Google Chrome\" handle id: \"4080c\"\u003cbr\u003e\r\nif you want to set target this, you input [configSet Target=Chrome] or [configSet Target=4080c].\r\n\r\n### \"AutoCapture\" (default: \"false\". true or false)\r\nthis option, capture target window after \"ops\" every. detail wrote in \"capture\" function above.\u003cbr\u003e\r\n*note: filename is current year-month-days-hour-minits fixed. example: now  2020/03/01 22:08 -\u003e 2020-03-01-22-08. *\u003cbr\u003e\r\nif you want to set true this, you input [configSet AutoCapture=true].\r\n\r\n### \"CapturePath\" (default \"\" [empty] file path.)\r\n can set save path, when you use capturing function.\r\n\r\n### \"SeparateChar\" (default \";\". single character.)\r\nwhen use \"ops\" function, use this value strings can input Continuously.\u003cbr\u003e\r\nexample [hoge; \\\\n ; wait10; fuga] \u003cbr\u003e\r\ninput are \"hoge\" , newline , (10 second waits), \"fuga\"\r\n\r\n### \"LiveRawcodeChar\" (default \"~\". single character.)\r\nwhen use \"ops\" function, can input ascii code among this value.\u003cbr\u003e\r\nabout ascii code, please refer [this site](http://shanabrian.com/web/javascript/keycode.php).\u003cbr\u003e\r\nexample [\\\\\\\\\\~38\\~; \\\\\\\\\\~38\\~] \u003cbr\u003e\r\ninput are double \"↑\".\r\n\r\n### \"ReturnWindow\" (default \"100\". 0 \u003c value \u003c 10000.)\r\n when \"AutoCapture\" is true, wait this value after capture. program waits xx integer milli second. \r\n\r\n### \"AnimationDuration\" (default \"250\". 0 \u003c value \u003c 10000.)\r\n capturing interval. The smaller, the larger the file size. \r\n\r\n### \"AnimationDelay\" (default \"50\". 0 \u003c value \u003c 10000.)\r\n gif animation play delay time. The smaller, the fastest the playing.\r\n\r\n## config for cli\r\n\r\n### \"LiveExitAsciiCode (default \"27\")\r\n\"liveRecord\" function wait this value ascii code for recording exit.\u003cbr\u003e\r\nabout ascii code, please refer [this site](http://shanabrian.com/web/javascript/keycode.php).\r\n\r\n### \"Shebang\"  (default \"\" [empty])\r\nif you use Shebang, set this value.\u003cbr\u003e\r\nexample) Shebang=#!/bin/bash\r\n\r\n### \"ExportFormat\" (default: ```curl -H \\\"Content-type: application/json\\\" -X POST http://127.0.0.1:8080/ -d \\\"{\\\\\\\"token\\\\\\\":\\\\\\\"%1\\\\\\\",\\\\\\\"command\\\\\\\":\\\\\\\"#COMMAND#\\\\\\\",\\\\\\\"params\\\\\\\":\\\\\\\"#PARAMS#\\\\\\\"}\\\"```)\r\n\r\nwhen you export history by shell formatted, convert along this value.\u003cbr\u003e\r\n\r\nexample: **Command: -\u003e #COMMAND#**, **Params: #PARAMS#** replace.\r\ndisplayHistory\r\n```\r\n[  1] Command:        ops Params: test\r\n```\r\nto exportHistory\r\n```\r\ncurl -H \"Content-type: application/json\" -X POST http://127.0.0.1:8080/ -d \"{\\\"token\\\":\\\"%1\\\",\\\"command\\\":\\\"ops\\\",\\\"params\\\":\\\"test\\\"}\"\r\n```\r\n\r\n### \"Record\" (default true. true or false)\r\n if this value is true, record history every inputs. if you want to set true this, you input [configSet Record=true].\r\n\r\n### \"LoopWait\" (defalut \"100\". 0 \u003c value \u003c 10000.)\r\n \"runHistory\" function wait this value every do. program waits xx integer milli second. \r\n\r\n## consideration\r\n\r\n*if more request, I consider to implementation*.\u003cbr\u003e\r\n\r\n - animetion gif is split save, and finally merge to one file.\r\n \r\ntherefore, can more record at long time. I don't know how, append gif data after once save on golang.\u003cbr\u003e\r\nnot impossible to use external command (FFmpeg such more), but I don't like.\u003cbr\u003e\r\n(you must prepare external command, not one binary environment.)\r\n\r\n - see to real time operating screen from remote  client (such use websocket).\r\n\r\nif you do that, I suggest to use RDP, VNC.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyasutakatou%2Fopsapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyasutakatou%2Fopsapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyasutakatou%2Fopsapi/lists"}