A lightweight TUI to scan, search, and manage local git repositories
Project description
Blink
轻量级终端 TUI 工具,用于扫描、搜索和管理本地 git 仓库。
功能
- 自动发现配置目录下的所有 git 仓库
- 按名称、路径、描述或远程 URL 实时搜索
- 一键用 VSCode / Cursor / Antigravity / 系统默认方式打开仓库
- 复制仓库路径到剪贴板
- 后台重新扫描,无需退出 TUI
安装
pip install blink-repo
使用
blink # 启动 TUI
blink --rescan # 强制重新扫描后启动
首次运行
首次启动时,Blink 会扫描主目录下的 git 仓库并在终端显示进度。扫描完成后自动打开 TUI,展示所有已发现的仓库。
后续启动会直接使用缓存数据打开 TUI,同时自动清理磁盘上已不存在的失效条目。
TUI 快捷键
| 按键 | 功能 |
|---|---|
j / ↓ |
向下移动 |
k / ↑ |
向上移动 |
/ |
聚焦搜索栏 |
Enter |
查看仓库详情(开发中) |
v |
用 VSCode 打开 |
u |
用 Cursor 打开 |
a |
用 Antigravity 打开 |
o |
用系统默认方式打开(Finder) |
y |
复制仓库路径到剪贴板 |
r |
重新扫描文件系统 |
Esc |
清空搜索,或搜索为空时退出 |
q |
退出 |
搜索
按 / 聚焦搜索栏,输入内容即可实时过滤仓库。搜索范围涵盖名称、别名、描述、路径和远程 URL,大小写不敏感。
配置
首次运行时,Blink 会在 ~/.blink/config.json 创建默认配置:
{
"scan_paths": ["~"],
"exclude_dirs": [".Trash", ".cache", ".npm", ".docker", ".vscode", "Library", "Applications", "node_modules", "__pycache__"],
"editor": "code",
"auto_sync_days": 0
}
| 字段 | 说明 |
|---|---|
scan_paths |
扫描 git 仓库的根目录列表 |
exclude_dirs |
扫描时跳过的目录名 |
editor |
默认编辑器命令 |
auto_sync_days |
自动重新扫描间隔天数(0 为禁用) |
所有数据存储在 ~/.blink/ 目录下:
config.json— 用户配置blink.db— SQLite 数据库,存储仓库和远程信息
开发
环境要求
初始化
git clone <repo-url> blink && cd blink
uv sync
运行
uv run blink # 启动 TUI
uv run blink --rescan # 强制重新扫描
测试
uv run pytest
调试
在源码任意位置插入 breakpoint(),然后执行 uv run blink,程序会在断点处暂停并进入 pdb 交互调试。
发布
uv build # 构建分发包
uv publish # 发布到 PyPI
许可证
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blink_repo-0.1.0.tar.gz.
File metadata
- Download URL: blink_repo-0.1.0.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f2c0dda18a719cee11f494349cc5b94dd81371daaa6a43b1058a551750a0d74
|
|
| MD5 |
a2b86275a112b9a75fbb04a2ce70a9cc
|
|
| BLAKE2b-256 |
9fcecbc3a6a12a2779fe651f3f652a58c53f0cf7a429b4487df04cb9ee42749e
|
File details
Details for the file blink_repo-0.1.0-py3-none-any.whl.
File metadata
- Download URL: blink_repo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d80bfefdc9adb5a52e1fd09e891d355fac22ae252066748f557b7014e8781fb1
|
|
| MD5 |
ef7b81846dd487f8e4b2363ad7e0e02d
|
|
| BLAKE2b-256 |
6f778e90ca31bcecad0492d3ae4d5a68e7192566b60eda9af550d22a7de26f04
|