{"id":24199833,"url":"https://github.com/ksysoev/wsget","last_synced_at":"2025-09-21T23:32:19.555Z","repository":{"id":188203422,"uuid":"678289202","full_name":"ksysoev/wsget","owner":"ksysoev","description":"CLI client for WebSocket ","archived":false,"fork":false,"pushed_at":"2024-12-19T12:48:11.000Z","size":558,"stargazers_count":9,"open_issues_count":9,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-19T13:21:30.776Z","etag":null,"topics":["cli","client","websocket","websocketapi","wsget"],"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/ksysoev.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":"2023-08-14T07:52:38.000Z","updated_at":"2024-12-17T14:05:00.000Z","dependencies_parsed_at":"2023-10-16T22:24:07.382Z","dependency_job_id":"5da72e09-a320-46e5-976d-15cf96d13cb6","html_url":"https://github.com/ksysoev/wsget","commit_stats":null,"previous_names":["ksysoev/wsget"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksysoev%2Fwsget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksysoev%2Fwsget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksysoev%2Fwsget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksysoev%2Fwsget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksysoev","download_url":"https://codeload.github.com/ksysoev/wsget/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233807443,"owners_count":18733381,"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":["cli","client","websocket","websocketapi","wsget"],"created_at":"2025-01-13T20:39:13.628Z","updated_at":"2025-09-21T23:32:14.267Z","avatar_url":"https://github.com/ksysoev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wsget\n\n[![Tests](https://github.com/ksysoev/wsget/actions/workflows/main.yml/badge.svg)](https://github.com/ksysoev/wsget/actions/workflows/main.yml)\n[![codecov](https://codecov.io/gh/ksysoev/wsget/graph/badge.svg?token=JKPRCA5SSV)](https://codecov.io/gh/ksysoev/wsget)\n[![Go Report Card](https://goreportcard.com/badge/github.com/ksysoev/wsget)](https://goreportcard.com/report/github.com/ksysoev/wsget)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nwsget is a command-line tool for interacting with a WebSocket server. It supports plain text and JSON messages and can save the output of the session into a file.\n\n## Installation\n\n### Downloading binaries:\n\nCompiled executables can be downloaded from [here](https://github.com/ksysoev/wsget/releases).\n\n### Install from source code:\n\n```\ngo install github.com/ksysoev/wsget/cmd/wsget@latest\n```\n\n### Install with homebrew:\n\n```\nbrew tap ksysoev/wsget\nbrew install wsget\n```\n\n## Usage\n\nTo use wsget, you need to specify the WebSocket URL:\n\n```\nwsget wss://ws.postman-echo.com/raw\n```\n\n\nYou also can pass the initial request as part command line argument by using flag -r\n\n```\nwsget wss://ws.postman-echo.com/raw -r \"Hello world!\"\n```\n\n\nBy default, wsget will print the data received from the WebSocket server only to the console. You can also save the data to a file using the -o flag:\n\n```\nwsget wss://ws.postman-echo.com/raw  -o output.txt\n```\n\nExample:\n\n```\nwsget \"wss://ws.derivws.com/websockets/v3?app_id=1\" -r '{\"time\":1}'\nUse Enter to input request and send it, Ctrl+C to exit\n-\u003e\n{\n  \"time\": 1\n}\n\u003c-\n{\n  \"echo_req\": {\n    \"time\": 1\n  },\n  \"msg_type\": \"time\",\n  \"time\": 1698555261\n}\n```\n\n## Connection Mode Keyboard Shortcuts Documentation\n\n| Key/Combination | Action |\n| --- |---|\n| **Esc** / **Ctrl + C** / **Ctrl + D** | Discconnect from the server. |\n| **Enter** | Enter request editing mode. |\n| **Ctrl + L** | Clear the terminal and redisplay the welcome message. |\n| **:** | Enter command mode to execute a specific command. |\n\n\n## Request/Command Editor Mode Keyboard Shortcuts\n\n### General Navigation and Editing Shortcuts\n\n| Key/Combination | Action |\n| --- |---|\n| **Left Arrow** | Move the cursor one position to the left. |\n| **Right Arrow** | Move the cursor one position to the right. |\n| **Space** | Insert a space character at the current cursor position. |\n| **Enter** | Adds a newline or completes editing (depends on editor mode). |\n| **Backspace** | Remove the character before the cursor. |\n| **Delete** | Remove the character after the cursor. |\n\n### Advanced Navigation\n\n| Key/Combination | Action |\n|---| --- |\n| **Alt + Backspace** | Delete the word to the left of the cursor. |\n| **Alt + Left Arrow** | Move the cursor to the start of the previous word. |\n| **Alt + Right Arrow** | Move the cursor to the start of the next word. |\n| **Alt + Delete** | Delete the word to the right of the cursor. |\n| **Home** | Move the cursor to the start of the line. |\n| **End** | Move the cursor to the end of the line. |\n\n### Content Modification\n\n| Key/Combination | Action |\n| --- | --- |\n| **Ctrl + U** | Clear all content from the editor. |\n| **Ctrl + L** | Clear the terminal's display while retaining content and positioning. |\n\n### History Navigation\n\n| Key/Combination | Action |\n| --- | --- |\n| **Up Arrow** | Cycle to the previous request in history. |\n| **Down Arrow** | Cycle to the next request in history. |\n\n### Miscellaneous Shortcuts\n\n| Key/Combination | Action |\n|---| --- |\n| **Ctrl + S** | Complete editing. |\n| **Ctrl + C** or **Ctrl + D** or **Esc** | Interrupt the editing process; cancel and terminate editing. |\n\n## Macros\n\n`wsget` provides a possibility for customization. You can create your sets of macros with a configuration file. the file should be located at `~/wsget/macro/your_configuration.yaml`. `wsget` will read all files from this directory and use only configuration files that match the WebSocket connection hostname.\n\n```yaml\nversion: \"1\"\ndomains:\n    - example.com\nmacro:\n    ping:\n        - |-\n          send {\n              \"ping\": 1,\n          }\n        - wait 5\n```\n\n### Primitive commands\n\n- `edit {\"ping\": 1}` opens request editor with provided text\n- `send {\"ping\": 1}` sends requests to WebSocket connection\n- `wait 5` waits for responses or provided time out, whatever comes first. If the timeout is reached then an error will be returned. if `0` is provided command will wait response without a time limit\n- `exit` interrupts the program execution\n- `repeat 5 send {\"ping\": 1}` repeat provided command or macro defined number of times\n- `sleep 1` sleeps for the provided number of seconds\n\n### Macros arguments\n\nMacro support [Go template language](https://pkg.go.dev/text/template). It provides a possibility to pass arguments to your macro command and substitute or adjust the behavior of your macro commands.\n\n```\nversion: \"1\"\ndomains:\n    - example.com\nmacro:\n    authorize:\n        - |-\n          send {\n              \"authorize\": \"{{index .Args 0}}\",\n          }\n        - wait 2\n```\n\n### Macros presets\n\n- [Deriv API](https://github.com/ksysoev/wsget-deriv-api)\n\n## License\n\nwsget is licensed under the MIT License. See the LICENSE file for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksysoev%2Fwsget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksysoev%2Fwsget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksysoev%2Fwsget/lists"}