odcli 0.1.4__tar.gz → 0.1.6__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.
- {odcli-0.1.4 → odcli-0.1.6}/PKG-INFO +101 -68
- odcli-0.1.6/README.md +231 -0
- {odcli-0.1.4 → odcli-0.1.6}/pyproject.toml +2 -7
- {odcli-0.1.4 → odcli-0.1.6}/src/obsidian_cli/__init__.py +1 -1
- {odcli-0.1.4 → odcli-0.1.6}/src/obsidian_cli/__main__.py +0 -1
- {odcli-0.1.4 → odcli-0.1.6}/src/obsidian_cli/plugins.py +6 -1
- {odcli-0.1.4 → odcli-0.1.6}/src/odcli.egg-info/PKG-INFO +101 -68
- {odcli-0.1.4 → odcli-0.1.6}/tests/test_cli.py +6 -6
- odcli-0.1.4/README.md +0 -195
- {odcli-0.1.4 → odcli-0.1.6}/setup.cfg +0 -0
- {odcli-0.1.4 → odcli-0.1.6}/src/obsidian_cli/cli.py +0 -0
- {odcli-0.1.4 → odcli-0.1.6}/src/obsidian_cli/commands.py +0 -0
- {odcli-0.1.4 → odcli-0.1.6}/src/obsidian_cli/discovery.py +0 -0
- {odcli-0.1.4 → odcli-0.1.6}/src/obsidian_cli/vault.py +0 -0
- {odcli-0.1.4 → odcli-0.1.6}/src/odcli.egg-info/SOURCES.txt +0 -0
- {odcli-0.1.4 → odcli-0.1.6}/src/odcli.egg-info/dependency_links.txt +0 -0
- {odcli-0.1.4 → odcli-0.1.6}/src/odcli.egg-info/entry_points.txt +0 -0
- {odcli-0.1.4 → odcli-0.1.6}/src/odcli.egg-info/top_level.txt +0 -0
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: odcli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: A small CLI for reading and writing notes in a local Obsidian vault.
|
|
5
|
-
Author:
|
|
6
|
-
Project-URL: Homepage, https://github.com/Chang-LeHung/obsidian-cli
|
|
7
|
-
Project-URL: Repository, https://github.com/Chang-LeHung/obsidian-cli
|
|
8
|
-
Project-URL: Issues, https://github.com/Chang-LeHung/obsidian-cli/issues
|
|
5
|
+
Author: odcli contributors
|
|
9
6
|
Keywords: obsidian,cli,markdown,notes,vault
|
|
10
7
|
Classifier: Development Status :: 3 - Alpha
|
|
11
8
|
Classifier: Intended Audience :: Developers
|
|
@@ -21,68 +18,119 @@ Description-Content-Type: text/markdown
|
|
|
21
18
|
|
|
22
19
|
# odcli
|
|
23
20
|
|
|
24
|
-
`odcli` is a
|
|
25
|
-
It works directly on Markdown files inside the vault, so it does not depend on private Obsidian APIs and remains portable and easy to extend.
|
|
21
|
+
`odcli` is a command-line tool for reading and writing notes in a local Obsidian vault.
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
It works directly on Markdown files inside the vault, so you can use it without any private Obsidian API.
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
- List Markdown notes in the vault
|
|
31
|
-
- Read a specific note
|
|
32
|
-
- Read a specific line range from a note
|
|
33
|
-
- Overwrite a note or create it automatically
|
|
34
|
-
- Replace a specific line range in a note
|
|
35
|
-
- Append content to a note
|
|
36
|
-
- Full-text search across the vault
|
|
37
|
-
- Auto-discover the default vault from Obsidian config or common macOS and Windows locations
|
|
38
|
-
- Install odcli helper skills into Codex or Claude Code skill directories
|
|
25
|
+
## Install
|
|
39
26
|
|
|
40
|
-
|
|
27
|
+
From PyPI:
|
|
41
28
|
|
|
42
29
|
```bash
|
|
43
|
-
|
|
44
|
-
uv sync
|
|
45
|
-
uv run odcli --help
|
|
30
|
+
pip install odcli
|
|
46
31
|
```
|
|
47
32
|
|
|
48
|
-
|
|
33
|
+
Or with `uv`:
|
|
49
34
|
|
|
50
35
|
```bash
|
|
51
|
-
|
|
52
|
-
uv run python -m unittest discover -s tests
|
|
36
|
+
uv tool install odcli
|
|
53
37
|
```
|
|
54
38
|
|
|
55
|
-
|
|
39
|
+
After installation, both command names are available:
|
|
56
40
|
|
|
57
41
|
```bash
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
odcli --help
|
|
43
|
+
obsidian-cli --help
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Quickstart
|
|
47
|
+
|
|
48
|
+
If your vault is already in a common location, `odcli` can usually find it automatically:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
odcli check
|
|
52
|
+
odcli list
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If you want to set the vault explicitly:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
export OBSIDIAN_VAULT="/path/to/MyVault"
|
|
59
|
+
odcli check
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
You can also override the vault per command:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
odcli --vault "/path/to/MyVault" list
|
|
60
66
|
```
|
|
61
67
|
|
|
62
|
-
|
|
63
|
-
After installation, both `odcli` and `obsidian-cli` are available as command names.
|
|
68
|
+
## Common Commands
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
Read a note:
|
|
66
71
|
|
|
67
72
|
```bash
|
|
68
|
-
|
|
69
|
-
./odcli --help
|
|
73
|
+
odcli read Inbox/today.md
|
|
70
74
|
```
|
|
71
75
|
|
|
72
|
-
|
|
76
|
+
Read specific lines:
|
|
73
77
|
|
|
74
78
|
```bash
|
|
75
|
-
|
|
76
|
-
./obsidian-cli --help
|
|
79
|
+
odcli read-lines Inbox/today.md 3 8
|
|
77
80
|
```
|
|
78
81
|
|
|
79
|
-
|
|
82
|
+
Create or overwrite a note:
|
|
80
83
|
|
|
81
84
|
```bash
|
|
82
|
-
|
|
85
|
+
odcli write Inbox/today.md --content "# Today"
|
|
83
86
|
```
|
|
84
87
|
|
|
85
|
-
|
|
88
|
+
Replace a line range:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
odcli write-lines Inbox/today.md 3 4 --content "- replaced\n- lines\n"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Append content:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
odcli append Inbox/today.md --content "\n- new item"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Search across the vault:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
odcli search "project alpha"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Skill Install
|
|
107
|
+
|
|
108
|
+
`odcli` can install helper skills for local coding tools.
|
|
109
|
+
|
|
110
|
+
Install into Codex:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
odcli plugin install codex-skill
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Install into Claude Code:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
odcli plugin install claude-skill
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Install both:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
odcli plugin install all-skills
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Installed paths:
|
|
129
|
+
|
|
130
|
+
- Codex: `~/.codex/skills/odcli/SKILL.md`
|
|
131
|
+
- Claude Code: `~/.claude/skills/odcli/SKILL.md`
|
|
132
|
+
|
|
133
|
+
## Vault Discovery
|
|
86
134
|
|
|
87
135
|
Resolution priority:
|
|
88
136
|
|
|
@@ -99,21 +147,7 @@ Built-in default locations:
|
|
|
99
147
|
- Windows: `%USERPROFILE%\\Documents\\Obsidian Vault`
|
|
100
148
|
- Windows: `%USERPROFILE%\\Documents\\Obsidian`
|
|
101
149
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
export OBSIDIAN_VAULT="/Users/your-name/Documents/MyVault"
|
|
106
|
-
./odcli check
|
|
107
|
-
./odcli list
|
|
108
|
-
./odcli read Inbox/today.md
|
|
109
|
-
./odcli read-lines Inbox/today.md 3 8
|
|
110
|
-
./odcli write Inbox/today.md --content "# Today"
|
|
111
|
-
./odcli write-lines Inbox/today.md 3 4 --content "- replaced\n- lines\n"
|
|
112
|
-
./odcli append Inbox/today.md --content "\n- new item"
|
|
113
|
-
./odcli search "project alpha"
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
## Commands
|
|
150
|
+
## Command Summary
|
|
117
151
|
|
|
118
152
|
### `check`
|
|
119
153
|
|
|
@@ -190,27 +224,26 @@ Arguments:
|
|
|
190
224
|
- `query`
|
|
191
225
|
- `--case-sensitive`
|
|
192
226
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
Install odcli helper skills for local coding tools.
|
|
227
|
+
## For Developers
|
|
196
228
|
|
|
197
|
-
|
|
229
|
+
Run from source:
|
|
198
230
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
231
|
+
```bash
|
|
232
|
+
cd path/to/obsidian_cli
|
|
233
|
+
uv sync
|
|
234
|
+
uv run odcli --help
|
|
235
|
+
```
|
|
202
236
|
|
|
203
|
-
|
|
237
|
+
Run tests:
|
|
204
238
|
|
|
205
239
|
```bash
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
odcli plugin install all-skills
|
|
240
|
+
cd path/to/obsidian_cli
|
|
241
|
+
uv run python -m unittest discover -s tests
|
|
209
242
|
```
|
|
210
243
|
|
|
211
|
-
|
|
244
|
+
Build distributions:
|
|
212
245
|
|
|
213
246
|
```bash
|
|
214
|
-
cd /
|
|
215
|
-
uv
|
|
247
|
+
cd path/to/obsidian_cli
|
|
248
|
+
uv build
|
|
216
249
|
```
|
odcli-0.1.6/README.md
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# odcli
|
|
2
|
+
|
|
3
|
+
`odcli` is a command-line tool for reading and writing notes in a local Obsidian vault.
|
|
4
|
+
|
|
5
|
+
It works directly on Markdown files inside the vault, so you can use it without any private Obsidian API.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
From PyPI:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install odcli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or with `uv`:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
uv tool install odcli
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
After installation, both command names are available:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
odcli --help
|
|
25
|
+
obsidian-cli --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quickstart
|
|
29
|
+
|
|
30
|
+
If your vault is already in a common location, `odcli` can usually find it automatically:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
odcli check
|
|
34
|
+
odcli list
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
If you want to set the vault explicitly:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
export OBSIDIAN_VAULT="/path/to/MyVault"
|
|
41
|
+
odcli check
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
You can also override the vault per command:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
odcli --vault "/path/to/MyVault" list
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Common Commands
|
|
51
|
+
|
|
52
|
+
Read a note:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
odcli read Inbox/today.md
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Read specific lines:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
odcli read-lines Inbox/today.md 3 8
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Create or overwrite a note:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
odcli write Inbox/today.md --content "# Today"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Replace a line range:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
odcli write-lines Inbox/today.md 3 4 --content "- replaced\n- lines\n"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Append content:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
odcli append Inbox/today.md --content "\n- new item"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Search across the vault:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
odcli search "project alpha"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Skill Install
|
|
89
|
+
|
|
90
|
+
`odcli` can install helper skills for local coding tools.
|
|
91
|
+
|
|
92
|
+
Install into Codex:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
odcli plugin install codex-skill
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Install into Claude Code:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
odcli plugin install claude-skill
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Install both:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
odcli plugin install all-skills
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Installed paths:
|
|
111
|
+
|
|
112
|
+
- Codex: `~/.codex/skills/odcli/SKILL.md`
|
|
113
|
+
- Claude Code: `~/.claude/skills/odcli/SKILL.md`
|
|
114
|
+
|
|
115
|
+
## Vault Discovery
|
|
116
|
+
|
|
117
|
+
Resolution priority:
|
|
118
|
+
|
|
119
|
+
1. `--vault /path/to/vault`
|
|
120
|
+
2. `OBSIDIAN_VAULT`
|
|
121
|
+
3. The most recently opened vault recorded by local Obsidian config
|
|
122
|
+
4. Common default directories
|
|
123
|
+
|
|
124
|
+
Built-in default locations:
|
|
125
|
+
|
|
126
|
+
- macOS: `~/Documents/Obsidian Vault`
|
|
127
|
+
- macOS: `~/Documents/Obsidian`
|
|
128
|
+
- macOS iCloud: `~/Library/Mobile Documents/iCloud~md~obsidian/Documents`
|
|
129
|
+
- Windows: `%USERPROFILE%\\Documents\\Obsidian Vault`
|
|
130
|
+
- Windows: `%USERPROFILE%\\Documents\\Obsidian`
|
|
131
|
+
|
|
132
|
+
## Command Summary
|
|
133
|
+
|
|
134
|
+
### `check`
|
|
135
|
+
|
|
136
|
+
Validate that the vault exists and report whether `.obsidian` is present.
|
|
137
|
+
|
|
138
|
+
### `list`
|
|
139
|
+
|
|
140
|
+
List Markdown notes in the vault.
|
|
141
|
+
|
|
142
|
+
Optional arguments:
|
|
143
|
+
|
|
144
|
+
- `--limit N`
|
|
145
|
+
|
|
146
|
+
### `read`
|
|
147
|
+
|
|
148
|
+
Read a note.
|
|
149
|
+
|
|
150
|
+
Arguments:
|
|
151
|
+
|
|
152
|
+
- `note_path`: path relative to the vault root
|
|
153
|
+
|
|
154
|
+
### `write`
|
|
155
|
+
|
|
156
|
+
Overwrite a note. Parent directories are created automatically if needed.
|
|
157
|
+
|
|
158
|
+
Arguments:
|
|
159
|
+
|
|
160
|
+
- `note_path`
|
|
161
|
+
- `--content TEXT`
|
|
162
|
+
- `--stdin`
|
|
163
|
+
|
|
164
|
+
Optional arguments:
|
|
165
|
+
|
|
166
|
+
- `--create-only`
|
|
167
|
+
|
|
168
|
+
### `read-lines`
|
|
169
|
+
|
|
170
|
+
Read a line range. Line numbers are 1-based and inclusive.
|
|
171
|
+
|
|
172
|
+
Arguments:
|
|
173
|
+
|
|
174
|
+
- `note_path`
|
|
175
|
+
- `start_line`
|
|
176
|
+
- `end_line`
|
|
177
|
+
|
|
178
|
+
### `write-lines`
|
|
179
|
+
|
|
180
|
+
Replace a line range. Line numbers are 1-based and inclusive.
|
|
181
|
+
|
|
182
|
+
Arguments:
|
|
183
|
+
|
|
184
|
+
- `note_path`
|
|
185
|
+
- `start_line`
|
|
186
|
+
- `end_line`
|
|
187
|
+
- `--content TEXT`
|
|
188
|
+
- `--stdin`
|
|
189
|
+
|
|
190
|
+
### `append`
|
|
191
|
+
|
|
192
|
+
Append content to the end of a note.
|
|
193
|
+
|
|
194
|
+
Arguments:
|
|
195
|
+
|
|
196
|
+
- `note_path`
|
|
197
|
+
- `--content TEXT`
|
|
198
|
+
- `--stdin`
|
|
199
|
+
|
|
200
|
+
### `search`
|
|
201
|
+
|
|
202
|
+
Search across all Markdown notes in the vault.
|
|
203
|
+
|
|
204
|
+
Arguments:
|
|
205
|
+
|
|
206
|
+
- `query`
|
|
207
|
+
- `--case-sensitive`
|
|
208
|
+
|
|
209
|
+
## For Developers
|
|
210
|
+
|
|
211
|
+
Run from source:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
cd path/to/obsidian_cli
|
|
215
|
+
uv sync
|
|
216
|
+
uv run odcli --help
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Run tests:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
cd path/to/obsidian_cli
|
|
223
|
+
uv run python -m unittest discover -s tests
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Build distributions:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
cd path/to/obsidian_cli
|
|
230
|
+
uv build
|
|
231
|
+
```
|
|
@@ -4,12 +4,12 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "odcli"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.6"
|
|
8
8
|
description = "A small CLI for reading and writing notes in a local Obsidian vault."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
11
11
|
authors = [
|
|
12
|
-
{ name = "
|
|
12
|
+
{ name = "odcli contributors" }
|
|
13
13
|
]
|
|
14
14
|
dependencies = []
|
|
15
15
|
keywords = ["obsidian", "cli", "markdown", "notes", "vault"]
|
|
@@ -25,11 +25,6 @@ classifiers = [
|
|
|
25
25
|
"Environment :: Console",
|
|
26
26
|
]
|
|
27
27
|
|
|
28
|
-
[project.urls]
|
|
29
|
-
Homepage = "https://github.com/Chang-LeHung/obsidian-cli"
|
|
30
|
-
Repository = "https://github.com/Chang-LeHung/obsidian-cli"
|
|
31
|
-
Issues = "https://github.com/Chang-LeHung/obsidian-cli/issues"
|
|
32
|
-
|
|
33
28
|
[project.scripts]
|
|
34
29
|
odcli = "obsidian_cli.cli:main"
|
|
35
30
|
obsidian-cli = "obsidian_cli.cli:main"
|
|
@@ -4,7 +4,12 @@ from dataclasses import dataclass
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
SKILL_BODY = """
|
|
7
|
+
SKILL_BODY = """---
|
|
8
|
+
name: "odcli"
|
|
9
|
+
description: "Use odcli to read, write, append, search, and patch notes inside a local Obsidian vault."
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# odcli
|
|
8
13
|
|
|
9
14
|
Use `odcli` when you need to read or write notes inside a local Obsidian vault.
|
|
10
15
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: odcli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: A small CLI for reading and writing notes in a local Obsidian vault.
|
|
5
|
-
Author:
|
|
6
|
-
Project-URL: Homepage, https://github.com/Chang-LeHung/obsidian-cli
|
|
7
|
-
Project-URL: Repository, https://github.com/Chang-LeHung/obsidian-cli
|
|
8
|
-
Project-URL: Issues, https://github.com/Chang-LeHung/obsidian-cli/issues
|
|
5
|
+
Author: odcli contributors
|
|
9
6
|
Keywords: obsidian,cli,markdown,notes,vault
|
|
10
7
|
Classifier: Development Status :: 3 - Alpha
|
|
11
8
|
Classifier: Intended Audience :: Developers
|
|
@@ -21,68 +18,119 @@ Description-Content-Type: text/markdown
|
|
|
21
18
|
|
|
22
19
|
# odcli
|
|
23
20
|
|
|
24
|
-
`odcli` is a
|
|
25
|
-
It works directly on Markdown files inside the vault, so it does not depend on private Obsidian APIs and remains portable and easy to extend.
|
|
21
|
+
`odcli` is a command-line tool for reading and writing notes in a local Obsidian vault.
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
It works directly on Markdown files inside the vault, so you can use it without any private Obsidian API.
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
- List Markdown notes in the vault
|
|
31
|
-
- Read a specific note
|
|
32
|
-
- Read a specific line range from a note
|
|
33
|
-
- Overwrite a note or create it automatically
|
|
34
|
-
- Replace a specific line range in a note
|
|
35
|
-
- Append content to a note
|
|
36
|
-
- Full-text search across the vault
|
|
37
|
-
- Auto-discover the default vault from Obsidian config or common macOS and Windows locations
|
|
38
|
-
- Install odcli helper skills into Codex or Claude Code skill directories
|
|
25
|
+
## Install
|
|
39
26
|
|
|
40
|
-
|
|
27
|
+
From PyPI:
|
|
41
28
|
|
|
42
29
|
```bash
|
|
43
|
-
|
|
44
|
-
uv sync
|
|
45
|
-
uv run odcli --help
|
|
30
|
+
pip install odcli
|
|
46
31
|
```
|
|
47
32
|
|
|
48
|
-
|
|
33
|
+
Or with `uv`:
|
|
49
34
|
|
|
50
35
|
```bash
|
|
51
|
-
|
|
52
|
-
uv run python -m unittest discover -s tests
|
|
36
|
+
uv tool install odcli
|
|
53
37
|
```
|
|
54
38
|
|
|
55
|
-
|
|
39
|
+
After installation, both command names are available:
|
|
56
40
|
|
|
57
41
|
```bash
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
odcli --help
|
|
43
|
+
obsidian-cli --help
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Quickstart
|
|
47
|
+
|
|
48
|
+
If your vault is already in a common location, `odcli` can usually find it automatically:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
odcli check
|
|
52
|
+
odcli list
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If you want to set the vault explicitly:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
export OBSIDIAN_VAULT="/path/to/MyVault"
|
|
59
|
+
odcli check
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
You can also override the vault per command:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
odcli --vault "/path/to/MyVault" list
|
|
60
66
|
```
|
|
61
67
|
|
|
62
|
-
|
|
63
|
-
After installation, both `odcli` and `obsidian-cli` are available as command names.
|
|
68
|
+
## Common Commands
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
Read a note:
|
|
66
71
|
|
|
67
72
|
```bash
|
|
68
|
-
|
|
69
|
-
./odcli --help
|
|
73
|
+
odcli read Inbox/today.md
|
|
70
74
|
```
|
|
71
75
|
|
|
72
|
-
|
|
76
|
+
Read specific lines:
|
|
73
77
|
|
|
74
78
|
```bash
|
|
75
|
-
|
|
76
|
-
./obsidian-cli --help
|
|
79
|
+
odcli read-lines Inbox/today.md 3 8
|
|
77
80
|
```
|
|
78
81
|
|
|
79
|
-
|
|
82
|
+
Create or overwrite a note:
|
|
80
83
|
|
|
81
84
|
```bash
|
|
82
|
-
|
|
85
|
+
odcli write Inbox/today.md --content "# Today"
|
|
83
86
|
```
|
|
84
87
|
|
|
85
|
-
|
|
88
|
+
Replace a line range:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
odcli write-lines Inbox/today.md 3 4 --content "- replaced\n- lines\n"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Append content:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
odcli append Inbox/today.md --content "\n- new item"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Search across the vault:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
odcli search "project alpha"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Skill Install
|
|
107
|
+
|
|
108
|
+
`odcli` can install helper skills for local coding tools.
|
|
109
|
+
|
|
110
|
+
Install into Codex:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
odcli plugin install codex-skill
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Install into Claude Code:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
odcli plugin install claude-skill
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Install both:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
odcli plugin install all-skills
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Installed paths:
|
|
129
|
+
|
|
130
|
+
- Codex: `~/.codex/skills/odcli/SKILL.md`
|
|
131
|
+
- Claude Code: `~/.claude/skills/odcli/SKILL.md`
|
|
132
|
+
|
|
133
|
+
## Vault Discovery
|
|
86
134
|
|
|
87
135
|
Resolution priority:
|
|
88
136
|
|
|
@@ -99,21 +147,7 @@ Built-in default locations:
|
|
|
99
147
|
- Windows: `%USERPROFILE%\\Documents\\Obsidian Vault`
|
|
100
148
|
- Windows: `%USERPROFILE%\\Documents\\Obsidian`
|
|
101
149
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
export OBSIDIAN_VAULT="/Users/your-name/Documents/MyVault"
|
|
106
|
-
./odcli check
|
|
107
|
-
./odcli list
|
|
108
|
-
./odcli read Inbox/today.md
|
|
109
|
-
./odcli read-lines Inbox/today.md 3 8
|
|
110
|
-
./odcli write Inbox/today.md --content "# Today"
|
|
111
|
-
./odcli write-lines Inbox/today.md 3 4 --content "- replaced\n- lines\n"
|
|
112
|
-
./odcli append Inbox/today.md --content "\n- new item"
|
|
113
|
-
./odcli search "project alpha"
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
## Commands
|
|
150
|
+
## Command Summary
|
|
117
151
|
|
|
118
152
|
### `check`
|
|
119
153
|
|
|
@@ -190,27 +224,26 @@ Arguments:
|
|
|
190
224
|
- `query`
|
|
191
225
|
- `--case-sensitive`
|
|
192
226
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
Install odcli helper skills for local coding tools.
|
|
227
|
+
## For Developers
|
|
196
228
|
|
|
197
|
-
|
|
229
|
+
Run from source:
|
|
198
230
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
231
|
+
```bash
|
|
232
|
+
cd path/to/obsidian_cli
|
|
233
|
+
uv sync
|
|
234
|
+
uv run odcli --help
|
|
235
|
+
```
|
|
202
236
|
|
|
203
|
-
|
|
237
|
+
Run tests:
|
|
204
238
|
|
|
205
239
|
```bash
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
odcli plugin install all-skills
|
|
240
|
+
cd path/to/obsidian_cli
|
|
241
|
+
uv run python -m unittest discover -s tests
|
|
209
242
|
```
|
|
210
243
|
|
|
211
|
-
|
|
244
|
+
Build distributions:
|
|
212
245
|
|
|
213
246
|
```bash
|
|
214
|
-
cd /
|
|
215
|
-
uv
|
|
247
|
+
cd path/to/obsidian_cli
|
|
248
|
+
uv build
|
|
216
249
|
```
|
|
@@ -137,17 +137,17 @@ class VaultTests(unittest.TestCase):
|
|
|
137
137
|
installer = SkillInstaller(home=self.vault_root)
|
|
138
138
|
results = installer.install("codex-skill")
|
|
139
139
|
self.assertEqual(len(results), 1)
|
|
140
|
-
self.
|
|
141
|
-
|
|
142
|
-
)
|
|
140
|
+
skill_path = self.vault_root / ".codex" / "skills" / "odcli" / "SKILL.md"
|
|
141
|
+
self.assertTrue(skill_path.is_file())
|
|
142
|
+
self.assertTrue(skill_path.read_text(encoding="utf-8").startswith("---\n"))
|
|
143
143
|
|
|
144
144
|
def test_skill_installer_installs_claude_skill(self) -> None:
|
|
145
145
|
installer = SkillInstaller(home=self.vault_root)
|
|
146
146
|
results = installer.install("claude-skill")
|
|
147
147
|
self.assertEqual(len(results), 1)
|
|
148
|
-
self.
|
|
149
|
-
|
|
150
|
-
)
|
|
148
|
+
skill_path = self.vault_root / ".claude" / "skills" / "odcli" / "SKILL.md"
|
|
149
|
+
self.assertTrue(skill_path.is_file())
|
|
150
|
+
self.assertTrue(skill_path.read_text(encoding="utf-8").startswith("---\n"))
|
|
151
151
|
|
|
152
152
|
def test_cli_plugin_install_all_skills(self) -> None:
|
|
153
153
|
cli = ObsidianCLI(vault_locator=VaultLocator(env={}, home=self.vault_root))
|
odcli-0.1.4/README.md
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
# odcli
|
|
2
|
-
|
|
3
|
-
`odcli` is a local Python CLI for reading and writing notes in an Obsidian vault.
|
|
4
|
-
It works directly on Markdown files inside the vault, so it does not depend on private Obsidian APIs and remains portable and easy to extend.
|
|
5
|
-
|
|
6
|
-
## Features
|
|
7
|
-
|
|
8
|
-
- Validate whether a vault path is available
|
|
9
|
-
- List Markdown notes in the vault
|
|
10
|
-
- Read a specific note
|
|
11
|
-
- Read a specific line range from a note
|
|
12
|
-
- Overwrite a note or create it automatically
|
|
13
|
-
- Replace a specific line range in a note
|
|
14
|
-
- Append content to a note
|
|
15
|
-
- Full-text search across the vault
|
|
16
|
-
- Auto-discover the default vault from Obsidian config or common macOS and Windows locations
|
|
17
|
-
- Install odcli helper skills into Codex or Claude Code skill directories
|
|
18
|
-
|
|
19
|
-
## Using uv
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
cd /Users/huchang/agents/obsidian_cli
|
|
23
|
-
uv sync
|
|
24
|
-
uv run odcli --help
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Run tests:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
cd /Users/huchang/agents/obsidian_cli
|
|
31
|
-
uv run python -m unittest discover -s tests
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Build distributions:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
cd /Users/huchang/agents/obsidian_cli
|
|
38
|
-
uv build
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
The published package name on PyPI is `odcli`.
|
|
42
|
-
After installation, both `odcli` and `obsidian-cli` are available as command names.
|
|
43
|
-
|
|
44
|
-
## Run Locally
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
cd /Users/huchang/agents/obsidian_cli
|
|
48
|
-
./odcli --help
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
The compatibility entry point is still available:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
cd /Users/huchang/agents/obsidian_cli
|
|
55
|
-
./obsidian-cli --help
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
If you prefer module execution:
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
PYTHONPATH=src python3 -m obsidian_cli --help
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Vault Resolution
|
|
65
|
-
|
|
66
|
-
Resolution priority:
|
|
67
|
-
|
|
68
|
-
1. `--vault /path/to/vault`
|
|
69
|
-
2. `OBSIDIAN_VAULT`
|
|
70
|
-
3. The most recently opened vault recorded by local Obsidian config
|
|
71
|
-
4. Common default directories
|
|
72
|
-
|
|
73
|
-
Built-in default locations:
|
|
74
|
-
|
|
75
|
-
- macOS: `~/Documents/Obsidian Vault`
|
|
76
|
-
- macOS: `~/Documents/Obsidian`
|
|
77
|
-
- macOS iCloud: `~/Library/Mobile Documents/iCloud~md~obsidian/Documents`
|
|
78
|
-
- Windows: `%USERPROFILE%\\Documents\\Obsidian Vault`
|
|
79
|
-
- Windows: `%USERPROFILE%\\Documents\\Obsidian`
|
|
80
|
-
|
|
81
|
-
Example:
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
export OBSIDIAN_VAULT="/Users/your-name/Documents/MyVault"
|
|
85
|
-
./odcli check
|
|
86
|
-
./odcli list
|
|
87
|
-
./odcli read Inbox/today.md
|
|
88
|
-
./odcli read-lines Inbox/today.md 3 8
|
|
89
|
-
./odcli write Inbox/today.md --content "# Today"
|
|
90
|
-
./odcli write-lines Inbox/today.md 3 4 --content "- replaced\n- lines\n"
|
|
91
|
-
./odcli append Inbox/today.md --content "\n- new item"
|
|
92
|
-
./odcli search "project alpha"
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Commands
|
|
96
|
-
|
|
97
|
-
### `check`
|
|
98
|
-
|
|
99
|
-
Validate that the vault exists and report whether `.obsidian` is present.
|
|
100
|
-
|
|
101
|
-
### `list`
|
|
102
|
-
|
|
103
|
-
List Markdown notes in the vault.
|
|
104
|
-
|
|
105
|
-
Optional arguments:
|
|
106
|
-
|
|
107
|
-
- `--limit N`
|
|
108
|
-
|
|
109
|
-
### `read`
|
|
110
|
-
|
|
111
|
-
Read a note.
|
|
112
|
-
|
|
113
|
-
Arguments:
|
|
114
|
-
|
|
115
|
-
- `note_path`: path relative to the vault root
|
|
116
|
-
|
|
117
|
-
### `write`
|
|
118
|
-
|
|
119
|
-
Overwrite a note. Parent directories are created automatically if needed.
|
|
120
|
-
|
|
121
|
-
Arguments:
|
|
122
|
-
|
|
123
|
-
- `note_path`
|
|
124
|
-
- `--content TEXT`
|
|
125
|
-
- `--stdin`
|
|
126
|
-
|
|
127
|
-
Optional arguments:
|
|
128
|
-
|
|
129
|
-
- `--create-only`
|
|
130
|
-
|
|
131
|
-
### `read-lines`
|
|
132
|
-
|
|
133
|
-
Read a line range. Line numbers are 1-based and inclusive.
|
|
134
|
-
|
|
135
|
-
Arguments:
|
|
136
|
-
|
|
137
|
-
- `note_path`
|
|
138
|
-
- `start_line`
|
|
139
|
-
- `end_line`
|
|
140
|
-
|
|
141
|
-
### `write-lines`
|
|
142
|
-
|
|
143
|
-
Replace a line range. Line numbers are 1-based and inclusive.
|
|
144
|
-
|
|
145
|
-
Arguments:
|
|
146
|
-
|
|
147
|
-
- `note_path`
|
|
148
|
-
- `start_line`
|
|
149
|
-
- `end_line`
|
|
150
|
-
- `--content TEXT`
|
|
151
|
-
- `--stdin`
|
|
152
|
-
|
|
153
|
-
### `append`
|
|
154
|
-
|
|
155
|
-
Append content to the end of a note.
|
|
156
|
-
|
|
157
|
-
Arguments:
|
|
158
|
-
|
|
159
|
-
- `note_path`
|
|
160
|
-
- `--content TEXT`
|
|
161
|
-
- `--stdin`
|
|
162
|
-
|
|
163
|
-
### `search`
|
|
164
|
-
|
|
165
|
-
Search across all Markdown notes in the vault.
|
|
166
|
-
|
|
167
|
-
Arguments:
|
|
168
|
-
|
|
169
|
-
- `query`
|
|
170
|
-
- `--case-sensitive`
|
|
171
|
-
|
|
172
|
-
### `plugin install`
|
|
173
|
-
|
|
174
|
-
Install odcli helper skills for local coding tools.
|
|
175
|
-
|
|
176
|
-
Targets:
|
|
177
|
-
|
|
178
|
-
- `codex-skill`: installs to `~/.codex/skills/odcli/SKILL.md`
|
|
179
|
-
- `claude-skill`: installs to `~/.claude/skills/odcli/SKILL.md`
|
|
180
|
-
- `all-skills`: installs both
|
|
181
|
-
|
|
182
|
-
Examples:
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
odcli plugin install codex-skill
|
|
186
|
-
odcli plugin install claude-skill
|
|
187
|
-
odcli plugin install all-skills
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
## Testing
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
cd /Users/huchang/agents/obsidian_cli
|
|
194
|
-
uv run python -m unittest discover -s tests
|
|
195
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|