{"id":15648533,"url":"https://github.com/daniel-beard/psst-hs","last_synced_at":"2025-10-14T13:12:56.060Z","repository":{"id":148525864,"uuid":"429263855","full_name":"daniel-beard/psst-hs","owner":"daniel-beard","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-22T22:47:25.000Z","size":21,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T23:41:32.961Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daniel-beard.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","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":"2021-11-18T02:03:09.000Z","updated_at":"2021-11-24T01:23:09.000Z","dependencies_parsed_at":"2024-10-03T12:26:06.265Z","dependency_job_id":"b1883656-8655-4ea5-b776-77acaceb4d77","html_url":"https://github.com/daniel-beard/psst-hs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/daniel-beard/psst-hs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-beard%2Fpsst-hs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-beard%2Fpsst-hs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-beard%2Fpsst-hs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-beard%2Fpsst-hs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel-beard","download_url":"https://codeload.github.com/daniel-beard/psst-hs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-beard%2Fpsst-hs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018706,"owners_count":26086605,"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-10-14T02:00:06.444Z","response_time":60,"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":[],"created_at":"2024-10-03T12:25:08.573Z","updated_at":"2025-10-14T13:12:56.032Z","avatar_url":"https://github.com/daniel-beard.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# psst-hs\n\nPaSteboard String Tranform tool - Haskell edition.\n\nThere are two ways to get data into this tool, `cat` something to it, or just run it and it will take the value in your pasteboard.\n\nThere are a lot of tools for transforming strings on the CLI, but the most useful tool is the one you remember how to use.\nThis tool aims to be useful, but unsurprising in behavior.\n\n## Concepts\n\n- This utility transforms strings with a typed dsl.\n- The syntax is inspired by Julialang's pipeline operator `|\u003e`\n- This utility was born as a reimplentation of [daniel-beard/psst](https://github.com/daniel-beard/psst) with the following:\n  - Less syntax (for now), 'command' based\n  - Better documentation\n  - A typed representation\n  - Fast start time (Julia takes a while to warm up)\n  - Easy to add new commands\n  - Better error messages\n  - Interpreted, with ability to output partial results in case of errors\n\n## Examples\n\n```shell\necho 'hello world' | psst-hs 'words |\u003e uppercase |\u003e take(2) |\u003e base64 |\u003e unbase64'\n[\"HE\",\"WO\"]\n```\n\n## Types and Examples\n\nThere are currently only a few types in `psst-hs`:\n\n```\n- VString\n- VStringList\n- VInt\n- VBool\n- VError\n```\n\nMany commands work the same across `VString` and `VStringList` types. The function used in the `VString` type is just mapped across the list.\n\n## Commands\n\nCommands are chained by the pipeline operator `|\u003e`. Each command opts in to a particular input type.\n\n### VString\n\n\u003cdetails\u003e\u003csummary\u003ebase64 -\u003e VString\u003c/summary\u003e\n\n- Description: Base64 encoding of a VString\n- Example:\n\n```\necho 'hello world' | psst-hs 'base64'\n\u003e aGVsbG8gd29ybGQK\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003ehead -\u003e VString\u003c/summary\u003e\n\n- Description: Take the first value\n- Example:\n\n```\necho 'hello world' | psst-hs 'head'\n\u003e h\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003elength -\u003e VInt\u003c/summary\u003e\n\n- Description: Return a `VInt` representing the length of a `VString`\n- Example:\n\n```\necho 'hi' | psst-hs 'length'\n\u003e 2\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003elowercase -\u003e VString\u003c/summary\u003e\n\n- Description: Return a `VString` with all characters set to lowercase\n- Example:\n\n```\necho 'HELLO WORLD' | psst-hs 'lowercase'\n\u003e \"hello world\"\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003ematch -\u003e VStringList\u003c/summary\u003e\n\n- Description: Return all matches for a given regex\n- Example:\n\n```\necho 'hello world' | psst-hs 'match(\"[a-z]+\")'\n[\"hello\", \"world\"]\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003ematches -\u003e VBool\u003c/summary\u003e\n\n- Description: Return a `VBool` indicating if input matches a regex\n- Example:\n\n```\necho \"hello world\" | psst-hs 'matches(\"\\\\w+\")'\nTrue\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003ereverse -\u003e VStringList\u003c/summary\u003e\n\n- Description: Return a `VString` with the characters reversed from their original order\n- Example:\n\n```\necho 'hello world' | psst-hs 'reverse'\n\u003e dlrow olleh\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003etail -\u003e VString\u003c/summary\u003e\n\n- Description: All characters except the first one. Returns a `VString`\n- Example:\n\n```\necho 'hello world' | psst-hs 'tail'\n\u003e ello world\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003etake(Int) -\u003e VString\u003c/summary\u003e\n\n- Description: Output only the prefix number of characters. Returns a `VString`\n- Example:\n\n```\necho 'hello world' | psst-hs 'take(4)'\n\u003e hell\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eunbase64 -\u003e VString\u003c/summary\u003e\n\n- Description: Decode a base64 representation. Returns a `VString`.\n- Example:\n\n```\necho 'aGVsbG8gd29ybGQK' | psst-hs 'unbase64'\n\u003e hello world\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003euppercase -\u003e VString\u003c/summary\u003e\n\n- Description: Uppercase the string. Returns a `VString`\n- Example:\n\n```\necho 'hello world' | psst-hs 'uppercase'\n\u003e HELLO WORLD\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003ewords -\u003e VStringList\u003c/summary\u003e\n\n- Description: Split a `VString` into components separated by whitespace. Returns a `VStringList`\n- Example:\n\n```\necho 'hello world' | psst-hs 'words'\n\u003e [\"hello\", \"world\"]\n```\n\u003c/details\u003e\n\n-------\n\n### VStringList\n\n\u003cdetails\u003e\u003csummary\u003ebase64 -\u003e VStringList\u003c/summary\u003e\n\n- Description: Maps the `VString` method across a `VStringList`\n- Example:\n\n```\necho 'hello world' | psst-hs 'words |\u003e base64'\n\u003e [\"aGVsbG8=\",\"d29ybGQ=\"]\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003elength -\u003e VInt\u003c/summary\u003e\n\n- Description: Returns the length of the `VStringList` as `VInt`\n- Example:\n\n```\necho 'hello world' | psst-hs 'words |\u003e length'\n\u003e 2\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003elowercase -\u003e VStringList\u003c/summary\u003e\n\n- Description: Maps the `VString` method across a `VStringList`\n- Example:\n\n```\necho 'HELLO WORLD' | psst-hs 'words |\u003e lowercase'\n\u003e [\"hello\", \"world\"]\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003ereverse -\u003e VStringList\u003c/summary\u003e\n\n- Description: Reverse the order of elements within the `VStringList`\n- Example:\n\n```\necho 'hello world' | psst-hs 'words |\u003e reverse'\n\u003e [\"world\", \"hello\"]\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eunbase64 -\u003e VStringList\u003c/summary\u003e\n\n- Description: Maps the `VString` method across a `VStringList`\n- Example:\n\n```\necho 'aGVsbG8= d29ybGQ=' | psst-hs 'words |\u003e unbase64'\n\u003e [\"hello\", \"world\"]\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003euppercase -\u003e VStringList\u003c/summary\u003e\n\n- Description: Maps the `VString` method across a `VStringList`\n- Example:\n\n```\necho 'hello world' | psst-hs 'words |\u003e uppercase'\n\u003e [\"HELLO\", \"WORLD\"]\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003etail -\u003e VString\u003c/summary\u003e\n\n- Description: Returns the last `VString` from a `VStringList`\n- Example:\n\n```\necho 'hello world' | psst-hs 'words |\u003e tail'\n\u003e [\"WORLD\"]\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003etake(VInt) -\u003e VStringList\u003c/summary\u003e\n\n- Description: Returns the first n `VString` values from a `VStringList`\n- Example:\n\n```\necho '1 2 3 4 5' | psst-hs 'words |\u003e take(4)'\n\u003e [\"1\", \"2\", \"3\", \"4\"]\n```\n\u003c/details\u003e\n\n-------\n\n## Building on macOS\n\n```shell\nbrew install pcre\n\n# For M1s\nbrew list pcre | grep 'pcre\\.h$'\n\n/opt/homebrew/include\n\nln -s /usr/local/pcre-8.45 /usr/sbin/pcre\nln -s /usr/local/pcre-8.45/include/pcre.h /usr/include/pcre.h\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-beard%2Fpsst-hs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel-beard%2Fpsst-hs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-beard%2Fpsst-hs/lists"}