update readme
This commit is contained in:
97
readme.md
97
readme.md
@@ -1,7 +1,104 @@
|
|||||||
# ailog
|
# ailog
|
||||||
|
|
||||||
|
ATProto blog CLI
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ cargo build --release
|
||||||
|
$ cp target/release/ailog ~/.cargo/bin/
|
||||||
|
```
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ vim public/config.json
|
$ vim public/config.json
|
||||||
$ npm run build
|
$ npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
### login (l)
|
||||||
|
|
||||||
|
Login to ATProto PDS.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ ailog login <handle> -p <password> [-s <server>]
|
||||||
|
$ ailog l user.bsky.social -p mypassword
|
||||||
|
$ ailog l user.syu.is -p mypassword -s syu.is
|
||||||
|
```
|
||||||
|
|
||||||
|
### post (p)
|
||||||
|
|
||||||
|
Post a record to collection.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ ailog post <file> -c <collection> [-r <rkey>]
|
||||||
|
$ ailog p ./post.json -c ai.syui.log.post
|
||||||
|
$ ailog p ./post.json -c ai.syui.log.post -r 3abc123
|
||||||
|
```
|
||||||
|
|
||||||
|
### get (g)
|
||||||
|
|
||||||
|
Get records from collection.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ ailog get -c <collection> [-l <limit>]
|
||||||
|
$ ailog g -c ai.syui.log.post
|
||||||
|
$ ailog g -c ai.syui.log.post -l 20
|
||||||
|
```
|
||||||
|
|
||||||
|
### delete (d)
|
||||||
|
|
||||||
|
Delete a record from collection.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ ailog delete -c <collection> -r <rkey>
|
||||||
|
$ ailog d -c ai.syui.log.post -r 3abc123
|
||||||
|
```
|
||||||
|
|
||||||
|
### sync (s)
|
||||||
|
|
||||||
|
Sync PDS data to local content directory.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ ailog sync [-o <output>]
|
||||||
|
$ ailog s
|
||||||
|
$ ailog s -o ./public/content
|
||||||
|
```
|
||||||
|
|
||||||
|
### lexicon
|
||||||
|
|
||||||
|
Update lexicon schema.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ ailog lexicon <file>
|
||||||
|
$ ailog lexicon ./lexicons/ai.syui.log.post.json
|
||||||
|
```
|
||||||
|
|
||||||
|
### gen
|
||||||
|
|
||||||
|
Generate lexicon code from ATProto lexicon JSON files.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ ailog gen [-i <input>] [-o <output>]
|
||||||
|
$ ailog gen
|
||||||
|
$ ailog gen -i ./repos/atproto/lexicons -o ./src/lexicons
|
||||||
|
```
|
||||||
|
|
||||||
|
### lang
|
||||||
|
|
||||||
|
Translate content files using LMS.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ ailog lang <input> [-f <from>] [-t <to>]
|
||||||
|
$ ailog lang ./post.json
|
||||||
|
$ ailog lang ./public/content -f ja -t en
|
||||||
|
```
|
||||||
|
|
||||||
|
Requires `.env`:
|
||||||
|
|
||||||
|
```
|
||||||
|
TRANSLATE_URL=http://127.0.0.1:1234/v1
|
||||||
|
TRANSLATE_MODEL=plamo-2-translate
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user