Fetch your Nostr text notes (kind:1) and export them as daily Markdown files — perfect for Obsidian.
Nostrのテキストノート(kind:1)を取得して、日単位のMarkdownファイルに出力するツールです。Obsidianとの連携に最適。
- 📡 Fetch kind:1 events from multiple relays / 複数リレーからkind:1イベントを取得
- 📅 Group notes by day / 日単位でノートをグループ化
- 🎨 Customizable output via Eta templates / Etaテンプレートで出力を自由にカスタマイズ
- 🔗 Auto-generated nevent links / neventリンクを自動生成
- ⚙️ All settings in a single config file / 設定ファイル1つで管理
- Deno v2+
git clone https://github.com/yourname/nos2md.git
cd nos2mdCopy the sample config and edit it:
サンプル設定をコピーして編集してください:
cp config.sample.json config.jsonEdit config.json with your settings:
config.json を編集してください:
{
"relays": [
"wss://relay.damus.io",
"wss://nos.lol",
"wss://yabu.me"
],
"npub": "npub1your...pubkey",
"outputDir": "./output",
"timezone": "Asia/Tokyo",
"daysBack": 7,
"templateDir": "./templates",
"templateFile": "daily",
"linkPrefix": "https://njump.me/"
}deno task startOr with a custom config path / 設定ファイルのパスを指定する場合:
deno task start -- --config /path/to/config.jsonDaily Markdown files will be generated in your outputDir:
outputDir に日単位のMarkdownファイルが生成されます:
output/
├── 2026-01-29.md
├── 2026-01-30.md
├── 2026-01-31.md
├── 2026-02-01.md
├── 2026-02-02.md
├── 2026-02-03.md
└── 2026-02-04.md
| Key | Type | Default | Description |
|---|---|---|---|
relays |
string[] |
(required) | Relay URLs / リレーURL一覧 |
npub |
string |
(required) | Your npub / 取得対象のnpub |
outputDir |
string |
"./output" |
Output directory (supports {{YYYY}}, {{MM}}, {{DD}}, {{date}} placeholders) / 出力先ディレクトリ(テンプレート変数対応) |
timezone |
string |
"Asia/Tokyo" |
Timezone for date grouping / 日付グループ化のタイムゾーン |
daysBack |
number |
7 |
Number of days to fetch / 取得する日数 |
templateDir |
string |
"./templates" |
Template directory / テンプレートディレクトリ |
templateFile |
string |
"daily" |
Template file name (without .eta) / テンプレートファイル名(.etaなし) |
linkPrefix |
string |
"https://njump.me/" |
URL prefix for note links / ノートリンクのURLプレフィックス |
nos2md uses Eta as its template engine. Edit templates/daily.eta to customize the output.
nos2mdは Eta テンプレートエンジンを使用しています。templates/daily.eta を編集して出力をカスタマイズできます。
Top level / トップレベル:
| Variable | Description |
|---|---|
it.date |
Date string (YYYY-MM-DD) / 日付文字列 |
it.events |
Array of events / イベント配列 |
it.npub |
Configured npub / 設定されたnpub |
it.timezone |
Configured timezone / 設定されたタイムゾーン |
Each event (ev) / 各イベント:
| Variable | Description |
|---|---|
ev.time |
Formatted time (HH:MM) / フォーマット済み時刻 |
ev.content |
Note content / ノート本文 |
ev.noteId |
note1... encoded ID / note1... エンコードID |
ev.nevent |
nevent encoded ID (with relay hints) / neventエンコードID(リレーヒント付き) |
ev.link |
Full link (linkPrefix + nevent) / 完全なリンク |
ev.id |
Raw hex event ID / 生のhexイベントID |
ev.pubkey |
Author's hex pubkey / 投稿者のhex公開鍵 |
ev.created_at |
Unix timestamp / Unixタイムスタンプ |
ev.tags |
Event tags array / イベントタグ配列 |
# Nostr Notes - <%= it.date %>
> <%= it.events.length %> notes
---
<% for (const ev of it.events) { %>
### <%= ev.time %>
<%= ev.content %>
> [<%= ev.nevent.slice(0, 24) %>...](<%= ev.link %>)
---
<% } %>
Set outputDir to a folder inside your Obsidian vault. You can use template placeholders to match your Daily Notes folder structure:
outputDir にObsidian vaultのフォルダを指定してください。テンプレート変数を使ってDaily Notesのフォルダ構造に合わせられます:
{
"outputDir": "/path/to/your/vault/Nostr/{{YYYY}}/{{MM}}"
}Available placeholders / 使用可能なプレースホルダー:
| Placeholder | Example | Description |
|---|---|---|
{{YYYY}} |
2026 |
Year / 年 |
{{MM}} |
02 |
Month (zero-padded) / 月(ゼロ埋め) |
{{DD}} |
04 |
Day (zero-padded) / 日(ゼロ埋め) |
{{date}} |
2026-02-04 |
Full date / 日付 |
Example structures / フォルダ構造の例:
# Monthly folders / 月単位
"outputDir": "./vault/Nostr/{{YYYY}}/{{MM}}"
→ vault/Nostr/2026/02/2026-02-04.md
# Year-Month folders / 年月フォルダ
"outputDir": "./vault/Nostr/{{YYYY}}-{{MM}}"
→ vault/Nostr/2026-02/2026-02-04.md
# Flat / フラット
"outputDir": "./vault/Nostr"
→ vault/Nostr/2026-02-04.md
The daily files will appear as notes in Obsidian. You can also use Obsidian's Daily Notes plugin alongside these files.
日単位のファイルがObsidian上にノートとして表示されます。ObsidianのDaily Notesプラグインと組み合わせて使うこともできます。
MIT