{"id":13582541,"url":"https://github.com/relastle/pmy","last_synced_at":"2026-01-12T00:37:20.407Z","repository":{"id":36807735,"uuid":"186740030","full_name":"relastle/pmy","owner":"relastle","description":":rocket: General purpose context-aware zsh completion engine powered by fuzzy finder.","archived":false,"fork":false,"pushed_at":"2023-02-25T04:16:18.000Z","size":2481,"stargazers_count":151,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-29T18:43:39.420Z","etag":null,"topics":["fzf","productivity","zsh"],"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/relastle.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}},"created_at":"2019-05-15T03:08:50.000Z","updated_at":"2025-08-03T10:16:14.000Z","dependencies_parsed_at":"2023-10-21T03:31:07.888Z","dependency_job_id":null,"html_url":"https://github.com/relastle/pmy","commit_stats":null,"previous_names":["relastle/anypm"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/relastle/pmy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relastle%2Fpmy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relastle%2Fpmy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relastle%2Fpmy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relastle%2Fpmy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/relastle","download_url":"https://codeload.github.com/relastle/pmy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relastle%2Fpmy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28329806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["fzf","productivity","zsh"],"created_at":"2024-08-01T15:02:48.916Z","updated_at":"2026-01-12T00:37:20.391Z","avatar_url":"https://github.com/relastle.png","language":"Go","funding_links":[],"categories":["Completions","Go"],"sub_categories":["ZSH on Windows","Zinit (née zplugin)"],"readme":"# pmy\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Frelastle%2Fpmy.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Frelastle%2Fpmy?ref=badge_shield)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b4d31630d2f64ef1892d74dcc2e3105e)](https://www.codacy.com/app/relastle/pmy?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=relastle/pmy\u0026amp;utm_campaign=Badge_Grade)\n[![CircleCI](https://circleci.com/gh/relastle/pmy.svg?style=shield)](https://circleci.com/gh/relastle/pmy)\n[![Go Report Card](https://goreportcard.com/badge/github.com/relastle/pmy)](https://goreportcard.com/report/github.com/relastle/pmy)\n\npmy is a highly customizable context-aware shell(zsh)-completion scheme utilizing fuzzy finder such as\n[fzf](https://github.com/junegunn/fzf).\nI'm fully in love with fzf, and I think [zsh's completion system](http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System) is so complicated (I admit it is very powerful), so I developed this system.\n\n## Dependency\n\n-   [fzf](https://github.com/junegunn/fzf) (You can of course use other fuzzy finder such as [peco](https://github.com/peco/peco) and [fzy](https://github.com/jhawthorn/fzy) instead of fzf.)\n\n## Installation\n\nFirst, please get pmy by go get (because the backend system is written in Go)\n\n```sh\ngo get -u github.com/relastle/pmy\n```\n\nOr you can download single binary releases from [here](https://github.com/relastle/pmy/releases)\n\nThen, only you have to do is executing folloing zsh command.\n\n```zsh\neval \"$(pmy init)\"\n```\n\nYou can also add the line into your ~/.zshrc if you want.\n\n## Quick Start\n\nTry downloading very simple pmy rule files into `$HOME/.pmy` (where pmy searches for rules by default).\n\n```zsh\ngit clone https://github.com/relastle/pmy-config $HOME/.pmy\n```\n\nThen, you are already able to enjoy path completion using fuzzy finder (completion is invoked by \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eSpace\u003c/kbd\u003e).\n\n![Sample GIF](https://user-images.githubusercontent.com/6816040/67204810-48a3e000-f449-11e9-8195-ee0ae1282bdb.gif)\n\nThis path-completion befavior is realized by simple yml configurations below\n\n```yml\n- regexp-left: ^(?P\u003cbody\u003e.*?)(?P\u003cpath\u003e~{0,1}([0-9A-Za-z_\\-.]*/)+)(?P\u003cquery\u003e[0-9A-Za-z_\\-.]*)$\n  cmd-groups:\n  - stmt: \\ls -AlFG --color=always \u003cpath\u003e | tail -n +2 | grep --color=always \"\u003cquery\u003e\"\n    after: awk '{print $8}'\n  fuzzy-finder-cmd: fzf -0 -1 --ansi -n8\n  buffer-left: \u003cbody\u003e\u003cpath\u003e\n  buffer-right: '[]'\n\n- regexp-left: ^(?P\u003cbody\u003e.*?) (?P\u003cquery\u003e[0-9A-Za-z_\\-.]*)$\n  cmd-groups:\n  - stmt: \\ls -AlFG --color=always | tail -n +2 | grep --color=always \"\u003cquery\u003e\"\n    after: awk '{print $8}'\n  fuzzy-finder-cmd: fzf -0 -1 --ansi -n8\n  buffer-left: '\u003cbody\u003e '\n  buffer-right: '[]'\n```\n\nCustomization is very easy.\n\n-  Wrtie your own rule in JSON/YML format.\n-  Save it in the name of `pmy_rules.[json|yml]`\n-  Locate the file under one of `$PMY_RULE_PATH`.\n\nIf you want to investigate into further examples, see [Gallery](https://github.com/relastle/pmy/wiki/Gallery).\n\n## Basic Usage\n\nPmy can be invoked by \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eSpace\u003c/kbd\u003e.\nIf the current left buffer (the part of the buffer that lies to the left of the cursor position) and the right buffer (the right part) match pre-defined rule (described below), fuzzy-finder launches against outputs of the corresponding command.\n\n## Basic Configuration\n\n### pmy's rule\n\nBasically, pmy's compleion behavior is solely based on `rule`.\n\nA single rule is described as follows\n\n```json\n{\n  \"regexpLeft\": \"git (cp|cherry-pick) *$\",\n  \"regexpRight\": \"\",\n  \"cmdGroups\": [\n    {\n      \"tag\": \"🍒:commit\",\n      \"stmt\": \"git log --oneline --branches --tags\",\n      \"after\": \"awk '{print $1}'\"\n     }\n   ],\n   \"fuzzyFinderCmd\": \"fzf -0 -1\",\n   \"bufferLeft\": \"[]\",\n   \"bufferLeft\": \"[]\",\n   \"bufferRight\": \"[]\"\n}\n```\n| property name (JSON / YML)                     | description                                                                                                  |\n| ---                                            | ---                                                                                                          |\n| ***regexpLeft*** / ***regexp-left***           | If this regexp matches the current left buffer, this rule will be activated.                                 |\n| ***regexpRight*** / ***regexp-right***         | Same as left one, but in many cases you don't have to set it becasue you usually work in line left to right. |\n| ***cmdGroups.tag*** / ***cmd-groups.tag***     | tag string which will be inserted ahead of each line of outputs of the corresponding command.                |\n| ***cmdGroups.stmt*** / ***cmd-groups.stmt***   | command that will be executed to make sources for fuzzy-finder.                                              |\n| ***cmdGroups.after*** / ***cmd-groups.after*** | command that will be executed against line after fuzzy-finder selection (using pipe).                        |\n| ***fuzzyFinderCmd*** / ***fuzzy-finder-cmd***  | Fuzzy finder command that will be executed (piped) against obtained command                                  |\n| ***bufferLeft*** / ***buffer-left***           | Buffer left values after completion. [] denotes the original left buffer.                                    |\n| ***bufferRight*** / ***buffer-right***         | Buffer right values after completion. [] denotes the original right buffer.                                  |\n\n### Rule configuration\n\npmy searchs for its rule setting in `${HOME}/pmy/rules` by default.\nSo you can use common settings by executing\n\n```zsh\ngit clone https://github.com/relastle/pmy-config ~/.pmy\n```\n\nIf you want to customize pmy's rule.\nYou can define environment variable `PMY_RULE_PATH`.\nif you want to add `/path/to/1` and `/path/to/2` into pmy's rules paths,\nexecute\n\n```zsh\nexport PMY_RULE_PATH=\"/path/to/1:/path/to/2\"\n```\n\nThis setting is similar that of that of `$PATH` variable (, which controlls paths where executable binaries and scripts are located).\n\nIn this situation, priorities as follows:\n\n-  1. `/path/to/1/hoge_pmy_rules.json`\n-  2. `/path/to/2/hoge_pmy_rules.json`\n-  3. `${HOME}/.pmy/rules/hoge_pmy_rules.json`\n\n### command specific rule\n\nIn many cases, your own rule would be command specific ones (i.g. git-specific rule and cd-spefici-rule),\nwhich means that setting such rules into a single one file will increase searching time and slow pmy unreasonably.\nTherefore, you can define command specific rule by putting command-specific rules in the same directory as\n`${PMY_RULE_PATH}` with an appropriate file name as follows.\n\n```zsh\n├── pmy_rules.json\n├── git_pmy_rules.json\n├── cd_pmy_rules.json\n└── tmux_pmy_rules.json\n```\n\nIn this case, if your current left buffer starts with git command and pmy is invoked,\nit searched for matched rule first in `git_pmy_rules.json` (git-specific rules), and then `pmy_rules.json` (globally active rules).\n\n### Environment variables\n\n| variable name                | description                                                                                          | default values                                                           |\n| ---                          | ---                                                                                                  | ---                                                                      |\n| PMY_FUZZY_FINDER_DEFAULT_CMD | Default fuzzy finder command used when \"fuzzyFinderCmd\" is not set in a rule                         | \"fzf -0 -1\"                                                              |\n| PMY_TRIGGER_KEY              | Trigger key that invokes pmy completion                                                              | '^ '                                                                     |\n\nIf you want to change these values, you should export them in .zshrc before you execute\n\n```zsh\neval \"$(pmy init)\"\n```\n\nIf you set `PMY_TRIGGER_KEY` to `^I` (tab key),\nzsh's default completion action will be invoked when no rule was found.\n\nThis behavior is similar to `kill` command completion of\n[fzf](https://github.com/junegunn/fzf).\n\n\n## Features\n\n-  [x] JSON/YML rule-configurations.\n-  [x] Customize fuzzy finder command used.\n-  [x] Combining multiple command into one source.\n-  [ ] Caching compiled regular expression.\n-  [ ] Customizing priority of rules.\n\n## [License](LICENSE)\n\nThe MIT License (MIT)\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Frelastle%2Fpmy.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Frelastle%2Fpmy?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelastle%2Fpmy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frelastle%2Fpmy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelastle%2Fpmy/lists"}