bunnify 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bunnify-0.2.0/.gitignore +70 -0
- bunnify-0.2.0/LICENSE +21 -0
- bunnify-0.2.0/PKG-INFO +222 -0
- bunnify-0.2.0/README.md +204 -0
- bunnify-0.2.0/app/__init__.py +0 -0
- bunnify-0.2.0/app/asgi.py +16 -0
- bunnify-0.2.0/app/cli.py +921 -0
- bunnify-0.2.0/app/client.py +228 -0
- bunnify-0.2.0/app/config.py +403 -0
- bunnify-0.2.0/app/data/__init__.py +1 -0
- bunnify-0.2.0/app/data/bookmarks.example.json +42 -0
- bunnify-0.2.0/app/github_complete.py +796 -0
- bunnify-0.2.0/app/interactive.py +622 -0
- bunnify-0.2.0/app/local_server.py +124 -0
- bunnify-0.2.0/app/server_cli.py +458 -0
- bunnify-0.2.0/app/settings.py +188 -0
- bunnify-0.2.0/app/tests.py +160 -0
- bunnify-0.2.0/app/theme.py +81 -0
- bunnify-0.2.0/app/urls.py +7 -0
- bunnify-0.2.0/app/usage.py +94 -0
- bunnify-0.2.0/app/version.py +67 -0
- bunnify-0.2.0/app/wsgi.py +16 -0
- bunnify-0.2.0/bookmarks/__init__.py +0 -0
- bunnify-0.2.0/bookmarks/admin.py +1 -0
- bunnify-0.2.0/bookmarks/apps.py +5 -0
- bunnify-0.2.0/bookmarks/keys_catalog.py +54 -0
- bunnify-0.2.0/bookmarks/management/__init__.py +0 -0
- bunnify-0.2.0/bookmarks/management/commands/__init__.py +0 -0
- bunnify-0.2.0/bookmarks/management/commands/check_database.py +190 -0
- bunnify-0.2.0/bookmarks/management/commands/load_bookmarks.py +127 -0
- bunnify-0.2.0/bookmarks/management/commands/watch_bookmarks.py +106 -0
- bunnify-0.2.0/bookmarks/migrations/0001_initial.py +34 -0
- bunnify-0.2.0/bookmarks/migrations/0002_bookmark_defaults.py +18 -0
- bunnify-0.2.0/bookmarks/migrations/__init__.py +0 -0
- bunnify-0.2.0/bookmarks/models.py +21 -0
- bunnify-0.2.0/bookmarks/resolve.py +259 -0
- bunnify-0.2.0/bookmarks/templates/bookmarks/base.html +96 -0
- bunnify-0.2.0/bookmarks/templates/bookmarks/browser_url.html +75 -0
- bunnify-0.2.0/bookmarks/templates/bookmarks/cmd.html +642 -0
- bunnify-0.2.0/bookmarks/templates/bookmarks/copilot_review.html +96 -0
- bunnify-0.2.0/bookmarks/templates/bookmarks/index.html +80 -0
- bunnify-0.2.0/bookmarks/templates/bookmarks/list.html +162 -0
- bunnify-0.2.0/bookmarks/templates/bookmarks/opensearch.xml +8 -0
- bunnify-0.2.0/bookmarks/test_cli.py +2522 -0
- bunnify-0.2.0/bookmarks/tests.py +282 -0
- bunnify-0.2.0/bookmarks/urls.py +20 -0
- bunnify-0.2.0/bookmarks/views.py +378 -0
- bunnify-0.2.0/pyproject.toml +68 -0
bunnify-0.2.0/.gitignore
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
pip-wheel-metadata/
|
|
20
|
+
share/python-wheels/
|
|
21
|
+
*.egg-info/
|
|
22
|
+
.installed.cfg
|
|
23
|
+
*.egg
|
|
24
|
+
MANIFEST
|
|
25
|
+
|
|
26
|
+
# Virtual Environment
|
|
27
|
+
.venv/
|
|
28
|
+
|
|
29
|
+
# Django
|
|
30
|
+
*.log
|
|
31
|
+
db.sqlite3
|
|
32
|
+
db.sqlite3-journal
|
|
33
|
+
/static/
|
|
34
|
+
/media/
|
|
35
|
+
*.pot
|
|
36
|
+
local_settings.py
|
|
37
|
+
|
|
38
|
+
# IDE
|
|
39
|
+
.vscode/
|
|
40
|
+
.idea/
|
|
41
|
+
*.swp
|
|
42
|
+
*.swo
|
|
43
|
+
*~
|
|
44
|
+
.DS_Store
|
|
45
|
+
|
|
46
|
+
# Environment variables
|
|
47
|
+
.env
|
|
48
|
+
.env.local
|
|
49
|
+
/bunnify.json
|
|
50
|
+
bunnify.env
|
|
51
|
+
|
|
52
|
+
# Logs
|
|
53
|
+
/tmp/bunnify.log*
|
|
54
|
+
*.log
|
|
55
|
+
|
|
56
|
+
# Testing
|
|
57
|
+
.coverage
|
|
58
|
+
.pytest_cache/
|
|
59
|
+
htmlcov/
|
|
60
|
+
|
|
61
|
+
# uv
|
|
62
|
+
.python-version
|
|
63
|
+
|
|
64
|
+
# Temporary files
|
|
65
|
+
*.tmp
|
|
66
|
+
temp_settings_patch.py
|
|
67
|
+
test_redirects.sh
|
|
68
|
+
.bunnify.pid
|
|
69
|
+
.bunnify_watcher.pid
|
|
70
|
+
.worktrees/
|
bunnify-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 thehcma
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
bunnify-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: bunnify
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Smart bookmark manager and URL shortcut system
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.14
|
|
7
|
+
Requires-Dist: asgiref==3.12.1
|
|
8
|
+
Requires-Dist: click>=8.4.2
|
|
9
|
+
Requires-Dist: django>=6.0.7
|
|
10
|
+
Requires-Dist: jsonschema>=4.26.0
|
|
11
|
+
Requires-Dist: packaging==26.2
|
|
12
|
+
Requires-Dist: pathspec==1.1.1
|
|
13
|
+
Requires-Dist: platformdirs>=4.11.0
|
|
14
|
+
Requires-Dist: prompt-toolkit>=3.0.53
|
|
15
|
+
Requires-Dist: rpds-py>=2026.6.3
|
|
16
|
+
Requires-Dist: typing-extensions==4.16.0
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# Bunnify 🐰
|
|
20
|
+
|
|
21
|
+
A Python bookmark manager and URL shortcut system: terminal CLI, web command
|
|
22
|
+
palette, Chrome OpenSearch integration, and parameterized redirects.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
[pipx](https://pipx.pypa.io/) is the recommended path for end users:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pipx install bunnify
|
|
30
|
+
pipx ensurepath # adds ~/.local/bin to PATH if needed (restart the shell)
|
|
31
|
+
bunnify --version
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
pipx installs `bunnify` and `bunnify-server` under **`~/.local/bin`** by default
|
|
35
|
+
(or `$PIPX_BIN_DIR` when set). Ensure that directory is on your `PATH` before
|
|
36
|
+
running either command.
|
|
37
|
+
|
|
38
|
+
The wheel installs **`bunnify`** (CLI) and **`bunnify-server`** (Django
|
|
39
|
+
server). No repository checkout or `uv` is required at runtime.
|
|
40
|
+
|
|
41
|
+
## Quick start
|
|
42
|
+
|
|
43
|
+
### 1. Create your bookmarks file
|
|
44
|
+
|
|
45
|
+
Download the [documented example](https://github.com/the-hcma/bunnify/blob/main/bunnify.json.example)
|
|
46
|
+
into XDG config (required before the server starts):
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
mkdir -p ~/.config/bunnify
|
|
50
|
+
curl -fsSL https://raw.githubusercontent.com/the-hcma/bunnify/main/bunnify.json.example \
|
|
51
|
+
-o ~/.config/bunnify/bookmarks.json
|
|
52
|
+
# edit ~/.config/bunnify/bookmarks.json with your shortcuts
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
See [Configuration](docs/CONFIG.md) for overrides (`BUNNIFY_BOOKMARKS`,
|
|
56
|
+
`XDG_CONFIG_HOME`).
|
|
57
|
+
|
|
58
|
+
### 2. Configure local or remote mode
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
bunnify setup
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Laptop / daily machine:** choose **local** (default). Setup starts a managed
|
|
65
|
+
server, verifies `/health`, records the port, and saves settings to
|
|
66
|
+
`~/.config/bunnify/config.env`. Point Chrome at the same `BUNNIFY_BASE_URL`
|
|
67
|
+
([Chrome setup](CHROME_SETUP.md)).
|
|
68
|
+
|
|
69
|
+
**Home server / always-on host:** choose **remote** on client devices and enter
|
|
70
|
+
that host’s URL. Prefer a centralized remote install when several machines share
|
|
71
|
+
one server — not as a laptop’s only dependency if you often go offline.
|
|
72
|
+
|
|
73
|
+
One-time override without saving: `bunnify --base-url https://… shortcut`.
|
|
74
|
+
|
|
75
|
+
Details: [Local and remote setup](docs/LOCAL.md).
|
|
76
|
+
|
|
77
|
+
### 3. Run shortcuts
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
bunnify # interactive REPL (Tab completion, history)
|
|
81
|
+
bunnify gh # open a shortcut in the browser
|
|
82
|
+
bunnify pr the-hcma/bunnify 272 # parameterized shortcut
|
|
83
|
+
bunnify --fzf # fuzzy picker
|
|
84
|
+
bunnify --print-url gh
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Unknown keys exit non-zero in direct mode (no search-engine fallback).
|
|
88
|
+
|
|
89
|
+
## Features
|
|
90
|
+
|
|
91
|
+
- **CLI / REPL** — fuzzy Tab completion, fzf mode, Vim/Emacs edit keys
|
|
92
|
+
- **Web** — `/cmd/` command palette, `/list/` browser, smart `/search/`
|
|
93
|
+
- **Chrome** — OpenSearch at `/opensearch.xml` ([setup guide](CHROME_SETUP.md))
|
|
94
|
+
- **Parameters** — URLs with `#{name}` placeholders and optional defaults
|
|
95
|
+
- **Copilot reviews** — `rpr` shortcut streams in-app PR reviews
|
|
96
|
+
- **Validation** — JSON Schema on load; reserved keys `h` / `help`
|
|
97
|
+
|
|
98
|
+
## Server lifecycle
|
|
99
|
+
|
|
100
|
+
Installed users manage the server with **`bunnify-server`**:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
bunnify-server --help
|
|
104
|
+
# Foreground (systemd, LaunchAgent, debugging):
|
|
105
|
+
bunnify-server --foreground --noninteractive --port 8000
|
|
106
|
+
# Background managed daemon (returns after fork):
|
|
107
|
+
bunnify-server --port 8000 --noninteractive --pid-dir ~/.local/share/bunnify/run
|
|
108
|
+
bunnify-server --stop --pid-dir ~/.local/share/bunnify/run
|
|
109
|
+
curl --max-time 2 http://127.0.0.1:8000/health
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
`bunnify setup` starts a managed local server for daily CLI use. Details:
|
|
113
|
+
[Local and remote setup](docs/LOCAL.md).
|
|
114
|
+
|
|
115
|
+
**Linux production:** [systemd user service](docs/SYSTEMD.md) via
|
|
116
|
+
`setup-service` from [repository-helpers](https://github.com/the-hcma/repository-helpers).
|
|
117
|
+
|
|
118
|
+
**macOS:** [LaunchAgent example](etc/launchd/com.thehcma.bunnify.plist.example).
|
|
119
|
+
|
|
120
|
+
## Web usage
|
|
121
|
+
|
|
122
|
+
With the server running (default `http://127.0.0.1:8000` after setup):
|
|
123
|
+
|
|
124
|
+
| URL | Purpose |
|
|
125
|
+
|-----|---------|
|
|
126
|
+
| `/cmd/` | Command palette (recommended) |
|
|
127
|
+
| `/search/?q=pr+12345` | Smart search |
|
|
128
|
+
| `/list/` | Browse all bookmarks |
|
|
129
|
+
| `/<key>/` | Direct redirect |
|
|
130
|
+
| `/opensearch.xml` | Chrome search engine descriptor |
|
|
131
|
+
|
|
132
|
+
## Bookmarks format
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"gh": {
|
|
137
|
+
"description": "GitHub",
|
|
138
|
+
"url": "https://github.com/"
|
|
139
|
+
},
|
|
140
|
+
"pr": {
|
|
141
|
+
"description": "Pull request",
|
|
142
|
+
"url": "https://github.com/#{repo}/pull/#{pr_number}",
|
|
143
|
+
"defaults": { "repo": "org/repo" }
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Required fields: `description`, `url`. Placeholders use `#{parameter_name}`.
|
|
149
|
+
Reload after edits: the server watches the JSON file, or run
|
|
150
|
+
`load_bookmarks` in a development checkout.
|
|
151
|
+
|
|
152
|
+
## Development checkout
|
|
153
|
+
|
|
154
|
+
Contributors clone the repo and use `uv` — separate from the pipx path above.
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
git clone https://github.com/thehcma/bunnify.git
|
|
158
|
+
cd bunnify
|
|
159
|
+
uv sync
|
|
160
|
+
uv run python manage.py migrate
|
|
161
|
+
|
|
162
|
+
mkdir -p ~/.config/bunnify
|
|
163
|
+
cp bunnify.json.example ~/.config/bunnify/bookmarks.json
|
|
164
|
+
|
|
165
|
+
./scripts/bunnify setup
|
|
166
|
+
./scripts/bunnify-server --console --log-level DEBUG # optional
|
|
167
|
+
./test_bunnify
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Full guidelines: [CONTRIBUTING.md](CONTRIBUTING.md). Quality gates:
|
|
171
|
+
`./scripts/checks`.
|
|
172
|
+
|
|
173
|
+
Wrappers under `./scripts/` prefer `uv run` when `uv` is on `PATH`, otherwise
|
|
174
|
+
the checkout `.venv` (same entry points systemd uses on service hosts).
|
|
175
|
+
|
|
176
|
+
## Documentation
|
|
177
|
+
|
|
178
|
+
| Doc | Audience |
|
|
179
|
+
|-----|----------|
|
|
180
|
+
| [CONFIG.md](docs/CONFIG.md) | XDG paths and environment variables |
|
|
181
|
+
| [LOCAL.md](docs/LOCAL.md) | Local vs remote setup, ports, LaunchAgent |
|
|
182
|
+
| [SYSTEMD.md](docs/SYSTEMD.md) | Linux user service |
|
|
183
|
+
| [CHROME_SETUP.md](CHROME_SETUP.md) | Browser search engine |
|
|
184
|
+
| [QUICK_REFERENCE.md](QUICK_REFERENCE.md) | Cheat sheet |
|
|
185
|
+
| [RELEASING.md](docs/RELEASING.md) | Maintainers: PyPI releases |
|
|
186
|
+
|
|
187
|
+
## Troubleshooting
|
|
188
|
+
|
|
189
|
+
**Server won't start**
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
bunnify-server --console --log-level DEBUG
|
|
193
|
+
# or in a checkout: ./scripts/bunnify-server --console
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Bookmarks missing**
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
ls -l ~/.config/bunnify/bookmarks.json
|
|
200
|
+
# create from bunnify.json.example if absent — see Quick start
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**CLI can't reach server**
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
bunnify setup
|
|
207
|
+
curl -sf "$(grep BUNNIFY_BASE_URL ~/.config/bunnify/config.env | cut -d= -f2-)/health"
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Stale managed process**
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
bunnify-server --stop --pid-dir ~/.local/share/bunnify/run
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Releasing
|
|
217
|
+
|
|
218
|
+
Maintainers: [docs/RELEASING.md](docs/RELEASING.md) (Release Please + PyPI).
|
|
219
|
+
|
|
220
|
+
## License
|
|
221
|
+
|
|
222
|
+
MIT — see [LICENSE](LICENSE).
|
bunnify-0.2.0/README.md
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# Bunnify 🐰
|
|
2
|
+
|
|
3
|
+
A Python bookmark manager and URL shortcut system: terminal CLI, web command
|
|
4
|
+
palette, Chrome OpenSearch integration, and parameterized redirects.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
[pipx](https://pipx.pypa.io/) is the recommended path for end users:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pipx install bunnify
|
|
12
|
+
pipx ensurepath # adds ~/.local/bin to PATH if needed (restart the shell)
|
|
13
|
+
bunnify --version
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
pipx installs `bunnify` and `bunnify-server` under **`~/.local/bin`** by default
|
|
17
|
+
(or `$PIPX_BIN_DIR` when set). Ensure that directory is on your `PATH` before
|
|
18
|
+
running either command.
|
|
19
|
+
|
|
20
|
+
The wheel installs **`bunnify`** (CLI) and **`bunnify-server`** (Django
|
|
21
|
+
server). No repository checkout or `uv` is required at runtime.
|
|
22
|
+
|
|
23
|
+
## Quick start
|
|
24
|
+
|
|
25
|
+
### 1. Create your bookmarks file
|
|
26
|
+
|
|
27
|
+
Download the [documented example](https://github.com/the-hcma/bunnify/blob/main/bunnify.json.example)
|
|
28
|
+
into XDG config (required before the server starts):
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
mkdir -p ~/.config/bunnify
|
|
32
|
+
curl -fsSL https://raw.githubusercontent.com/the-hcma/bunnify/main/bunnify.json.example \
|
|
33
|
+
-o ~/.config/bunnify/bookmarks.json
|
|
34
|
+
# edit ~/.config/bunnify/bookmarks.json with your shortcuts
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
See [Configuration](docs/CONFIG.md) for overrides (`BUNNIFY_BOOKMARKS`,
|
|
38
|
+
`XDG_CONFIG_HOME`).
|
|
39
|
+
|
|
40
|
+
### 2. Configure local or remote mode
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
bunnify setup
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Laptop / daily machine:** choose **local** (default). Setup starts a managed
|
|
47
|
+
server, verifies `/health`, records the port, and saves settings to
|
|
48
|
+
`~/.config/bunnify/config.env`. Point Chrome at the same `BUNNIFY_BASE_URL`
|
|
49
|
+
([Chrome setup](CHROME_SETUP.md)).
|
|
50
|
+
|
|
51
|
+
**Home server / always-on host:** choose **remote** on client devices and enter
|
|
52
|
+
that host’s URL. Prefer a centralized remote install when several machines share
|
|
53
|
+
one server — not as a laptop’s only dependency if you often go offline.
|
|
54
|
+
|
|
55
|
+
One-time override without saving: `bunnify --base-url https://… shortcut`.
|
|
56
|
+
|
|
57
|
+
Details: [Local and remote setup](docs/LOCAL.md).
|
|
58
|
+
|
|
59
|
+
### 3. Run shortcuts
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
bunnify # interactive REPL (Tab completion, history)
|
|
63
|
+
bunnify gh # open a shortcut in the browser
|
|
64
|
+
bunnify pr the-hcma/bunnify 272 # parameterized shortcut
|
|
65
|
+
bunnify --fzf # fuzzy picker
|
|
66
|
+
bunnify --print-url gh
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Unknown keys exit non-zero in direct mode (no search-engine fallback).
|
|
70
|
+
|
|
71
|
+
## Features
|
|
72
|
+
|
|
73
|
+
- **CLI / REPL** — fuzzy Tab completion, fzf mode, Vim/Emacs edit keys
|
|
74
|
+
- **Web** — `/cmd/` command palette, `/list/` browser, smart `/search/`
|
|
75
|
+
- **Chrome** — OpenSearch at `/opensearch.xml` ([setup guide](CHROME_SETUP.md))
|
|
76
|
+
- **Parameters** — URLs with `#{name}` placeholders and optional defaults
|
|
77
|
+
- **Copilot reviews** — `rpr` shortcut streams in-app PR reviews
|
|
78
|
+
- **Validation** — JSON Schema on load; reserved keys `h` / `help`
|
|
79
|
+
|
|
80
|
+
## Server lifecycle
|
|
81
|
+
|
|
82
|
+
Installed users manage the server with **`bunnify-server`**:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
bunnify-server --help
|
|
86
|
+
# Foreground (systemd, LaunchAgent, debugging):
|
|
87
|
+
bunnify-server --foreground --noninteractive --port 8000
|
|
88
|
+
# Background managed daemon (returns after fork):
|
|
89
|
+
bunnify-server --port 8000 --noninteractive --pid-dir ~/.local/share/bunnify/run
|
|
90
|
+
bunnify-server --stop --pid-dir ~/.local/share/bunnify/run
|
|
91
|
+
curl --max-time 2 http://127.0.0.1:8000/health
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`bunnify setup` starts a managed local server for daily CLI use. Details:
|
|
95
|
+
[Local and remote setup](docs/LOCAL.md).
|
|
96
|
+
|
|
97
|
+
**Linux production:** [systemd user service](docs/SYSTEMD.md) via
|
|
98
|
+
`setup-service` from [repository-helpers](https://github.com/the-hcma/repository-helpers).
|
|
99
|
+
|
|
100
|
+
**macOS:** [LaunchAgent example](etc/launchd/com.thehcma.bunnify.plist.example).
|
|
101
|
+
|
|
102
|
+
## Web usage
|
|
103
|
+
|
|
104
|
+
With the server running (default `http://127.0.0.1:8000` after setup):
|
|
105
|
+
|
|
106
|
+
| URL | Purpose |
|
|
107
|
+
|-----|---------|
|
|
108
|
+
| `/cmd/` | Command palette (recommended) |
|
|
109
|
+
| `/search/?q=pr+12345` | Smart search |
|
|
110
|
+
| `/list/` | Browse all bookmarks |
|
|
111
|
+
| `/<key>/` | Direct redirect |
|
|
112
|
+
| `/opensearch.xml` | Chrome search engine descriptor |
|
|
113
|
+
|
|
114
|
+
## Bookmarks format
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"gh": {
|
|
119
|
+
"description": "GitHub",
|
|
120
|
+
"url": "https://github.com/"
|
|
121
|
+
},
|
|
122
|
+
"pr": {
|
|
123
|
+
"description": "Pull request",
|
|
124
|
+
"url": "https://github.com/#{repo}/pull/#{pr_number}",
|
|
125
|
+
"defaults": { "repo": "org/repo" }
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Required fields: `description`, `url`. Placeholders use `#{parameter_name}`.
|
|
131
|
+
Reload after edits: the server watches the JSON file, or run
|
|
132
|
+
`load_bookmarks` in a development checkout.
|
|
133
|
+
|
|
134
|
+
## Development checkout
|
|
135
|
+
|
|
136
|
+
Contributors clone the repo and use `uv` — separate from the pipx path above.
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
git clone https://github.com/thehcma/bunnify.git
|
|
140
|
+
cd bunnify
|
|
141
|
+
uv sync
|
|
142
|
+
uv run python manage.py migrate
|
|
143
|
+
|
|
144
|
+
mkdir -p ~/.config/bunnify
|
|
145
|
+
cp bunnify.json.example ~/.config/bunnify/bookmarks.json
|
|
146
|
+
|
|
147
|
+
./scripts/bunnify setup
|
|
148
|
+
./scripts/bunnify-server --console --log-level DEBUG # optional
|
|
149
|
+
./test_bunnify
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Full guidelines: [CONTRIBUTING.md](CONTRIBUTING.md). Quality gates:
|
|
153
|
+
`./scripts/checks`.
|
|
154
|
+
|
|
155
|
+
Wrappers under `./scripts/` prefer `uv run` when `uv` is on `PATH`, otherwise
|
|
156
|
+
the checkout `.venv` (same entry points systemd uses on service hosts).
|
|
157
|
+
|
|
158
|
+
## Documentation
|
|
159
|
+
|
|
160
|
+
| Doc | Audience |
|
|
161
|
+
|-----|----------|
|
|
162
|
+
| [CONFIG.md](docs/CONFIG.md) | XDG paths and environment variables |
|
|
163
|
+
| [LOCAL.md](docs/LOCAL.md) | Local vs remote setup, ports, LaunchAgent |
|
|
164
|
+
| [SYSTEMD.md](docs/SYSTEMD.md) | Linux user service |
|
|
165
|
+
| [CHROME_SETUP.md](CHROME_SETUP.md) | Browser search engine |
|
|
166
|
+
| [QUICK_REFERENCE.md](QUICK_REFERENCE.md) | Cheat sheet |
|
|
167
|
+
| [RELEASING.md](docs/RELEASING.md) | Maintainers: PyPI releases |
|
|
168
|
+
|
|
169
|
+
## Troubleshooting
|
|
170
|
+
|
|
171
|
+
**Server won't start**
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
bunnify-server --console --log-level DEBUG
|
|
175
|
+
# or in a checkout: ./scripts/bunnify-server --console
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Bookmarks missing**
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
ls -l ~/.config/bunnify/bookmarks.json
|
|
182
|
+
# create from bunnify.json.example if absent — see Quick start
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**CLI can't reach server**
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
bunnify setup
|
|
189
|
+
curl -sf "$(grep BUNNIFY_BASE_URL ~/.config/bunnify/config.env | cut -d= -f2-)/health"
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Stale managed process**
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
bunnify-server --stop --pid-dir ~/.local/share/bunnify/run
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Releasing
|
|
199
|
+
|
|
200
|
+
Maintainers: [docs/RELEASING.md](docs/RELEASING.md) (Release Please + PyPI).
|
|
201
|
+
|
|
202
|
+
## License
|
|
203
|
+
|
|
204
|
+
MIT — see [LICENSE](LICENSE).
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ASGI config for bunnify project.
|
|
3
|
+
|
|
4
|
+
It exposes the ASGI callable as a module-level variable named ``application``.
|
|
5
|
+
|
|
6
|
+
For more information on this file, see
|
|
7
|
+
https://docs.djangoproject.com/en/6.0/howto/deployment/asgi/
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import os
|
|
11
|
+
|
|
12
|
+
from django.core.asgi import get_asgi_application
|
|
13
|
+
|
|
14
|
+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")
|
|
15
|
+
|
|
16
|
+
application = get_asgi_application()
|