{"id":13543080,"url":"https://github.com/curl/trurl","last_synced_at":"2025-05-13T23:09:19.437Z","repository":{"id":149496526,"uuid":"621725724","full_name":"curl/trurl","owner":"curl","description":"a command line tool for URL parsing and manipulation.","archived":false,"fork":false,"pushed_at":"2025-05-13T14:29:45.000Z","size":381,"stargazers_count":3250,"open_issues_count":1,"forks_count":108,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-05-13T15:48:58.454Z","etag":null,"topics":["command-line-tool","manipulation","parsing","url"],"latest_commit_sha":null,"homepage":"https://curl.se/trurl/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/curl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","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-03-31T08:54:39.000Z","updated_at":"2025-05-13T14:29:49.000Z","dependencies_parsed_at":"2023-04-20T12:00:42.351Z","dependency_job_id":"b0e630c2-b8ab-4475-9327-37ca9af19841","html_url":"https://github.com/curl/trurl","commit_stats":{"total_commits":366,"total_committers":31,"mean_commits":"11.806451612903226","dds":0.4289617486338798,"last_synced_commit":"a71ece935fc08c406713599f1fabbeecae633f32"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curl%2Ftrurl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curl%2Ftrurl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curl%2Ftrurl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curl%2Ftrurl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curl","download_url":"https://codeload.github.com/curl/trurl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254042061,"owners_count":22004835,"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":["command-line-tool","manipulation","parsing","url"],"created_at":"2024-08-01T11:00:22.700Z","updated_at":"2025-05-13T23:09:19.356Z","avatar_url":"https://github.com/curl.png","language":"C","funding_links":[],"categories":["C","Perl","\u003ca name=\"text-processing\"\u003e\u003c/a\u003eText processing"],"sub_categories":[],"readme":"\n# [![trurl logo](https://curl.se/logo/trurl-logo.svg)](https://curl.se/trurl)\n\n# trurl\n\nCommand line tool for URL parsing and manipulation\n\n[Video presentation](https://youtu.be/oDL7DVszr2w)\n\n## Examples\n\n**Replace the hostname of a URL:**\n\n```text\n$ trurl --url https://curl.se --set host=example.com\nhttps://example.com/\n```\n\n**Create a URL by setting components:**\n\n```text\n$ trurl --set host=example.com --set scheme=ftp\nftp://example.com/\n```\n\n**Redirect a URL:**\n\n```text\n$ trurl --url https://curl.se/we/are.html --redirect here.html\nhttps://curl.se/we/here.html\n```\n\n**Change port number:**\n\n```text\n$ trurl --url https://curl.se/we/../are.html --set port=8080\nhttps://curl.se:8080/are.html\n```\n\n**Extract the path from a URL:**\n\n```text\n$ trurl --url https://curl.se/we/are.html --get '{path}'\n/we/are.html\n```\n\n**Extract the port from a URL:**\n\n```text\n$ trurl --url https://curl.se/we/are.html --get '{port}'\n443\n```\n\n**Append a path segment to a URL:**\n\n```text\n$ trurl --url https://curl.se/hello --append path=you\nhttps://curl.se/hello/you\n```\n\n**Append a query segment to a URL:**\n\n```text\n$ trurl --url \"https://curl.se?name=hello\" --append query=search=string\nhttps://curl.se/?name=hello\u0026search=string\n```\n\n**Read URLs from stdin:**\n\n```text\n$ cat urllist.txt | trurl --url-file -\n...\n```\n\n**Output JSON:**\n\n```text\n$ trurl \"https://fake.host/hello#frag\" --set user=::moo:: --json\n[\n  {\n    \"url\": \"https://%3a%3amoo%3a%3a@fake.host/hello#frag\",\n    \"parts\": {\n      \"scheme\": \"https\",\n      \"user\": \"::moo::\",\n      \"host\": \"fake.host\",\n      \"path\": \"/hello\",\n      \"fragment\": \"frag\"\n    }\n  }\n]\n```\n\n**Remove tracking tuples from query:**\n\n```text\n$ trurl \"https://curl.se?search=hey\u0026utm_source=tracker\" --qtrim \"utm_*\"\nhttps://curl.se/?search=hey\n```\n\n**Show a specific query key value:**\n\n```text\n$ trurl \"https://example.com?a=home\u0026here=now\u0026thisthen\" -g '{query:a}'\nhome\n```\n\n**Sort the key/value pairs in the query component:**\n\n```text\n$ trurl \"https://example.com?b=a\u0026c=b\u0026a=c\" --sort-query\nhttps://example.com?a=c\u0026b=a\u0026c=b\n```\n\n**Work with a query that uses a semicolon separator:**\n\n```text\n$ trurl \"https://curl.se?search=fool;page=5\" --qtrim \"search\" --query-separator \";\"\nhttps://curl.se?page=5\n```\n\n**Accept spaces in the URL path:**\n\n```text\n$ trurl \"https://curl.se/this has space/index.html\" --accept-space\nhttps://curl.se/this%20has%20space/index.html\n```\n\n## Install\n\n### Linux\n\nIt is quite easy to compile the C source with GCC:\n\n```text\n$ make\ncc  -W -Wall -pedantic -g   -c -o trurl.o trurl.c\ncc   trurl.o  -lcurl -o trurl\n```\n\ntrurl is also available in [some package managers](https://github.com/curl/trurl/wiki/Get-trurl-for-your-OS). If it is not listed you can try searching for it using the package manager of your preferred distribution.\n\n### Windows\n\n1. Download and run [Cygwin installer.](https://www.cygwin.com/install.html)\n2. Follow the instructions provided by the installer. When prompted to select packages, make sure to choose the following: curl, libcurl-devel, libcurl4, make and gcc-core.\n3. (optional) Add the Cygwin bin directory to your system PATH variable.\n4. Use `make`, just like on Linux.\n\n## Prerequisites\n\nDevelopment files of libcurl (e.g. `libcurl4-openssl-dev` or\n`libcurl4-gnutls-dev`) are needed for compilation. Requires libcurl version\n7.62.0 or newer (the first libcurl to ship the URL parsing API).\n\ntrurl also uses `CURLUPART_ZONEID` added in libcurl 7.81.0 and\n`curl_url_strerror()` added in libcurl 7.80.0\n\nIt would certainly be possible to make trurl work with older libcurl versions\nif someone wanted to.\n\n### Older libcurls\n\ntrurl builds with libcurl older than 7.81.0 but will then not work as\ngood. For all the documented goodness, use a more modern libcurl.\n\n### trurl / libcurl Compatibility\n\n| trurl Feature   |  Minimum libcurl Version |\n|-----------------|--------------------------|\n| imap-options    |   7.30.0                 |\n| normalize-ipv   |   7.77.0                 | \n| white-space     |   7.78.0                 |\n| url-strerror    |   7.80.0                 |\n| zone-id         |   7.81.0                 |\n| punycode        |   7.88.0                 |\n| punycode2idn    |   8.3.0                  |\n| no-guess-scheme |   8.9.0                  |\n\nFor more details on how trurl will behave if these features are missing see [URL Quirks](https://github.com/curl/trurl/blob/master/URL-QUIRKS.md).\nTo see the features your version of trurl supports as well as the version of libcurl it is built with, run the following command:  `trurl --version`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurl%2Ftrurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurl%2Ftrurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurl%2Ftrurl/lists"}