{"id":16673807,"url":"https://github.com/patinthehat/pwdshort","last_synced_at":"2025-08-24T22:13:50.704Z","repository":{"id":31854443,"uuid":"35421739","full_name":"patinthehat/pwdshort","owner":"patinthehat","description":"A linux utility used to shorten the $PWD for display in the terminal, such as in a bash PS1 prompt.","archived":false,"fork":false,"pushed_at":"2015-08-02T15:15:35.000Z","size":148,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-24T09:30:52.122Z","etag":null,"topics":["bash-prompt","go","go-application","golang"],"latest_commit_sha":null,"homepage":null,"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/patinthehat.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}},"created_at":"2015-05-11T12:14:00.000Z","updated_at":"2017-03-10T18:02:40.000Z","dependencies_parsed_at":"2022-08-29T13:10:36.180Z","dependency_job_id":null,"html_url":"https://github.com/patinthehat/pwdshort","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/patinthehat/pwdshort","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patinthehat%2Fpwdshort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patinthehat%2Fpwdshort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patinthehat%2Fpwdshort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patinthehat%2Fpwdshort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patinthehat","download_url":"https://codeload.github.com/patinthehat/pwdshort/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patinthehat%2Fpwdshort/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271962183,"owners_count":24850593,"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-08-24T02:00:11.135Z","response_time":111,"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":["bash-prompt","go","go-application","golang"],"created_at":"2024-10-12T12:28:14.214Z","updated_at":"2025-08-24T22:13:50.662Z","avatar_url":"https://github.com/patinthehat.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## pwdshort ##\n`pwdshort` is a utility for linux written in Go used to shorten the $PWD for display in the terminal, such as in a bash PS1 prompt.\n\n---\n### Compiling ###\n---\n\nTo compile, clone the repository and run `$ go build pwdshort.go`.\n\n---\n### Configuration ###\n---\nConfiguration for `pwdshort` is stored in `pwdshort.json`.  It must reside in the same directory as the pwdshort binary.\nHere you can modify how many path parts to display at the front and end of the abbreviated path.\nThe part of the config file that holds these settings is as follows by default:\n```\n    \"MaxDisplayedParts\":{\n      \"Prefix\":1,\n      \"Suffix\":2\n    },\n```\n\nYou can also specify pathname replacements, i.e. replace \"projects\" to \"PRJ\": `/home/user/projects` =\u003e `/home/user/PRJ`\nPathname replacements are *only* to make the CWD more compact, it does NOT rename the pathname.\nDefault settings in the configuration file:\n```\n    \"Replacements\": [\n      { \"Pathname\": \"Development\",  \"Replacement\":\"Dev\" },\n      { \"Pathname\": \"projects\",     \"Replacement\":\"prj\" },\n      { \"Pathname\": \"images\",       \"Replacement\":\"img\" },\n    ]\n```\n\n---\n### Bash Usage ###\n---\n\nOpen `~/.bashrc` in an editor, and update your PS1 variable definition:\n```bash\n    pathAbbrev='/path/to/pwdshort-binary'\n    PS1='\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\n\\e[01;36;19m`${pathAbbrev}`\\e[0m\\$ '\n```\n\n---\n### Sample Output ###\n---\n\nAssuming the current directory is:\n`/home/user/Development/projects/go/src/pwdshort`;\nthe path displayed in bash would be:\n`~/Dev/.../src/pwdshort`\n\nPaths with up to four parts are displayed as-is (assuming the configuration file has not been modified).\n\n---\n### License ###\n---\n`pwdshort` is open source software and is available under the \u003ca href=\"LICENSE\"\u003eMIT License\u003c/a\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatinthehat%2Fpwdshort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatinthehat%2Fpwdshort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatinthehat%2Fpwdshort/lists"}