{"id":18319783,"url":"https://github.com/redding/chpg","last_synced_at":"2025-04-09T14:22:42.160Z","repository":{"id":66267697,"uuid":"244382136","full_name":"redding/chpg","owner":"redding","description":"Switch between Installed Postgres.app versions","archived":false,"fork":false,"pushed_at":"2024-04-18T23:51:22.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-15T08:19:52.555Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/redding.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":"2020-03-02T13:48:22.000Z","updated_at":"2024-04-18T23:51:25.000Z","dependencies_parsed_at":"2024-12-23T08:38:13.594Z","dependency_job_id":null,"html_url":"https://github.com/redding/chpg","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Fchpg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Fchpg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Fchpg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Fchpg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redding","download_url":"https://codeload.github.com/redding/chpg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054200,"owners_count":21039952,"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":[],"created_at":"2024-11-05T18:14:15.082Z","updated_at":"2025-04-09T14:22:42.119Z","avatar_url":"https://github.com/redding.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chpg\n\nSwitch between installed [Postgres.app](https://postgresapp.com/) versions.\n\n```\n$ chpg @11 \u0026\u0026 pg_dump --version\n$ echo '11' \u003e ./.chpg-version \u0026\u0026 chpg @ \u0026\u0026 pg_dump --version\n$ chpg @latest \u0026\u0026 pg_dump --version\n$ chpg help\n```\n\n## Install\n\nOpen a terminal and run this command ([view source](http://git.io/chpg--install)):\n\n(change PREFIX as needed; it defaults to `/usr/local`)\n\n```\n$ curl -L http://git.io/chpg--install | PREFIX=/usr/local sh\n```\n\n### Init\n\nAdd `chpg init` to your shell startup script.  This installs tab completions and enables modifying the env vars.\n\n```bash\neval \"$(chpg init)\"\n```\n\n### Auto Mode\n\n(optional) If you want automatic handling, add the `--auto` flag to the init.  In additon to the normal init above, `$PROMPT_COMMAND` is updated to activate any new Postgres.app version as you change directories.  **Again, this is optional.**\n\n```bash\neval \"$(chpg init --auto)\"\n```\n\n### Quiet Mode\n\nBy default, chpg outputs a warning saying which version/source it activates. If you want to silence these warnings, add the `--quiet` flag to the init.\n\n```bash\neval \"$(chpg init --quiet)\"\n```\n\n## Usage\n\n```\n$ chpg help\n```\n\n### `.chpg-version` Files\n\nIf no explicit @\u003cversion\u003e parameter is specified, chpg will look for the version in a file named `.chpg-version` in your current directory, its parent directories, or your home directory.  The `.chpg-version` files are expected to contain nothing but the version requested.\n\n```\n$ echo \"11\" \u003e $HOME/.chpg-version\n$ cd $HOME \u0026\u0026 chpg @\n$ pg_dump --version # will use /Applications/Postgres.app/Contents/Versions/11/bin/pg_dump\n```\n\nYou can specify a specific version file using the `-f` option:\n\n```\n$ cd $HOME\n$ echo \"12\" \u003e /a/path/to/.chpg-version\n$ chpg -f /a/path/to/.chpg-version\n$ pg_dump --version # will use /Applications/Postgres.app/Contents/Versions/12/bin/pg_dump\n```\n\n**Note**: You can specify a \"default\" version file at `$HOME/.chpg/.chpg-version`.  This version will be used when no other .chpg-version can be found and no command line version has been specified.\n\n**Note**: If an `@\u003cversion\u003e` parameter is given, it will always override any versions specified in any `.chpg-version` files.\n\n## Uninstall\n\nOpen a terminal and run this command ([view source](http://git.io/chpg--uninstall)):\n\n```\n$ curl -L http://git.io/chpg--uninstall | sh\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredding%2Fchpg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredding%2Fchpg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredding%2Fchpg/lists"}