{"id":13566836,"url":"https://github.com/anki-code/xontrib-output-search","last_synced_at":"2026-04-07T06:31:37.507Z","repository":{"id":45195085,"uuid":"257978984","full_name":"anki-code/xontrib-output-search","owner":"anki-code","description":"Get identifiers, paths, URLs and words from the previous command output and use them for the next command in @xonsh.","archived":false,"fork":false,"pushed_at":"2026-03-30T09:22:03.000Z","size":160,"stargazers_count":51,"open_issues_count":6,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-03-30T11:31:37.040Z","etag":null,"topics":["cli","command-line","console","python","shell","terminal","tmux","tmux-plugin","tmux-plugins","tokenization","tokenizer","xonsh","xontrib","zellij"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anki-code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":["https://github.com/anki-code","https://www.buymeacoffee.com/xxh","https://github.com/xonsh/xonsh#the-xonsh-shell-community"]}},"created_at":"2020-04-22T17:56:41.000Z","updated_at":"2026-03-30T09:22:07.000Z","dependencies_parsed_at":"2024-04-07T23:43:38.136Z","dependency_job_id":null,"html_url":"https://github.com/anki-code/xontrib-output-search","commit_stats":{"total_commits":160,"total_committers":5,"mean_commits":32.0,"dds":0.30625,"last_synced_commit":"d97fed4ebcf80f8d94b1648c1d7e8829626e1bf9"},"previous_names":["tokenizer/xontrib-output-search"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/anki-code/xontrib-output-search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fxontrib-output-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fxontrib-output-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fxontrib-output-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fxontrib-output-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anki-code","download_url":"https://codeload.github.com/anki-code/xontrib-output-search/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fxontrib-output-search/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31503381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["cli","command-line","console","python","shell","terminal","tmux","tmux-plugin","tmux-plugins","tokenization","tokenizer","xonsh","xontrib","zellij"],"created_at":"2024-08-01T13:02:17.716Z","updated_at":"2026-04-07T06:31:37.500Z","avatar_url":"https://github.com/anki-code.png","language":"Python","funding_links":["https://github.com/anki-code","https://www.buymeacoffee.com/xxh","https://github.com/xonsh/xonsh#the-xonsh-shell-community"],"categories":["Python","Plugins"],"sub_categories":["Prompt tweaks"],"readme":"\u003cp align=\"center\"\u003e\nGet identifiers, names, paths, URLs and words from the previous command output and use them for the next command in \u003ca href=\"https://xon.sh\"\u003exonsh\u003c/a\u003e.\n\u003cbr\u003e\u003cbr\u003e\n\u003cimg src=\"https://repository-images.githubusercontent.com/257978984/743a49af-d6bf-4769-8638-3bc38d779414\"\u003e\n\u003csup\u003e\u003ci\u003e(with \u003ca href=\"https://github.com/anki-code/starship-prompt-mono\"\u003estarship-prompt-mono\u003c/a\u003e)\u003c/i\u003e\u003c/sup\u003e\n\u003c/p\u003e\n\n\n\n## Features\n\n💡 **Universal**. Forget about searching autocomplete plugins for every app you use. Just get the identifiers from the previous output.\n\n⏳ **Save time**. Forget about using mouse, touchpad or trackball to get any words from screen to the next command.\n\n🔒 **Secure**. It works the same way as xonsh shell and the security level is the same.\n\n\n## Install\n\n```shell script\nxpip install -U xontrib-output-search\n```\n\n## Before usage\n\nThere are three ways to use output search:\n* Recommended. Use [tmux](https://en.wikipedia.org/wiki/Tmux) to run xonsh and use output search. See instructions below.\n* Not recommended. Set [`$XONSH_CAPTURE_ALWAYS=True`](https://xon.sh/envvars.html#xonsh-capture-always) and be ready some tools will freeze because of capturing e.g. `git config --help`. Details: after [xonsh release 0.10.0](https://github.com/xonsh/xonsh/releases/tag/0.10.0) ([4283](https://github.com/xonsh/xonsh/pull/4283)) you should set [`$XONSH_CAPTURE_ALWAYS=True`](https://xon.sh/envvars.html#xonsh-capture-always) in your `~/.xonshrc` to make output capturable. This approach has issues and we decided that the best solution for output search is to use the terminal window managers and we support [tmux](https://en.wikipedia.org/wiki/Tmux). In this case the output will be captured from the screen.\n* Alternative. You can [add support](https://github.com/anki-code/xontrib-output-search/blob/85a5eea39bb33377e236e0ba8e22b5e055f6bce5/xontrib/output_search.py#L81) any terminal emulator or terminal window manager like tmux that can capture the content of the terminal. PR is welcome!\n\n## Usage\n\nThe recommended way as described above:\n\n```xsh\nzsh\nalias tx=\"tmux new-session xonsh ';' set -g status off\"  # add alias to run xonsh in tmux without bottom status bar\ntx  # run xonsh in tmux\nxontrib load output_search  # add this to ~/.xonshrc\n```\n\nAfter loading you can select tokens from latest not empty output:\n* Windows/Linux: Press \u003ckbd\u003eAlt\u003c/kbd\u003e + \u003ckbd\u003ef\u003c/kbd\u003e hotkeys after getting the output of the previous command.\n* Mac: Press \u003ckbd\u003eControl\u003c/kbd\u003e + \u003ckbd\u003ef\u003c/kbd\u003e hotkeys after getting the output of the previous command.\n* Any OS: Type `f__` or `f__\u003cbeginning of the word you want\u003e` and press \u003ckbd\u003eTab\u003c/kbd\u003e.\n\nIf you use this key combination for another function and your muscle memory is strong just change \nthe [key combination](https://python-prompt-toolkit.readthedocs.io/en/master/pages/advanced_topics/key_bindings.html) before \nloading the xontrib:\n```python\n# Alt+i combination. Meaning for prompt-toolkit: @bindings.add('escape', 'i')\n$XONTRIB_OUTPUT_SEARCH_KEY='i'\nxontrib load output_search\n```\n```python\n# This approach is recommended for Mac users because `c-\u003ckey\u003e` is represented \n# the Control key that has less intersections with other Mac hotkeys. \n#\n# Control+g combination. Meaning for prompt-toolkit: @bindings.add('c-g')\n$XONTRIB_OUTPUT_SEARCH_KEY_BINDING='c-g'\nxontrib load output_search\n```\n```python\n# Right+Left combination. Meaning for prompt-toolkit: @bindings.add('right', 'left')\n$XONTRIB_OUTPUT_SEARCH_KEY_META='right'\n$XONTRIB_OUTPUT_SEARCH_KEY='left'  # the text placeholder will be `left__`\nxontrib load output_search\n```\n\nIn [tmux](https://en.wikipedia.org/wiki/Tmux) there is [the tmux fallback](https://github.com/anki-code/xontrib-output-search/pull/4) in case the output of last cmd is not available.\n\n## Use cases\n#### Get URL from output\n```shell script\necho \"Try https://github.com/xxh/xxh\"\n# Try https://github.com/xxh/xxh\ngit clone xx\u003cAlt+F\u003e\ngit clone https://github.com/xxh/xxh\n```\n\n#### Get key or value from JSON, Python dict and JavaScript object\n```shell script\necho '{\"Try\": \"xontrib-output-search\"}'\n# {\"Try\": \"xontrib-output-search\"}\necho I should try se\u003cAlt+F\u003e\necho I should try xontrib-output-search\n```    \n\n#### Get the path from environment\n```shell script\nenv | grep ^PATH=\n# PATH=/one/two:/three/four\nls fo\u003cAlt+F\u003e\nls /three/four  \n```    \n\n#### Complete the complex prefix\n\nGet the URL from previous output after typing `git+`:\n```shell script\necho \"Try https://github.com/anki-code/xontrib-output-search\"\n# Try https://github.com/anki-code/xontrib-output-search\n\npip install git+xo\u003cAlt+F\u003e\npip install git+https://github.com/anki-code/xontrib-output-search\n```\nGet the port number from previous output while typing the URL:\n```shell script\necho \"The port number is 4242\"\n# The port number is 4242\n\ncurl http://127.0.0.1:4\u003cAlt+F\u003e\ncurl http://127.0.0.1:4242\n```\n\n#### Get arguments from command help\n```shell script\nlolcat -h\n# ...\nlolcat --s\u003cAlt+F\u003e\nlolcat --seed=SEED\n```\n\n#### Use [tokenize-output](https://github.com/anki-code/tokenize-output) as a tool\n\n```xsh\n$(echo 'Hello \"world\"!' | tokenize-output -p).split()\n# ['Hello', 'world']\n```\n\n## Environement variables\n\n* `$XONTRIB_OUTPUT_SEARCH_WARNING` - show warnings from xontrib. Default `True`.\n\n## Development\n\nThe xontrib-output-search is using [tokenize-output](https://github.com/anki-code/tokenize-output) for tokenizing.\n\nChecking that `output_search` xontrib has been loaded:\n```shell script\nxontrib list output_search\n# output_search  installed  loaded\n\ncompleter list | grep output_search\n# xontrib_output_search\n```\n\n## Known issues\n\n#### `Alt+F` may not working in PyCharm terminal\nWorkaround: `f__` + \u003ckbd\u003eTab\u003c/kbd\u003e.\n\n#### `Alt+F` in the readline is to move forward\nWorkaround: set `$XONTRIB_OUTPUT_SEARCH_KEY='i'` before `xontrib load output_search`.\n\n#### Not working after [xonsh 0.10.0](https://github.com/xonsh/xonsh/releases/tag/0.10.0) ([4283](https://github.com/xonsh/xonsh/pull/4283))\n\nWorkaround: Check [`XONSH_CAPTURE_ALWAYS`](https://xon.sh/envvars.html#xonsh-capture-always) environment variable to bring the capturing of the output back i.e. `$XONSH_CAPTURE_ALWAYS=True`.\n\n#### `cat file` is not captured ([xonsh/issues/3744](https://github.com/xonsh/xonsh/issues/3744))\nWorkaround: `cat file | head` or `cat file | grep text`.\n\n#### `ls --hyperlink` is not working in tmux\n\nSee also [tmux feature request: Hyperlinks](https://github.com/tmux/tmux/issues/911).\nTry [`zellij`](https://github.com/zellij-org/zellij) as workaround.\n\n#### The readline shell type was not tested\n\nWe're using the xonsh recommended prompt-toolkit shell type to test the output search xontrib. There could be the issues in the readline shell type. PRs are welcome!\n\n## Links \n* This package is the part of [ergopack](https://github.com/anki-code/xontrib-ergopack) - the pack of ergonomic xontribs.\n* This package was created with [xontrib cookiecutter template](https://github.com/xonsh/xontrib-cookiecutter).\n* I was inspired by [xontrib-histcpy](https://github.com/con-f-use/xontrib-histcpy). Thanks @con-f-use!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanki-code%2Fxontrib-output-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanki-code%2Fxontrib-output-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanki-code%2Fxontrib-output-search/lists"}