{"id":23141811,"url":"https://github.com/allaman/gstring","last_synced_at":"2025-08-17T13:32:04.401Z","repository":{"id":240095631,"uuid":"801659504","full_name":"Allaman/gstring","owner":"Allaman","description":"Swiss army knife for manipulating strings.","archived":false,"fork":false,"pushed_at":"2024-06-05T22:19:07.000Z","size":48,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-15T16:55:34.550Z","etag":null,"topics":["camelcase","cli","golang","head","hex","htpasswd","md5","permissions","sha256","sha512","snakecase","split","strings","tail","unixtime"],"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/Allaman.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":"2024-05-16T16:58:32.000Z","updated_at":"2024-09-12T21:19:11.000Z","dependencies_parsed_at":"2024-05-16T18:27:15.465Z","dependency_job_id":"ba238c50-6c79-4399-b4ae-cf944f45a2c0","html_url":"https://github.com/Allaman/gstring","commit_stats":null,"previous_names":["allaman/gstring"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allaman%2Fgstring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allaman%2Fgstring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allaman%2Fgstring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allaman%2Fgstring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Allaman","download_url":"https://codeload.github.com/Allaman/gstring/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230128394,"owners_count":18177599,"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":["camelcase","cli","golang","head","hex","htpasswd","md5","permissions","sha256","sha512","snakecase","split","strings","tail","unixtime"],"created_at":"2024-12-17T14:14:29.802Z","updated_at":"2024-12-17T14:14:30.444Z","avatar_url":"https://github.com/Allaman.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eGstring\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg alt=\"GoReleaser Logo\" src=\"https://github.com/Allaman/gstring/assets/12184268/b302769b-4cfe-4ef4-83c4-f01c9f505bb9?v=3\u0026s=200\" height=\"140\" /\u003e\n  \u003cp\u003e\n    \u003cimg src=\"https://github.com/Allaman/gstring/actions/workflows/release.yaml/badge.svg\" alt=\"Release\"/\u003e\n    \u003cimg src=\"https://img.shields.io/github/repo-size/Allaman/gstring\" alt=\"size\"/\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues/Allaman/gstring\" alt=\"issues\"/\u003e\n    \u003cimg src=\"https://img.shields.io/github/last-commit/Allaman/gstring\" alt=\"last commit\"/\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/Allaman/gstring\" alt=\"license\"/\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/release/Allaman/gstring?sort=semver\" alt=\"last release\"/\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    Swiss army knife for working with strings\n  \u003c/p\u003e\n    \u003cimg src=\"https://s12.gifyu.com/images/SfRHE.gif\" alt=\"gstring\"\u003e\n\u003c/div\u003e\n\n## Use cases\n\n```\n❯ gstring --help\nUsage: gstring \u003ccommand\u003e [flags]\n\nA tool to work with strings\n\nFlags:\n  -h, --help    Show context-sensitive help.\n  -t, --trim    Trim output (for piping)\n\nCommands:\n  base64 encode        Encodes with base64\n  base64 decode        Decodes with base64\n  count bytes          Counts bytes\n  count chars          Counts characters\n  count words          Counts words\n  case camel           formatsCamelCase\n  case lower           formats lower\n  case random          ForMats rANdom CaSE\n  case snake           formats_snake_case\n  case upper           FORMATS UPPER\n  hash sha256          Calculates Sha256\n  hash sha512          Calculates Sha512\n  hash md5             Calculates MD5\n  head                 Returns the first n lines\n  hex to               Converts to hexadecimal\n  hex from             Converts hexadecimal back\n  lorem bytes          Returns Bytes\n  lorem paragraphs     Returns Paragraphs\n  lorem sentences      Returns Sentences\n  lorem words          Returns Words\n  htpasswd             Create a htpasswd string\n  permissions          Parses Unix permissions\n  pwgen                Password generator (letters and numbers)\n  remove-whitespace    Removes whitespace\n  reverse              Reverses the input\n  rng                  Random number generator\n  sort                 Sorts the input by line\n  split                Splits a string\n  tail                 Returns the last n lines\n  time from-unix       Converts from Unix time to normal time\n  time get-unix        Returns Unix time\n  url encode           Encodes string to valid URL\n  url decode           Decodes URL to string\n  version              Shows version information\n\nRun \"gstring \u003ccommand\u003e --help\" for more information on a command.\n```\n\n## Get gstring\n\nwith curl\n\n```sh\nVERSION=$(curl -s https://api.github.com/repos/allaman/gstring/releases/latest | grep tag_name | cut -d '\"' -f 4)\ncurl -sLo gstring https://github.com/Allaman/gstring/releases/download/${VERSION}/gstring_${VERSION}_$(uname -s)_$(uname -m)\n```\n\nwith wget\n\n```sh\nVERSION=$(wget -qO - https://api.github.com/repos/allaman/gstring/releases/latest | grep tag_name | cut -d '\"' -f 4)\nwget -qO gstring https://github.com/Allaman/gstring/releases/download/${VERSION}/gstring_${VERSION}_$(uname -s)_$(uname -m)\n```\n\n```sh\nchmod +x gstring\n./gstring\n```\n\n## Usage\n\nMost of the commands work with stdin so you have to pipe content, for example:\n\n```sh\necho \"hello world\" | gstring case camel\ngstring hash sha256 \u003c main.go # equivalent to sha256sum main.go\ndate +%s | gstring time from-unix -f \"2006-01-02 15:04\"\n```\n\nHowever, some commands read from named arguments, for example:\n\n```sh\ngstring htpasswd -u bar -p test\ngstring lorem sentences -c 20\ngstring rng -s 1 -e 100 -c 10 -d \";\"\ngstring pwgen -n 20 -c 10 -d \";\"\ngstring permissions -p 3755\n```\n\n## What about the name?\n\nWell, of course, from **G**olang and **string**. What are you thinking?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallaman%2Fgstring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallaman%2Fgstring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallaman%2Fgstring/lists"}