{"id":17144998,"url":"https://github.com/mikesposito/glue","last_synced_at":"2025-04-13T11:12:13.623Z","repository":{"id":60467990,"uuid":"532115929","full_name":"mikesposito/glue","owner":"mikesposito","description":"A blazingly fast HTTP client with a magnificent request building syntax, made for humans.","archived":false,"fork":false,"pushed_at":"2022-10-19T08:24:03.000Z","size":986,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T11:12:08.723Z","etag":null,"topics":["api-client","blazingly-fast","cli","http-client","json-selector","language"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/mikesposito.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2022-09-03T00:32:54.000Z","updated_at":"2024-09-23T12:05:47.000Z","dependencies_parsed_at":"2022-09-30T01:50:20.874Z","dependency_job_id":null,"html_url":"https://github.com/mikesposito/glue","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikesposito%2Fglue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikesposito%2Fglue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikesposito%2Fglue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikesposito%2Fglue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikesposito","download_url":"https://codeload.github.com/mikesposito/glue/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703198,"owners_count":21148118,"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":["api-client","blazingly-fast","cli","http-client","json-selector","language"],"created_at":"2024-10-14T21:04:06.213Z","updated_at":"2025-04-13T11:12:13.595Z","avatar_url":"https://github.com/mikesposito.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔗 glue\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/mikesposito/glue/blob/main/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/mikesposito/glue/blob/main/CONTRIBUTING.md)\n\nMake requests, select JSON responses, nest them in other requests: A magnificent syntax for blazingly fast cli HTTP calls, **made for humans**.\n\n![](https://github.com/mikesposito/glue/blob/main/assets/glue_demo.gif)\n\n## Table of Contents\n\n- [Getting started](#getting-started)\n  - [Install \u0026 Update](#install--update)\n  - [Usage](#usage)  \n- [Syntax](#syntax)\n  - [Overview](#overview)\n  - [Simple request](#simple-request)\n  - [JSON Result selector](#json-result-selector)\n  - [Body attributes](#body-attributes)\n  - [Headers](#headers)\n  - [Nested requests](#nested-requests)\n  - [Run file](#run-file)\n  - [Save response in variable](#save-response-in-variable)\n- [Examples](./examples/README.md)\n- [Contributing](#contributing)\n  - [Code of conduct](#code-of-conduct)\n  - [Contributing Guide](#contributing-guide)\n  - [Good First Issues](#good-first-issues)\n- [License](#license)\n\n## Getting started\n### Install \u0026 Update\n\nAt the moment, you can install or update glue for your system by building it from source. It has been done quite easy by the script `install.sh`.\n\nAll build dependencies (including Rust) will be deleted right after the installation automatically if Rust wasn't already on your system.\n\n1. Clone the repo\n```bash\ngit clone https://github.com/mikesposito/glue\n```\n\n2. Go to glue root directory\n```bash\ncd glue\n```\n\n3. Add execute permission and run install.sh\n```bash\nchmod +x ./install.sh \u0026\u0026 ./install.sh\n```\n\n### Usage\n\nTo start an interactive glue shell, simply run:\n\n```bash\nglue\n```\n\nalternatively, you can also execute a request directly:\n\n```bash\nglue \u003cREQUEST\u003e\n```\n\nThe simplest request you can do with glue is using just the method and the url:\n\n```bash\nglue 'get https://dog.ceo/api/breeds/list/all'\n# or in glue shell:\nget https://dog.ceo/api/breeds/list/all\n```\n\n## Syntax\n\n### Overview\n\nThe main gluescipt request syntax is the following:\n\n```bash\n[METHOD] [URL] [OPERATORS]\n```\n\n### Methods available\n\n| Glue Keyword | Description |\n|---|---|\n| `get` | Executes a GET http call |\n| `post` | Executes a POST http call |\n| `patch` | Executes a PATCH http call |\n| `put` | Executes a PUT http call |\n| `delete` | Executes a DELETE http call |\n| `req` | Reuses a saved request response from memory |\n\n### Operators available\n\nOperators allow to execute operations on requests (body, headers params, nesting), on responses (selectors, variables)\n\n| Operation | Syntax | Example |\n|---|---|---|\n| [JSON Result Selector](#json-result-selector) | **^**`selector` | `^$.message` |\n| [Body attribute](#body-attributes) | **~**`key`**=**`value` | `~username=admin` |\n| [Body attribute quoted](#body-attributes) | **~**`key`**=\"**`value`**\"** | `~fullname=\"John Doe\"` |\n| [Raw JSON body](#raw-json-body) | **~#-**`json`**-#** | `~#-{\"username\": \"admin\"}-#` |\n| [Header attribute](#headers) | **\\***`key`**=**`value` | `*authorization=xxx` |\n| [Header attribute quoted](#headers) | **\\***`key`**=\"**`value`**\"** | `*authorization=\"Bearer xxx\"` |\n| [Nested request](#nested-requests) | **{** `nested_request` **}** | `get api.com/users/{get api.com/me}` |\n| [Save response in var](#save-response-in-variable) | **\u003e**`var` | `\u003elogin_request` |\n| [Sequential request separator](#multiple-requests) | `request`**;** `other_request` | `req test1; req test2` |\n\n### JSON result selector\n\nIf the response is of type JSON, you can add a jsonpath selector to the request with the char `^`. Glue will only return the desired value from the response. This applies also for [Nested requests](#nested-requests).\n\n```bash\nget https://dog.ceo/api/breeds/list/all^$.message.terrier\n\n# OUTPUT:\n# \u003e [GET] https://dog.ceo/api/breeds/list/all\n# \n# \n# [\n#   [\n#     \"american\",\n#     \"australian\",\n#     \"bedlington\",\n#     \"border\",\n#     \"cairn\",\n#     \"dandie\",\n#     \"fox\",\n#     \"irish\",\n#     \"kerryblue\",\n#     \"lakeland\",\n#     \"norfolk\",\n#     \"norwich\",\n#     \"patterdale\",\n#     \"russell\",\n#     \"scottish\",\n#     \"sealyham\",\n#     \"silky\",\n#     \"tibetan\",\n#     \"toy\",\n#     \"welsh\",\n#     \"westhighland\",\n#     \"wheaten\",\n#     \"yorkshire\"\n#   ]\n# ]\n```\n\n### Body attributes\n\nYou can use the char `~` to add body attributes to the request:\n\n```bash\npost https://example.com/user/add ~username=admin\n# or\npost https://example.com/user/add~username=admin\n\n# glue will send a body of type JSON \n# with a key \"username\" with value \"admin\"\n```\n\n#### **Raw JSON Body**\n\nRaw JSON values can also be used between `~#-JSON-` instead of single attributes:\n\n```bash\npost https://example.com/users ~#-{ \"name\": \"John\" }-#\n# or \npost https://example.com/users~#-{ \"name\": \"John\" }-#\n```\n\n#### **Note**\nBody attributes can take their value from another request's response by using [nested requests](#nested-requests) feature.\n\n### Headers\n\nYou can use the char `*` to set headers to the request:\n\n```bash\npost https://example.com/user/add*authorization=6a75d4d7-84c3\n# or\npost https://example.com/user/add *authorization=6a75d4d7-84c3\n\n# glue will set Authorization header\n# to value \"6a75d4d7-84c3\"\n```\n\nQuotes can also be use to escape special glue chars or spaces in attributes:\n\n```bash\npost https://example.com/user/add*authorization=\"Bearer 6a75d4d7-84c3\"\n```\n\n#### **Note**\nHeaders can take their value from another request's response by using [nested requests](#nested-requests) feature.\n\n### Nested requests\n\nOne of the most useful features of glue is the request nesting. \n\nYou can reuse response values (total or partial) from a request to build another request. \n\nGlue supports infinite nesting and will build a dependency tree, divide it in layers and execute each layer on parallel for the maximum time optimization.\n\nYou can use request nesting delimiting the desired nested request with `{}`:\n\n```bash\nget api.com/users/{ get api.com/me^$.user.id }/\n\n# glue will execute this two requests:\n\n# 1. api.com/me - and will select user.id from the response (eg. 12345)\n\n# 2. api.com/users/12345/\n```\n\nRequest can also be nested inside body or headers parameters:\n\n```bash\nget api.com/me *authorization={get api.com/login^$.access_token}/\n```\n\n### Run file\n\nYou can also create a file with request to run, and pass the file path to glue with flag `-f` to execute it. You can try with one of the sample requests in `examples` folder:\n\n```bash\nglue -f examples/sample-request.glue\n```\n\n#### Multiple requests\n\nFiles can also contain multiple sequential requests separated by `;`.\nTake a look at [`./examples/sequential-requests.glue`](./examples/sequential-requests.glue).\n\n### Save response in variable\n\nYou can save a request response in a temporary variable with a name of your choice with the char `\u003e`, to reuse it without executing the call again.\n\n```bash\nget https://dog.ceo/api/breeds/list/all \u003etest_req\n```\n\nto use the saved response:\n\n```bash\nreq test_req\n```\n\nYou can also use a selector on the saved response with `^`:\n\n```bash\nreq test_req^$.message.terrier\n```\n\n**Note**: Variables are available only in the same glueshell session and dropped at the end of it.\n\n## Contributing\n\nThe main purpose of this repository is to continue evolving glue core, making it faster and easier to use. Development of glue happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving glue.\n\n### [Code of Conduct](CODE_OF_CONDUCT.md)\n\nglue has adopted a Code of Conduct that we expect project participants to adhere to. Please read [the full text](CODE_OF_CONDUCT.md) so that you can understand what actions will and will not be tolerated.\n\n### [Contributing Guide](CONTRIBUTING.md)\n\nRead our [contributing guide](CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to glue.\n\n### Good First Issues\n\nTo help you get your feet wet and get you familiar with our contribution process, we have a list of [good first issues](https://github.com/mikesposito/glue/labels/good%20first%20issue) that contain bugs which have a relatively limited scope. This is a great place to get started.\n\n## License\n\nglue is [MIT licensed](./LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikesposito%2Fglue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikesposito%2Fglue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikesposito%2Fglue/lists"}