{"id":30799394,"url":"https://github.com/triole/sam","last_synced_at":"2025-09-05T19:11:54.118Z","repository":{"id":62960877,"uuid":"411341368","full_name":"triole/sam","owner":"triole","description":"sam is a simple string processor that aims to ease string manipulation in shell","archived":false,"fork":false,"pushed_at":"2024-10-24T07:00:32.000Z","size":151,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-25T01:07:08.066Z","etag":null,"topics":["command-line","hash","hashing","string-manipulation"],"latest_commit_sha":null,"homepage":"","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/triole.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":"2021-09-28T15:36:20.000Z","updated_at":"2024-10-24T07:00:36.000Z","dependencies_parsed_at":"2024-03-26T21:43:28.610Z","dependency_job_id":"ffd7d340-86a3-4ee2-a509-233f9951267c","html_url":"https://github.com/triole/sam","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/triole/sam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fsam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fsam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fsam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fsam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/triole","download_url":"https://codeload.github.com/triole/sam/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fsam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273806205,"owners_count":25171569,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["command-line","hash","hashing","string-manipulation"],"created_at":"2025-09-05T19:11:41.940Z","updated_at":"2025-09-05T19:11:54.096Z","avatar_url":"https://github.com/triole.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sam ![build](https://github.com/triole/sam/actions/workflows/build.yaml/badge.svg) ![test](https://github.com/triole/sam/actions/workflows/test.yaml/badge.svg)\n\n\u003c!-- toc --\u003e\n\n- [Synopsis](#synopsis)\n- [Usage Examples](#usage-examples)\n- [Help](#help)\n\n\u003c!-- /toc --\u003e\n\n## Synopsis\n\nThe **S**tring **A**lteration **M**achine is a tool that can be used to manipulate and process strings. Why? Because I wanted something for simple string operations that can be used in bash scripts. I know there is `awk` and `tr` but some things (e.g. title case) are just to complicated using these two. Sam is simpler and does the job.\n\n## Usage Examples\n\n```go mdox-exec=\"sh/pre case -t title hello world\"\n$ sam case -t title hello world\nHello World\n```\n\n```go mdox-exec=\"sh/pre hash -t sha1 hello world\"\n$ sam hash -t sha1 hello world\n2aae6c35c94fcfb415dbe95f408b9ce91ee846ed\n```\n\n```go mdox-exec=\"sh/pre calc -p 3 '6*(3+3.111)'\"\n$ sam calc -p 3 6*(3+3.111)\n36.666\n```\n\n```go mdox-exec=\"sh/pre color ff1199\"\n$ sam color ff1199\n\n TYPE   VALUE            \n Hex    #ff1199          \n RGB    [255 17 153]     \n RGBA   [255 17 153 255] \n CMYK   [0 238 104 0]    \n YCbCr  [104 156 236]    \n\n```\n\n```go mdox-exec=\"sh/pre encode -t base64 hello world\"\n$ sam encode -t base64 hello world\naGVsbG8gd29ybGQ=\n```\n\n```go mdox-exec=\"sh/pre date 2025-01-01T15:33:11\"\n$ sam date 2025-01-01T15:33:11\n\n FORMAT         DATE                              \n UnixTimeStamp  1735741991                        \n UnixDate       Wed Jan 01 15:33:11 CET 2025      \n RFC3339        2025-01-01T15:33:11+01:00         \n RFC3339Nano    2025-01-01T15:33:11+01:00         \n RFC822Z        01 Jan 25 15:33 +0100             \n RFC850         Wednesday, 01-Jan-25 15:33:11 CET \n RFC1123Z       Wed, 01 Jan 2025 15:33:11 +0100   \n Stamp          Jan  1 15:33:11                   \n StampNano      Jan  1 15:33:11.000000000         \n\n```\n\n*Note that you can also pass the input string by stdin.* Like...\n\n```\necho hello world | sam hash -t md5\necho now | sam date\n```\n\n## Help\n\n```go mdox-exec=\"r -h\"\nUsage: sam \u003ccommand\u003e\n\na string alteration machine to ease string processing in shell scripts\n\nFlags:\n  -h, --help    Show context-sensitive help.\n\nCommands:\n  align      align string\n  bool       return bool value; returns 'true' on: 1, enable, enabled, on, true;\n             returns 'false' on everything else; case insensitive\n  calc       evaluate mathematical expressions\n  case       convert string case\n  color      display color code list, input can be hex or rgb\n  date       print different date formats\n  encode     encode string to\n  hash       calculate hash of a string\n  path       get parts of a file path\n  tidy       tidy string, replace multiple occurences of spaces or path\n             separators by a single one\n  trim       remove part of a string\n  version    display version\n\nRun \"sam \u003ccommand\u003e --help\" for more information on a command.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriole%2Fsam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftriole%2Fsam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriole%2Fsam/lists"}