bearcli 1.0.0__py3-none-any.whl
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.
- bearcli/__init__.py +0 -0
- bearcli/actions.py +71 -0
- bearcli/cli.py +788 -0
- bearcli/db.py +260 -0
- bearcli/export.py +250 -0
- bearcli/search.py +121 -0
- bearcli-1.0.0.dist-info/METADATA +159 -0
- bearcli-1.0.0.dist-info/RECORD +11 -0
- bearcli-1.0.0.dist-info/WHEEL +4 -0
- bearcli-1.0.0.dist-info/entry_points.txt +3 -0
- bearcli-1.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bearcli
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: The missing CLI for Bear notes — read, search, export, and manage your notes from the terminal
|
|
5
|
+
Keywords: bear,notes,cli,markdown,macos
|
|
6
|
+
Author: Michel Tricot
|
|
7
|
+
Author-email: Michel Tricot <michel.tricot@gmail.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Topic :: Utilities
|
|
15
|
+
Requires-Dist: rapidfuzz>=3.14.5
|
|
16
|
+
Requires-Dist: typer>=0.27.0
|
|
17
|
+
Requires-Python: >=3.13
|
|
18
|
+
Project-URL: Documentation, https://github.com/michel-tricot/bearcli/blob/main/docs/IMPLEMENTATION.md
|
|
19
|
+
Project-URL: Homepage, https://michel-tricot.github.io/bearcli/
|
|
20
|
+
Project-URL: Repository, https://github.com/michel-tricot/bearcli
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
<div align="center">
|
|
24
|
+
|
|
25
|
+
# 🐻 bearcli
|
|
26
|
+
|
|
27
|
+
**The missing CLI for [Bear](https://bear.app) notes** — read, search, export, and
|
|
28
|
+
manage your notes from the terminal.
|
|
29
|
+
|
|
30
|
+
[](https://github.com/michel-tricot/bearcli/actions/workflows/ci.yml)
|
|
31
|
+
[](LICENSE)
|
|
32
|
+
[](pyproject.toml)
|
|
33
|
+
[](#)
|
|
34
|
+
|
|
35
|
+
[**Website**](https://michel-tricot.github.io/bearcli/) ·
|
|
36
|
+
[Commands](#commands) ·
|
|
37
|
+
[How it works](docs/IMPLEMENTATION.md)
|
|
38
|
+
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
Bear stores your notes in a local SQLite database. bearcli reads it directly in
|
|
44
|
+
**read-only mode** — Bear doesn't even need to be running — and performs every
|
|
45
|
+
write through Bear's own x-callback-url API, verifying each change against the
|
|
46
|
+
database. Your notes are never touched behind Bear's back.
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
uv tool install bearcli # or: uvx bearcli, pipx install bearcli
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Or from a clone: `uv sync`, then `uv run bearcli --help`.
|
|
55
|
+
|
|
56
|
+
## Quick start
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
bearcli list # 20 most recently modified notes
|
|
60
|
+
bearcli search "quarterly report" # search titles, tags, and content
|
|
61
|
+
bearcli get <note-id> # print a note's markdown
|
|
62
|
+
bearcli create "Idea" --tag inbox # create a note
|
|
63
|
+
bearcli export ~/bear-backup # export everything as markdown folders
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Commands
|
|
67
|
+
|
|
68
|
+
Commands are grouped under `note` and `tag`; the most common ones (`list`,
|
|
69
|
+
`search`, `get`, `open`, `create`) also work directly as shortcuts.
|
|
70
|
+
|
|
71
|
+
### Browse & read
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
bearcli note list # 20 most recently modified
|
|
75
|
+
bearcli note list --limit 5 --tag work # filters: tag (incl. nested), dates...
|
|
76
|
+
bearcli note list --modified-after 2026-07-01
|
|
77
|
+
bearcli note list --only pinned # or: encrypted, trashed, archived
|
|
78
|
+
bearcli note list --all --trashed --archived
|
|
79
|
+
bearcli note list --ids # only identifiers, one per line
|
|
80
|
+
|
|
81
|
+
bearcli get C44D09DC-7F0E-43BB-BEB8-67E3A389A448
|
|
82
|
+
bearcli get C44D09DC-... --meta # with YAML-style frontmatter
|
|
83
|
+
bearcli get C44D09DC-... -r # rewrite attachment refs to absolute paths
|
|
84
|
+
bearcli open C44D09DC-... # open in the Bear app
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Search
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
bearcli search "invoice" --tag work -n 5 # case-insensitive substring
|
|
91
|
+
bearcli search "quarterly planing" --fuzzy # typo-tolerant, ranked by score
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Write
|
|
95
|
+
|
|
96
|
+
Writes go through Bear's x-callback-url API — the database itself is never
|
|
97
|
+
written. These launch the Bear app if needed.
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
bearcli create "Meeting notes" --text "agenda..." --tag work
|
|
101
|
+
echo "follow-up item" | bearcli note append C44D09DC-...
|
|
102
|
+
bearcli note rename C44D09DC-... "New title"
|
|
103
|
+
bearcli get C44D09DC-... | sed 's/foo/bar/' | bearcli note replace C44D09DC-...
|
|
104
|
+
bearcli note attach C44D09DC-... screenshot.png # ≤500 KB
|
|
105
|
+
bearcli note archive C44D09DC-...
|
|
106
|
+
bearcli note trash C44D09DC-...
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Tags
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
bearcli tag list # all tags with note counts
|
|
113
|
+
bearcli note tag C44D09DC-... "work/ideas" # add a tag to a note
|
|
114
|
+
bearcli note untag C44D09DC-... "work/ideas" # remove a tag from a note
|
|
115
|
+
bearcli tag rename old-name new-name # across all notes
|
|
116
|
+
bearcli tag delete old-name # across all notes (asks first)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Export
|
|
120
|
+
|
|
121
|
+
Every note becomes a self-contained directory — `<slug>/README.md` plus its
|
|
122
|
+
attachments — with a generated index, so GitHub renders the whole export as a
|
|
123
|
+
browsable tree.
|
|
124
|
+
|
|
125
|
+
```sh
|
|
126
|
+
bearcli export ~/bear-backup
|
|
127
|
+
bearcli export ~/bear-backup --sync # only rewrite notes that changed
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Scripting
|
|
131
|
+
|
|
132
|
+
Every listing takes `--format` / `-f`: `table` (default), `json`, or
|
|
133
|
+
tab-separated `text` built for pipes.
|
|
134
|
+
|
|
135
|
+
```sh
|
|
136
|
+
bearcli list -f json | jq -r '.[].title'
|
|
137
|
+
bearcli list -f text | cut -f1 # text is: id, modified, tags, status, title
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Dates use ISO format (`2026-07-01` or `2026-07-01T14:30`). The database path
|
|
141
|
+
defaults to Bear's standard location and can be overridden with `--db` or the
|
|
142
|
+
`BEAR_DB_PATH` environment variable. Encrypted notes are listed but their
|
|
143
|
+
content cannot be read.
|
|
144
|
+
|
|
145
|
+
## Development
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
uv sync
|
|
149
|
+
uv run ruff format src/ && uv run ruff check src/
|
|
150
|
+
uv run ty check src/
|
|
151
|
+
uv run python scripts/check_docs.py # docs must cover every command
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Design notes and Bear database internals: [docs/IMPLEMENTATION.md](docs/IMPLEMENTATION.md).
|
|
155
|
+
Contributor/agent guidelines: [AGENTS.md](AGENTS.md).
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
[MIT](LICENSE) · not affiliated with [Shiny Frog](https://shinyfrog.app)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
bearcli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
bearcli/actions.py,sha256=nKhu4iUjS6-SAvsJKvoTqPRa0mj9lD9zKAOFJKb9OZY,2430
|
|
3
|
+
bearcli/cli.py,sha256=mBHHKdnlxDstXOROOVjChg8Tf9wz5y4kWYkJSkOOdlA,28276
|
|
4
|
+
bearcli/db.py,sha256=zM25gOxrzUq5qRAts78oIMrFW4GU245FceuwO2DcLAA,9790
|
|
5
|
+
bearcli/export.py,sha256=4Y2mwhhwsozpNpIBe7I2stzX85WdOG_7DLk7bmN8YfY,8244
|
|
6
|
+
bearcli/search.py,sha256=BIqKn4Kqw4FOtbljcFUSGb5t5VhI36KrClfb1uIIrAs,4814
|
|
7
|
+
bearcli-1.0.0.dist-info/licenses/LICENSE,sha256=6GQ08_KAylombOwcGnemMQM8Ai39XsWdW25vHPE6v_s,1070
|
|
8
|
+
bearcli-1.0.0.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
|
|
9
|
+
bearcli-1.0.0.dist-info/entry_points.txt,sha256=JLYgSgDfzdtHixbjhWt44WoGznm7UqxuD0Xejn6qncU,45
|
|
10
|
+
bearcli-1.0.0.dist-info/METADATA,sha256=Ko9LGhf__cvXdh3hdBkb1U8zqJyBZpUgPlKnO-YYK6U,5569
|
|
11
|
+
bearcli-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Michel Tricot
|
|
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.
|