odcli 0.1.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: odcli
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: A small CLI for reading and writing notes in a local Obsidian vault.
5
5
  Author: odcli contributors
6
6
  Keywords: obsidian,cli,markdown,notes,vault
@@ -18,68 +18,119 @@ Description-Content-Type: text/markdown
18
18
 
19
19
  # odcli
20
20
 
21
- `odcli` is a local Python CLI for reading and writing notes in an Obsidian vault.
22
- 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.
23
22
 
24
- ## Features
23
+ It works directly on Markdown files inside the vault, so you can use it without any private Obsidian API.
25
24
 
26
- - Validate whether a vault path is available
27
- - List Markdown notes in the vault
28
- - Read a specific note
29
- - Read a specific line range from a note
30
- - Overwrite a note or create it automatically
31
- - Replace a specific line range in a note
32
- - Append content to a note
33
- - Full-text search across the vault
34
- - Auto-discover the default vault from Obsidian config or common macOS and Windows locations
35
- - Install odcli helper skills into Codex or Claude Code skill directories
25
+ ## Install
36
26
 
37
- ## Using uv
27
+ From PyPI:
38
28
 
39
29
  ```bash
40
- cd path/to/obsidian_cli
41
- uv sync
42
- uv run odcli --help
30
+ pip install odcli
43
31
  ```
44
32
 
45
- Run tests:
33
+ Or with `uv`:
46
34
 
47
35
  ```bash
48
- cd path/to/obsidian_cli
49
- uv run python -m unittest discover -s tests
36
+ uv tool install odcli
50
37
  ```
51
38
 
52
- Build distributions:
39
+ After installation, both command names are available:
53
40
 
54
41
  ```bash
55
- cd path/to/obsidian_cli
56
- uv build
42
+ odcli --help
43
+ obsidian-cli --help
57
44
  ```
58
45
 
59
- The published package name on PyPI is `odcli`.
60
- After installation, both `odcli` and `obsidian-cli` are available as command names.
46
+ ## Quickstart
61
47
 
62
- ## Run Locally
48
+ If your vault is already in a common location, `odcli` can usually find it automatically:
63
49
 
64
50
  ```bash
65
- cd path/to/obsidian_cli
66
- ./odcli --help
51
+ odcli check
52
+ odcli list
67
53
  ```
68
54
 
69
- The compatibility entry point is still available:
55
+ If you want to set the vault explicitly:
70
56
 
71
57
  ```bash
72
- cd path/to/obsidian_cli
73
- ./obsidian-cli --help
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
66
+ ```
67
+
68
+ ## Common Commands
69
+
70
+ Read a note:
71
+
72
+ ```bash
73
+ odcli read Inbox/today.md
74
+ ```
75
+
76
+ Read specific lines:
77
+
78
+ ```bash
79
+ odcli read-lines Inbox/today.md 3 8
80
+ ```
81
+
82
+ Create or overwrite a note:
83
+
84
+ ```bash
85
+ odcli write Inbox/today.md --content "# Today"
86
+ ```
87
+
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"
74
104
  ```
75
105
 
76
- If you prefer module execution:
106
+ ## Skill Install
107
+
108
+ `odcli` can install helper skills for local coding tools.
109
+
110
+ Install into Codex:
77
111
 
78
112
  ```bash
79
- PYTHONPATH=src python3 -m obsidian_cli --help
113
+ odcli plugin install codex-skill
80
114
  ```
81
115
 
82
- ## Vault Resolution
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
83
134
 
84
135
  Resolution priority:
85
136
 
@@ -96,21 +147,7 @@ Built-in default locations:
96
147
  - Windows: `%USERPROFILE%\\Documents\\Obsidian Vault`
97
148
  - Windows: `%USERPROFILE%\\Documents\\Obsidian`
98
149
 
99
- Example:
100
-
101
- ```bash
102
- export OBSIDIAN_VAULT="/path/to/MyVault"
103
- ./odcli check
104
- ./odcli list
105
- ./odcli read Inbox/today.md
106
- ./odcli read-lines Inbox/today.md 3 8
107
- ./odcli write Inbox/today.md --content "# Today"
108
- ./odcli write-lines Inbox/today.md 3 4 --content "- replaced\n- lines\n"
109
- ./odcli append Inbox/today.md --content "\n- new item"
110
- ./odcli search "project alpha"
111
- ```
112
-
113
- ## Commands
150
+ ## Command Summary
114
151
 
115
152
  ### `check`
116
153
 
@@ -187,27 +224,26 @@ Arguments:
187
224
  - `query`
188
225
  - `--case-sensitive`
189
226
 
190
- ### `plugin install`
191
-
192
- Install odcli helper skills for local coding tools.
227
+ ## For Developers
193
228
 
194
- Targets:
229
+ Run from source:
195
230
 
196
- - `codex-skill`: installs to `~/.codex/skills/odcli/SKILL.md`
197
- - `claude-skill`: installs to `~/.claude/skills/odcli/SKILL.md`
198
- - `all-skills`: installs both
231
+ ```bash
232
+ cd path/to/obsidian_cli
233
+ uv sync
234
+ uv run odcli --help
235
+ ```
199
236
 
200
- Examples:
237
+ Run tests:
201
238
 
202
239
  ```bash
203
- odcli plugin install codex-skill
204
- odcli plugin install claude-skill
205
- odcli plugin install all-skills
240
+ cd path/to/obsidian_cli
241
+ uv run python -m unittest discover -s tests
206
242
  ```
207
243
 
208
- ## Testing
244
+ Build distributions:
209
245
 
210
246
  ```bash
211
247
  cd path/to/obsidian_cli
212
- uv run python -m unittest discover -s tests
248
+ uv build
213
249
  ```
@@ -1,67 +1,118 @@
1
1
  # odcli
2
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.
3
+ `odcli` is a command-line tool for reading and writing notes in a local Obsidian vault.
5
4
 
6
- ## Features
5
+ It works directly on Markdown files inside the vault, so you can use it without any private Obsidian API.
7
6
 
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
7
+ ## Install
18
8
 
19
- ## Using uv
9
+ From PyPI:
20
10
 
21
11
  ```bash
22
- cd path/to/obsidian_cli
23
- uv sync
24
- uv run odcli --help
12
+ pip install odcli
25
13
  ```
26
14
 
27
- Run tests:
15
+ Or with `uv`:
28
16
 
29
17
  ```bash
30
- cd path/to/obsidian_cli
31
- uv run python -m unittest discover -s tests
18
+ uv tool install odcli
32
19
  ```
33
20
 
34
- Build distributions:
21
+ After installation, both command names are available:
35
22
 
36
23
  ```bash
37
- cd path/to/obsidian_cli
38
- uv build
24
+ odcli --help
25
+ obsidian-cli --help
39
26
  ```
40
27
 
41
- The published package name on PyPI is `odcli`.
42
- After installation, both `odcli` and `obsidian-cli` are available as command names.
28
+ ## Quickstart
43
29
 
44
- ## Run Locally
30
+ If your vault is already in a common location, `odcli` can usually find it automatically:
45
31
 
46
32
  ```bash
47
- cd path/to/obsidian_cli
48
- ./odcli --help
33
+ odcli check
34
+ odcli list
49
35
  ```
50
36
 
51
- The compatibility entry point is still available:
37
+ If you want to set the vault explicitly:
52
38
 
53
39
  ```bash
54
- cd path/to/obsidian_cli
55
- ./obsidian-cli --help
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"
56
86
  ```
57
87
 
58
- If you prefer module execution:
88
+ ## Skill Install
89
+
90
+ `odcli` can install helper skills for local coding tools.
91
+
92
+ Install into Codex:
59
93
 
60
94
  ```bash
61
- PYTHONPATH=src python3 -m obsidian_cli --help
95
+ odcli plugin install codex-skill
62
96
  ```
63
97
 
64
- ## Vault Resolution
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
65
116
 
66
117
  Resolution priority:
67
118
 
@@ -78,21 +129,7 @@ Built-in default locations:
78
129
  - Windows: `%USERPROFILE%\\Documents\\Obsidian Vault`
79
130
  - Windows: `%USERPROFILE%\\Documents\\Obsidian`
80
131
 
81
- Example:
82
-
83
- ```bash
84
- export OBSIDIAN_VAULT="/path/to/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
132
+ ## Command Summary
96
133
 
97
134
  ### `check`
98
135
 
@@ -169,27 +206,26 @@ Arguments:
169
206
  - `query`
170
207
  - `--case-sensitive`
171
208
 
172
- ### `plugin install`
173
-
174
- Install odcli helper skills for local coding tools.
209
+ ## For Developers
175
210
 
176
- Targets:
211
+ Run from source:
177
212
 
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
213
+ ```bash
214
+ cd path/to/obsidian_cli
215
+ uv sync
216
+ uv run odcli --help
217
+ ```
181
218
 
182
- Examples:
219
+ Run tests:
183
220
 
184
221
  ```bash
185
- odcli plugin install codex-skill
186
- odcli plugin install claude-skill
187
- odcli plugin install all-skills
222
+ cd path/to/obsidian_cli
223
+ uv run python -m unittest discover -s tests
188
224
  ```
189
225
 
190
- ## Testing
226
+ Build distributions:
191
227
 
192
228
  ```bash
193
229
  cd path/to/obsidian_cli
194
- uv run python -m unittest discover -s tests
230
+ uv build
195
231
  ```
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "odcli"
7
- version = "0.1.5"
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"
@@ -1,3 +1,3 @@
1
1
  __all__ = ["__version__"]
2
2
 
3
- __version__ = "0.1.5"
3
+ __version__ = "0.1.6"
@@ -4,7 +4,12 @@ from dataclasses import dataclass
4
4
  from pathlib import Path
5
5
 
6
6
 
7
- SKILL_BODY = """# odcli
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: odcli
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: A small CLI for reading and writing notes in a local Obsidian vault.
5
5
  Author: odcli contributors
6
6
  Keywords: obsidian,cli,markdown,notes,vault
@@ -18,68 +18,119 @@ Description-Content-Type: text/markdown
18
18
 
19
19
  # odcli
20
20
 
21
- `odcli` is a local Python CLI for reading and writing notes in an Obsidian vault.
22
- 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.
23
22
 
24
- ## Features
23
+ It works directly on Markdown files inside the vault, so you can use it without any private Obsidian API.
25
24
 
26
- - Validate whether a vault path is available
27
- - List Markdown notes in the vault
28
- - Read a specific note
29
- - Read a specific line range from a note
30
- - Overwrite a note or create it automatically
31
- - Replace a specific line range in a note
32
- - Append content to a note
33
- - Full-text search across the vault
34
- - Auto-discover the default vault from Obsidian config or common macOS and Windows locations
35
- - Install odcli helper skills into Codex or Claude Code skill directories
25
+ ## Install
36
26
 
37
- ## Using uv
27
+ From PyPI:
38
28
 
39
29
  ```bash
40
- cd path/to/obsidian_cli
41
- uv sync
42
- uv run odcli --help
30
+ pip install odcli
43
31
  ```
44
32
 
45
- Run tests:
33
+ Or with `uv`:
46
34
 
47
35
  ```bash
48
- cd path/to/obsidian_cli
49
- uv run python -m unittest discover -s tests
36
+ uv tool install odcli
50
37
  ```
51
38
 
52
- Build distributions:
39
+ After installation, both command names are available:
53
40
 
54
41
  ```bash
55
- cd path/to/obsidian_cli
56
- uv build
42
+ odcli --help
43
+ obsidian-cli --help
57
44
  ```
58
45
 
59
- The published package name on PyPI is `odcli`.
60
- After installation, both `odcli` and `obsidian-cli` are available as command names.
46
+ ## Quickstart
61
47
 
62
- ## Run Locally
48
+ If your vault is already in a common location, `odcli` can usually find it automatically:
63
49
 
64
50
  ```bash
65
- cd path/to/obsidian_cli
66
- ./odcli --help
51
+ odcli check
52
+ odcli list
67
53
  ```
68
54
 
69
- The compatibility entry point is still available:
55
+ If you want to set the vault explicitly:
70
56
 
71
57
  ```bash
72
- cd path/to/obsidian_cli
73
- ./obsidian-cli --help
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
66
+ ```
67
+
68
+ ## Common Commands
69
+
70
+ Read a note:
71
+
72
+ ```bash
73
+ odcli read Inbox/today.md
74
+ ```
75
+
76
+ Read specific lines:
77
+
78
+ ```bash
79
+ odcli read-lines Inbox/today.md 3 8
80
+ ```
81
+
82
+ Create or overwrite a note:
83
+
84
+ ```bash
85
+ odcli write Inbox/today.md --content "# Today"
86
+ ```
87
+
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"
74
104
  ```
75
105
 
76
- If you prefer module execution:
106
+ ## Skill Install
107
+
108
+ `odcli` can install helper skills for local coding tools.
109
+
110
+ Install into Codex:
77
111
 
78
112
  ```bash
79
- PYTHONPATH=src python3 -m obsidian_cli --help
113
+ odcli plugin install codex-skill
80
114
  ```
81
115
 
82
- ## Vault Resolution
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
83
134
 
84
135
  Resolution priority:
85
136
 
@@ -96,21 +147,7 @@ Built-in default locations:
96
147
  - Windows: `%USERPROFILE%\\Documents\\Obsidian Vault`
97
148
  - Windows: `%USERPROFILE%\\Documents\\Obsidian`
98
149
 
99
- Example:
100
-
101
- ```bash
102
- export OBSIDIAN_VAULT="/path/to/MyVault"
103
- ./odcli check
104
- ./odcli list
105
- ./odcli read Inbox/today.md
106
- ./odcli read-lines Inbox/today.md 3 8
107
- ./odcli write Inbox/today.md --content "# Today"
108
- ./odcli write-lines Inbox/today.md 3 4 --content "- replaced\n- lines\n"
109
- ./odcli append Inbox/today.md --content "\n- new item"
110
- ./odcli search "project alpha"
111
- ```
112
-
113
- ## Commands
150
+ ## Command Summary
114
151
 
115
152
  ### `check`
116
153
 
@@ -187,27 +224,26 @@ Arguments:
187
224
  - `query`
188
225
  - `--case-sensitive`
189
226
 
190
- ### `plugin install`
191
-
192
- Install odcli helper skills for local coding tools.
227
+ ## For Developers
193
228
 
194
- Targets:
229
+ Run from source:
195
230
 
196
- - `codex-skill`: installs to `~/.codex/skills/odcli/SKILL.md`
197
- - `claude-skill`: installs to `~/.claude/skills/odcli/SKILL.md`
198
- - `all-skills`: installs both
231
+ ```bash
232
+ cd path/to/obsidian_cli
233
+ uv sync
234
+ uv run odcli --help
235
+ ```
199
236
 
200
- Examples:
237
+ Run tests:
201
238
 
202
239
  ```bash
203
- odcli plugin install codex-skill
204
- odcli plugin install claude-skill
205
- odcli plugin install all-skills
240
+ cd path/to/obsidian_cli
241
+ uv run python -m unittest discover -s tests
206
242
  ```
207
243
 
208
- ## Testing
244
+ Build distributions:
209
245
 
210
246
  ```bash
211
247
  cd path/to/obsidian_cli
212
- uv run python -m unittest discover -s tests
248
+ uv build
213
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.assertTrue(
141
- (self.vault_root / ".codex" / "skills" / "odcli" / "SKILL.md").is_file()
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.assertTrue(
149
- (self.vault_root / ".claude" / "skills" / "odcli" / "SKILL.md").is_file()
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))
File without changes
File without changes
File without changes