Skip to content

Commit 4eadae5

Browse files
committed
Initial Custodian release
0 parents  commit 4eadae5

19 files changed

Lines changed: 3573 additions & 0 deletions

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
verify:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 24
15+
cache: npm
16+
- run: npm ci --no-audit --no-fund
17+
- run: npm run check

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "[0-9]+.[0-9]+.[0-9]+"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 24
19+
cache: npm
20+
- name: Verify tag and manifest
21+
shell: bash
22+
run: |
23+
VERSION=$(node -p "require('./manifest.json').version")
24+
test "$GITHUB_REF_NAME" = "$VERSION"
25+
- run: npm ci --no-audit --no-fund
26+
- run: npm run check
27+
- uses: softprops/action-gh-release@v2
28+
with:
29+
name: ${{ github.ref_name }}
30+
generate_release_notes: true
31+
files: |
32+
main.js
33+
manifest.json
34+
styles.css

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
data.json
3+
*.log
4+
*.map
5+
.DS_Store

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changelog
2+
3+
## 0.1.1
4+
5+
- Added ordered smart-folder rules with first-match-wins behavior.
6+
- Added title glob, frontmatter, tag, extension, and source-folder conditions.
7+
- Added templated destinations using note metadata and date values.
8+
- Added automatic organization on create, rename, and metadata changes.
9+
- Added vault-wide preview and organization commands.
10+
- Added collision protection, excluded folders, and loop-safe move scheduling.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Giblicious
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.

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Custodian
2+
3+
Rule-driven file organization for Obsidian.
4+
5+
Custodian turns ordinary vault folders into smart folders. Define ordered rules based on a file's title, YAML frontmatter, tags, extension, or current folder, and Custodian places matching files in their designated location.
6+
7+
## Install with BRAT
8+
9+
1. Install and enable **BRAT** in Obsidian.
10+
2. Open BRAT settings and choose **Add Beta Plugin**.
11+
3. Enter `Giblicious/custodian`.
12+
4. Enable **Custodian** under Community plugins.
13+
14+
Custodian supports Obsidian on desktop and mobile.
15+
16+
## Rules
17+
18+
Rules are evaluated from top to bottom. The first matching rule owns the file. Conditions within a rule are combined with **AND**; blank conditions are ignored.
19+
20+
Available conditions:
21+
22+
- **Title:** glob patterns such as `Meeting - *` or `* Invoice`
23+
- **Frontmatter:** property exists, does not exist, equals, or contains a value
24+
- **Tags:** require any or all listed tags
25+
- **Extension:** for example `md`, `pdf`, or `png`
26+
- **Source folder:** limit a rule to one part of the vault
27+
28+
Destinations may be static (`Projects/Active`) or templated:
29+
30+
- `Journal/{{year}}/{{month}}`
31+
- `Projects/{{property:project}}`
32+
- `Attachments/{{extension}}`
33+
- `People/{{property:owner}}`
34+
35+
Template values are sanitized into safe folder names. Custodian never overwrites a file and rejects paths that could escape the vault.
36+
37+
## Commands
38+
39+
- **Preview file organization:** report how many files would move without changing the vault
40+
- **Organize all files now:** apply the current rules across the vault
41+
42+
Automatic organization can be disabled globally while rules are being designed. Individual rules can also be disabled.
43+
44+
## Privacy
45+
46+
Custodian works entirely inside Obsidian. It has no network requests, telemetry, accounts, advertising, or analytics.
47+
48+
## Development
49+
50+
```sh
51+
npm install
52+
npm run check
53+
```
54+
55+
Create a semantic version tag matching `manifest.json` (for example `0.1.0`) to publish the BRAT release assets.
56+
57+
## License
58+
59+
MIT

SECURITY.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Security
2+
3+
Please report security issues privately through GitHub's security advisory form for this repository. Do not open a public issue for an unpatched vulnerability.
4+
5+
Custodian reads file paths and Obsidian metadata from the active vault and moves files only within that vault. It does not send vault data over the network and has no telemetry, accounts, advertising, or analytics.
6+
7+
Rules are stored in Obsidian's local plugin data. Before enabling a broad rule, use the preview command and keep a current backup or version history for the vault. Custodian refuses destinations that escape the vault and does not overwrite an existing file.

esbuild.config.mjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import esbuild from "esbuild";
2+
import process from "node:process";
3+
import builtins from "builtin-modules";
4+
5+
const production = process.argv[2] === "production";
6+
const context = await esbuild.context({
7+
entryPoints: ["src/main.ts"],
8+
bundle: true,
9+
external: ["obsidian", "electron", ...builtins],
10+
format: "cjs",
11+
target: "es2018",
12+
logLevel: "info",
13+
sourcemap: production ? false : "inline",
14+
treeShaking: true,
15+
outfile: "main.js"
16+
});
17+
18+
if (production) {
19+
await context.rebuild();
20+
await context.dispose();
21+
} else {
22+
await context.watch();
23+
}

0 commit comments

Comments
 (0)