diff --git a/.gitignore b/.gitignore
index 908a233..265c637 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,9 @@
-dist
-repos
+/dist
+/repos
+/target
+/CLAUDE.md
+/.claude
node_modules
package-lock.json
-CLAUDE.md
-.claude
+Cargo.lock
.env
-target
diff --git a/Cargo.toml b/Cargo.toml
index 5254d46..d4485b1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,4 +2,22 @@
name = "ailog"
version = "0.2.0"
edition = "2021"
+description = "ATProto blog CLI"
+authors = ["syui"]
+homepage = "https://syui.ai"
+repository = "https://git.syui.ai/ai/log"
+[[bin]]
+name = "ailog"
+path = "src/main.rs"
+
+[dependencies]
+clap = { version = "4.5", features = ["derive"] }
+serde = { version = "1.0", features = ["derive"] }
+serde_json = "1.0"
+reqwest = { version = "0.12", features = ["json", "rustls-tls"], default-features = false }
+tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
+anyhow = "1.0"
+dirs = "5.0"
+chrono = { version = "0.4", features = ["serde"] }
+rand = "0.8"
diff --git a/content/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.post/3mchqlshygs2s.json b/content/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.post/3mchqlshygs2s.json
index 60ce66d..e38992b 100644
--- a/content/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.post/3mchqlshygs2s.json
+++ b/content/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.post/3mchqlshygs2s.json
@@ -1,18 +1,18 @@
{
- "uri": "at://did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.post/3mchqlshygs2s",
"cid": "bafyreielgn743kg5xotfj5x53edl25vkbbd2d6v7s3tydyyjsvczcluyme",
+ "uri": "at://did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.post/3mchqlshygs2s",
"value": {
- "cid": "bafyreidymanu2xk4ftmvfdna3j7ixyijc37s6h3aytstuqgzatgjl4tp7e",
- "uri": "at://did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.post/3mchqlshygs2s",
"$type": "ai.syui.log.post",
- "title": "ailogを作り直した",
+ "cid": "bafyreidymanu2xk4ftmvfdna3j7ixyijc37s6h3aytstuqgzatgjl4tp7e",
"content": "## ailogとは\n\natprotoと連携するサイトジェネレータ。\n\n## ailogの使い方\n\n```sh\n$ git clone https://git.syui.ai/ai/log\n$ cd log\n$ cat public/config.json\n{\n \"title\": \"syui.ai\",\n \"handle\": \"syui.syui.ai\",\n \"collection\": \"ai.syui.log.post\",\n \"network\": \"syu.is\",\n \"color\": \"#0066cc\",\n \"siteUrl\": \"https://syui.ai\"\n}\n---\n$ npm run dev\n```\n\n## ailogのコンセプト\n\n1. at-browserを基本にする\n2. atproto oauthでログインする\n3. ログインしたアカウントで記事をポストする\n\n## ailogの追加機能\n\n1. atproto recordからjsonをdownloadすると表示速度が上がる(ただし更新はlocalから)\n2. コメントはurlの言及を検索して表示\n\n```sh\n$ npm run fetch\n$ npm run generate\n```",
"createdAt": "2026-01-15T13:59:52.367Z",
+ "title": "ailogを作り直した",
"translations": {
"en": {
- "title": "recreated ailog",
- "content": "## What is ailog?\n\nA site generator that integrates with the atproto framework.\n\n## How to Use ailog\n\n```sh\n$ git clone https://git.syui.ai/ai/log\n$ cd log\n$ cat public/config.json\n{\n \"title\": \"syui.ai\",\n \"handle\": \"syui.syui.ai\",\n \"collection\": \"ai.syui.log.post\",\n \"network\": \"syu.is\",\n \"color\": \"#0066cc\",\n \"siteUrl\": \"https://syui.ai\"\n}\n---\n$ npm run dev\n```\n\n## ailog's Concept\n\n1. Based on at-browser as its foundation\n2. Authentication via atproto oAuth\n3. Post articles using the logged-in account\n\n## Additional Features of ailog\n\n1. Downloading JSON from atproto record improves display speed (though updates still come from local storage)\n2. Comments are displayed by searching for URL mentions\n\n```sh\n$ npm run fetch\n$ npm run generate\n```"
+ "content": "## What is ailog?\n\nA site generator that integrates with the atproto framework.\n\n## How to Use ailog\n\n```sh\n$ git clone https://git.syui.ai/ai/log\n$ cd log\n$ cat public/config.json\n{\n \"title\": \"syui.ai\",\n \"handle\": \"syui.syui.ai\",\n \"collection\": \"ai.syui.log.post\",\n \"network\": \"syu.is\",\n \"color\": \"#0066cc\",\n \"siteUrl\": \"https://syui.ai\"\n}\n---\n$ npm run dev\n```\n\n## ailog's Concept\n\n1. Based on at-browser as its foundation\n2. Authentication via atproto oAuth\n3. Post articles using the logged-in account\n\n## Additional Features of ailog\n\n1. Downloading JSON from atproto record improves display speed (though updates still come from local storage)\n2. Comments are displayed by searching for URL mentions\n\n```sh\n$ npm run fetch\n$ npm run generate\n```",
+ "title": "recreated ailog"
}
- }
+ },
+ "uri": "at://did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.post/3mchqlshygs2s"
}
-}
+}
\ No newline at end of file
diff --git a/content/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/app.bsky.actor.profile/self.json b/content/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/app.bsky.actor.profile/self.json
index 8a3ebf5..b62a032 100644
--- a/content/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/app.bsky.actor.profile/self.json
+++ b/content/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/app.bsky.actor.profile/self.json
@@ -1,18 +1,18 @@
{
- "uri": "at://did:plc:vzsvtbtbnwn22xjqhcu3vd6y/app.bsky.actor.profile/self",
"cid": "bafyreihlch2vdee6wpydo2bwap7nyzszjz6focbtxikz7zljcejxz27npy",
+ "uri": "at://did:plc:vzsvtbtbnwn22xjqhcu3vd6y/app.bsky.actor.profile/self",
"value": {
"$type": "app.bsky.actor.profile",
"avatar": {
"$type": "blob",
+ "mimeType": "image/jpeg",
"ref": {
"$link": "bafkreigta4pf5h7uvx6jpfcm3d6aeq4g3qpsiqjdoeytnutwp6vwc2yo7u"
},
- "mimeType": "image/jpeg",
"size": 166370
},
"createdAt": "2025-09-19T06:17:42Z",
"description": "",
"displayName": "syui"
}
-}
+}
\ No newline at end of file
diff --git a/content/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/describe.json b/content/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/describe.json
index 2e46361..70d3c25 100644
--- a/content/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/describe.json
+++ b/content/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/describe.json
@@ -1,39 +1,13 @@
{
- "handle": "syui.syui.ai",
- "did": "did:plc:vzsvtbtbnwn22xjqhcu3vd6y",
- "didDoc": {
- "@context": [
- "https://www.w3.org/ns/did/v1",
- "https://w3id.org/security/multikey/v1",
- "https://w3id.org/security/suites/secp256k1-2019/v1"
- ],
- "id": "did:plc:vzsvtbtbnwn22xjqhcu3vd6y",
- "alsoKnownAs": [
- "at://syui.syui.ai"
- ],
- "verificationMethod": [
- {
- "id": "did:plc:vzsvtbtbnwn22xjqhcu3vd6y#atproto",
- "type": "Multikey",
- "controller": "did:plc:vzsvtbtbnwn22xjqhcu3vd6y",
- "publicKeyMultibase": "zQ3shZj81oA4A9CmUQgYUv97nFdd7m5qNaRMyG16XZixytTmQ"
- }
- ],
- "service": [
- {
- "id": "#atproto_pds",
- "type": "AtprotoPersonalDataServer",
- "serviceEndpoint": "https://syu.is"
- }
- ]
- },
"collections": [
"ai.syui.log.post",
"app.bsky.actor.profile",
"app.bsky.feed.post",
"app.bsky.feed.repost",
"app.bsky.graph.follow",
- "chat.bsky.actor.declaration"
+ "chat.bsky.actor.declaration",
+ "com.atproto.lexicon.schema"
],
- "handleIsCorrect": true
-}
+ "did": "did:plc:vzsvtbtbnwn22xjqhcu3vd6y",
+ "handle": "syui.syui.ai"
+}
\ No newline at end of file
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..140ef9a
--- /dev/null
+++ b/index.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+ ailog
+
+
+
+
+
+
+
diff --git a/public/favicon.svg b/public/favicon.svg
new file mode 100644
index 0000000..5813502
--- /dev/null
+++ b/public/favicon.svg
@@ -0,0 +1,67 @@
+
+
+
diff --git a/readme.md b/readme.md
index bb09443..f9c16f1 100644
--- a/readme.md
+++ b/readme.md
@@ -152,13 +152,20 @@ curl "https://syu.is/xrpc/com.atproto.repo.listRecords?repo=did:plc:xxx&collecti
### Local (Static File)
```
-public/records/ai.syui.log.post/3xxx.json
+content/
+└── did:plc:xxx/
+ ├── describe.json # describeRepo (special)
+ ├── app.bsky.actor.profile/
+ │ └── self.json # {collection}/{rkey}.json
+ └── ai.syui.log.post/
+ └── 3xxx.json # {collection}/{rkey}.json
```
```json
+// content/did:plc:xxx/ai.syui.log.post/3xxx.json
{
"uri": "at://did:plc:xxx/ai.syui.log.post/3xxx",
- "cid": "local",
+ "cid": "bafyrei...",
"value": {
"title": "Hello World",
"content": "# Hello\n\nThis is my post.",
@@ -167,13 +174,23 @@ public/records/ai.syui.log.post/3xxx.json
}
```
+### ATProto API Reference
+
+| API | Path | Description |
+|-----|------|-------------|
+| getRecord | `/xrpc/com.atproto.repo.getRecord` | Get single record |
+| listRecords | `/xrpc/com.atproto.repo.listRecords` | List records in collection |
+| describeRepo | `/xrpc/com.atproto.repo.describeRepo` | Get repo info + collections list |
+
+See: [com.atproto.repo.describeRepo](https://docs.bsky.app/docs/api/com-atproto-repo-describe-repo)
+
### Resolution Strategy
```
at-browser
│
├── admin (config.json user)
- │ ├── 1. Check local: /records/{collection}/{rkey}.json
+ │ ├── 1. Check local: /content/{did}/{collection}/{rkey}.json
│ └── 2. Fallback to remote: PDS API
│
└── user (/@handle)
@@ -202,11 +219,87 @@ at-browser
## Tech Stack
+- **CLI**: Rust (ailog)
- **Frontend**: Vite + TypeScript
- **ATProto**: @atproto/api
- **OAuth**: @atproto/oauth-client-browser
- **Markdown**: marked + highlight.js
+## CLI (ailog)
+
+### Install
+
+```bash
+cargo build --release
+cp target/release/ailog ~/.local/bin/
+```
+
+### Commands
+
+```bash
+# Login to ATProto PDS
+ailog login -p [-s ]
+
+# Post a record
+ailog post -c [-r ]
+
+# Get records from collection
+ailog get -c [-l ]
+
+# Delete a record
+ailog delete -c -r
+
+# Sync PDS data to local content directory
+ailog sync [-o