{"id":51844066,"url":"https://github.com/iurysza/termscope","last_synced_at":"2026-07-23T10:00:51.232Z","repository":{"id":371993524,"uuid":"1277130605","full_name":"iurysza/termscope","owner":"iurysza","description":"Open files and links already visible on your terminal screen.","archived":false,"fork":false,"pushed_at":"2026-07-18T05:58:10.000Z","size":764,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-18T07:21:40.372Z","etag":null,"topics":["herdr","herdr-plugin","python","television","terminal","tmux"],"latest_commit_sha":null,"homepage":"https://github.com/iurysza/termscope","language":"Python","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/iurysza.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-22T15:57:03.000Z","updated_at":"2026-07-18T05:58:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/iurysza/termscope","commit_stats":null,"previous_names":["iurysza/termscope"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/iurysza/termscope","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iurysza%2Ftermscope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iurysza%2Ftermscope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iurysza%2Ftermscope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iurysza%2Ftermscope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iurysza","download_url":"https://codeload.github.com/iurysza/termscope/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iurysza%2Ftermscope/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35798804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-23T02:00:06.683Z","response_time":57,"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":["herdr","herdr-plugin","python","television","terminal","tmux"],"created_at":"2026-07-23T10:00:36.780Z","updated_at":"2026-07-23T10:00:51.221Z","avatar_url":"https://github.com/iurysza.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# termscope\n\n![termscope cover](./assets/cover.png)\n\n\n\n\n[![CI](https://github.com/iurysza/termscope/actions/workflows/ci.yml/badge.svg)](https://github.com/iurysza/termscope/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n![herdr 0.7.4+](https://img.shields.io/badge/herdr-0.7.4%2B-8a2be2)\n![platforms: macOS • Linux](https://img.shields.io/badge/platforms-macOS%20%E2%80%A2%20Linux-informational)\n\nOpen the files and links your agent just mentioned.\n\n`termscope` turns terminal output into a jump list. It reads the active pane's\nvisible terminal viewport, finds real files and URLs, then opens the selected\ntarget beside the conversation you were already reading.\n\n```text\nvisible terminal viewport\n        │\n        ▼\nCtrl-Shift-A  →  pick a visible file  →  nvim opens src/main.py:42\nCtrl-E        →  pick a visible link  →  browser opens it\n```\n\n## Demo\n\nhttps://github.com/user-attachments/assets/af573bbc-abf9-4947-9ed6-955723b722f5\n\n\n## Why\n\nAgents constantly mention files: stack traces, changed tests, docs, configs,\nlinks, PRs. `termscope` lets you keep up without doing the little dance:\nselect text, copy, cd, paste, fix the path, add the line number.\n\nIf it's visible in the pane and exists in the repo, you can jump to it.\n\nTermscope stays conservative:\n\n- scans only the active pane's visible text\n- verifies paths against the repo/worktree on disk\n- preserves `file:line` targets\n- falls back to a full repo picker when no visible file matches\n- uses a session-modal Herdr popup, leaving the tiled pane layout untouched\n\n## Requirements\n\n- [Herdr](https://herdr.dev) `\u003e= 0.7.4` or tmux\n- Python `\u003e= 3.10`\n- [`fd`](https://github.com/sharkdp/fd)\n- [Homebrew](https://brew.sh) when a Herdr plugin install needs to add or upgrade Television\n- [Television](https://alexpasmantier.github.io/television/) `\u003e= 0.15` (provisioned automatically when needed)\n- [`bat`](https://github.com/sharkdp/bat) is optional for syntax-highlighted previews\n- `nvim` for the default file-open action\n- `open` on macOS or `xdg-open` on Linux for default-app opens\n\nNative Windows is not claimed yet. WSL may work through `wslview` when your WSL\nenvironment provides it.\n\n## Install as a Herdr plugin\n\n```bash\nherdr plugin install iurysza/termscope\n```\n\nThe install includes a visible build step that installs or upgrades Television\nthrough Homebrew when `tv` is missing or older than `0.15`. It never installs\nHomebrew itself; a missing Homebrew installation aborts cleanly before the\nplugin is registered.\n\nFor local development (`plugin link` does not run install-time build steps):\n\n```bash\ngit clone https://github.com/iurysza/termscope.git\ncd termscope\n./scripts/install-dependencies.sh\nherdr plugin link \"$PWD\"\n```\n\nVerify Herdr sees the actions:\n\n```bash\nherdr plugin action list --plugin termscope\n```\n\n## Bind keys in Herdr\n\nHerdr plugins register actions; keybindings still live in your\n`~/.config/herdr/config.toml`.\n\n```toml\n[[keys.command]]\nkey = \"ctrl+shift+a\"\ntype = \"plugin_action\"\ncommand = \"termscope.open\"\ndescription = \"visible-screen file picker\"\n\n[[keys.command]]\nkey = \"ctrl+e\"\ntype = \"plugin_action\"\ncommand = \"termscope.open-links\"\ndescription = \"visible-screen link picker\"\n```\n\nReload config:\n\n```bash\nherdr server reload-config\n```\n\n## Use it\n\n| Key | Action |\n| --- | --- |\n| `Ctrl-Shift-A` | Open visible file picker |\n| `Ctrl-E` | Open visible link picker |\n\nFile picker controls:\n\n| Key | Action |\n| --- | --- |\n| `Enter` | Open in a new Neovim split beside the source pane |\n| `Ctrl-O` | Open with the default app |\n| `Ctrl-Y` | Agent pane: send `/plannotator-annotate \u003cfile\u003e`; shell pane: run `plannotator annotate \u003cfile\u003e` |\n| `Ctrl-S` | Toggle appearance order / alphabetical sort |\n\nLink picker controls:\n\n| Key | Action |\n| --- | --- |\n| `Enter` | Open URL in the browser/default opener |\n| `Ctrl-Y` | Copy URL to clipboard |\n| `Ctrl-S` | Toggle appearance order / alphabetical sort |\n\n## tmux usage\n\nHerdr is the main plugin target, but the same picker works in tmux.\n\n```tmux\nset -g @termscope \"/path/to/termscope/termscope\"\n\nbind-key -n C-S-a run-shell \"tmux display-popup -E -w 80% -h 60% '#{@termscope} pick --pane-path #{q:pane_current_path} --pane-id #{q:pane_id}'\"\nbind-key -n C-e run-shell \"tmux display-popup -E -w 80% -h 60% '#{@termscope} links --pane-path #{q:pane_current_path} --pane-id #{q:pane_id}'\"\n\nbind-key -T copy-mode-vi C-S-a run-shell \"tmux display-popup -E -w 80% -h 60% '#{@termscope} pick --pane-path #{q:pane_current_path} --pane-id #{q:pane_id}'\"\nbind-key -T copy-mode-vi C-e run-shell \"tmux display-popup -E -w 80% -h 60% '#{@termscope} links --pane-path #{q:pane_current_path} --pane-id #{q:pane_id}'\"\n\nbind-key -T copy-mode-vi 'o' send -F -X copy-pipe-and-cancel \"#{@termscope} open --mode nvim --pane-path #{q:pane_current_path} --pane-id #{q:pane_id}\"\nbind-key -T copy-mode-vi 'O' send -F -X copy-pipe-and-cancel \"#{@termscope} open --mode default --pane-path #{q:pane_current_path} --pane-id #{q:pane_id}\"\nbind-key -T copy-mode-vi P run-shell \"tmux display-popup -E -w 80% -h 60% '#{@termscope} pick --pane-path #{q:pane_current_path} --pane-id #{q:pane_id}'\"\n```\n\nIn tmux copy-mode these bindings preserve the scrolled viewport instead of\njumping back to the live bottom of the pane.\n\n## Configuration\n\n| Environment variable | Purpose |\n| --- | --- |\n| `TERMSCOPE_OPENER` | Override default opener, e.g. `open -a Zen` or `open -a Firefox` |\n| `TERMSCOPE_SORT` | Default sort mode: `appearance` or `alpha` |\n| `TERMSCOPE_LOG` | Path to the JSON event log |\n| `TERMSCOPE_DEBUG_DIR` | Directory for per-run debug dumps |\n\nExamples:\n\n```bash\nexport TERMSCOPE_OPENER='open -a Zen'\nexport TERMSCOPE_SORT=alpha\n```\n\n## Dry run / debug\n\nSee what the scanner would offer without opening Television:\n\n```bash\n./termscope scan --pane-path \"$PWD\" --pane-id \"$HERDR_PANE_ID\" --multiplexer herdr\n```\n\nEnable debug dumps:\n\n```bash\nexport TERMSCOPE_DEBUG_DIR=/tmp/termscope-debug\n```\n\nEach run writes the captured screen, indexed files, candidates, and final\nselection decision.\n\n## How it works\n\nHerdr plugin actions run without a TTY, so `termscope.open` first opens an\n`80% × 60%` session-modal popup. The popup inherits the source pane id/cwd,\ncaptures visible text with `herdr pane read --source visible`, scans the repo\nwith `fd`, and runs Television. Two bundled channels let `Ctrl-S` cycle between\nappearance and alphabetical order. File previews use `bat` when available and a\nbuilt-in text preview otherwise.\n\nWhen you choose a file, Termscope asks Herdr to split beside the source pane and\nruns `nvim +line path`. For URLs, it uses the default opener unless\n`TERMSCOPE_OPENER` is set.\n\n## Development\n\n```bash\npython3 -m py_compile termscope termscope_herdr.py\npython3 -m unittest discover -s tests\nherdr plugin link \"$PWD\"\nherdr plugin action invoke termscope.open\n```\n\nThe repo intentionally has no package manager or build step. Herdr installs it\nby cloning the repo and reading `herdr-plugin.toml`.\n\n## License\n\n[MIT](LICENSE) © iury souza\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiurysza%2Ftermscope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiurysza%2Ftermscope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiurysza%2Ftermscope/lists"}