mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-06-14 10:20:15 +00:00
+14
-12
@@ -61,8 +61,8 @@ lsync [database-path] [command] [args...]
|
|||||||
### Commands
|
### Commands
|
||||||
|
|
||||||
- `sync`: Run one replication cycle with the remote CouchDB.
|
- `sync`: Run one replication cycle with the remote CouchDB.
|
||||||
- `mirror [vault-path]`: Bidirectional sync between the local database and a local directory (**the actual vault**).
|
- `mirror [database-path] [vault-path]`: Bidirectional sync between the local database and a local directory (**the actual vault**).
|
||||||
- If `vault-path` is provided, the CLI will synchronise the database with files in that directory.
|
- If `vault-path` is provided, the CLI will synchronise the database with files in the vault directory.
|
||||||
- If `vault-path` is omitted, it defaults to `database-path` (compatibility mode).
|
- If `vault-path` is omitted, it defaults to `database-path` (compatibility mode).
|
||||||
- Use this command to keep your local `.md` files in sync with the database.
|
- Use this command to keep your local `.md` files in sync with the database.
|
||||||
- `ls [prefix]`: List files currently stored in the local database.
|
- `ls [prefix]`: List files currently stored in the local database.
|
||||||
@@ -229,7 +229,8 @@ The CLI uses the same settings format as the Obsidian plugin. Create a `.livesyn
|
|||||||
|
|
||||||
```
|
```
|
||||||
Usage:
|
Usage:
|
||||||
livesync-cli [database-path] [options] [command] [command-args]
|
livesync-cli <database-path> [options] <command> [command-args]
|
||||||
|
livesync-cli init-settings [path]
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
database-path Path to the local database directory (required except for init-settings)
|
database-path Path to the local database directory (required except for init-settings)
|
||||||
@@ -238,7 +239,8 @@ Options:
|
|||||||
--settings, -s <path> Path to settings file (default: .livesync/settings.json in local database directory)
|
--settings, -s <path> Path to settings file (default: .livesync/settings.json in local database directory)
|
||||||
--force, -f Overwrite existing file on init-settings
|
--force, -f Overwrite existing file on init-settings
|
||||||
--verbose, -v Enable verbose logging
|
--verbose, -v Enable verbose logging
|
||||||
--help, -h Show this help message
|
--debug, -d Enable debug logging (includes verbose)
|
||||||
|
--help, -h Show help message
|
||||||
|
|
||||||
Commands:
|
Commands:
|
||||||
init-settings [path] Create settings JSON from DEFAULT_SETTINGS
|
init-settings [path] Create settings JSON from DEFAULT_SETTINGS
|
||||||
@@ -248,16 +250,16 @@ Commands:
|
|||||||
p2p-host Start P2P host mode and wait until interrupted (Ctrl+C)
|
p2p-host Start P2P host mode and wait until interrupted (Ctrl+C)
|
||||||
push <src> <dst> Push local file <src> into local database path <dst>
|
push <src> <dst> Push local file <src> into local database path <dst>
|
||||||
pull <src> <dst> Pull file <src> from local database into local file <dst>
|
pull <src> <dst> Pull file <src> from local database into local file <dst>
|
||||||
pull-rev <src> <dst> <revision> Pull specific revision into local file <dst>
|
pull-rev <src> <dst> <rev> Pull specific revision <rev> into local file <dst>
|
||||||
setup <setupURI> Apply setup URI to settings file
|
setup <setupURI> Apply setup URI to settings file
|
||||||
put <vaultPath> Read text from standard input and write to local database
|
put <dst> Read text from standard input and write to local database path <dst>
|
||||||
cat <vaultPath> Write latest file content from local database to standard output
|
cat <src> Write latest file content from local database to standard output
|
||||||
cat-rev <vaultPath> <revision> Write specific revision content from local database to standard output
|
cat-rev <src> <rev> Write specific revision <rev> content from local database to standard output
|
||||||
ls [prefix] List files as path<TAB>size<TAB>mtime<TAB>revision[*]
|
ls [prefix] List files as path<TAB>size<TAB>mtime<TAB>revision[*]
|
||||||
info <vaultPath> Show file metadata including current and past revisions, conflicts, and chunk list
|
info <path> Show file metadata including current and past revisions, conflicts, and chunk list
|
||||||
rm <vaultPath> Mark file as deleted in local database
|
rm <path> Mark file as deleted in local database
|
||||||
resolve <vaultPath> <revision> Resolve conflict by keeping the specified revision
|
resolve <path> <rev> Resolve conflict by keeping the specified revision
|
||||||
mirror <storagePath> <vaultPath> Mirror local file into local database.
|
mirror [vaultPath] Mirror database contents to the local file system (vaultPath defaults to database-path)
|
||||||
```
|
```
|
||||||
|
|
||||||
Run via npm script:
|
Run via npm script:
|
||||||
|
|||||||
+22
-21
@@ -36,14 +36,15 @@ function printHelp(): void {
|
|||||||
Self-hosted LiveSync CLI
|
Self-hosted LiveSync CLI
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
livesync-cli [database-path] [options] [command] [command-args]
|
livesync-cli <database-path> [options] <command> [command-args]
|
||||||
|
livesync-cli init-settings [path]
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
database-path Path to the local database directory (required)
|
database-path Path to the local database directory
|
||||||
|
|
||||||
Commands:
|
Commands:
|
||||||
sync Run one replication cycle and exit
|
sync Run one replication cycle and exit
|
||||||
p2p-peers <timeout> Show discovered peers as [peer]<TAB><peer-id><TAB><peer-name>
|
p2p-peers <timeout> Show discovered peers as [peer]\t<peer-id>\t<peer-name>
|
||||||
p2p-sync <peer> <timeout>
|
p2p-sync <peer> <timeout>
|
||||||
Sync with the specified peer-id or peer-name
|
Sync with the specified peer-id or peer-name
|
||||||
p2p-host Start P2P host mode and wait until interrupted
|
p2p-host Start P2P host mode and wait until interrupted
|
||||||
@@ -54,29 +55,29 @@ Commands:
|
|||||||
put <dst> Read UTF-8 content from stdin and write to local database path <dst>
|
put <dst> Read UTF-8 content from stdin and write to local database path <dst>
|
||||||
cat <src> Read file <src> from local database and write to stdout
|
cat <src> Read file <src> from local database and write to stdout
|
||||||
cat-rev <src> <rev> Read file <src> at specific revision <rev> and write to stdout
|
cat-rev <src> <rev> Read file <src> at specific revision <rev> and write to stdout
|
||||||
ls [prefix] List DB files as path<TAB>size<TAB>mtime<TAB>revision[*]
|
ls [prefix] List DB files as path\tsize\tmtime\trevision[*]
|
||||||
info <path> Show detailed metadata for a file (ID, revision, conflicts, chunks)
|
info <path> Show detailed metadata for a file (ID, revision, conflicts, chunks)
|
||||||
rm <path> Mark a file as deleted in local database
|
rm <path> Mark a file as deleted in local database
|
||||||
resolve <path> <rev> Resolve conflicts by keeping <rev> and deleting others
|
resolve <path> <rev> Resolve conflicts by keeping <rev> and deleting others
|
||||||
mirror [vault-path] Mirror database contents to the local file system (vault-path defaults to database-path)
|
mirror [vault-path] Mirror database contents to the local file system (vault-path defaults to database-path)
|
||||||
Examples:
|
Examples:
|
||||||
livesync-cli ./my-database sync
|
livesync-cli ./my-database sync
|
||||||
livesync-cli ./my-database p2p-peers 5
|
livesync-cli ./my-database p2p-peers 5
|
||||||
livesync-cli ./my-database p2p-sync my-peer-name 15
|
livesync-cli ./my-database p2p-sync my-peer-name 15
|
||||||
livesync-cli ./my-database p2p-host
|
livesync-cli ./my-database p2p-host
|
||||||
livesync-cli ./my-database --settings ./custom-settings.json push ./note.md folder/note.md
|
livesync-cli ./my-database --settings ./custom-settings.json push ./note.md folder/note.md
|
||||||
livesync-cli ./my-database pull folder/note.md ./exports/note.md
|
livesync-cli ./my-database pull folder/note.md ./exports/note.md
|
||||||
livesync-cli ./my-database pull-rev folder/note.md ./exports/note.old.md 3-abcdef
|
livesync-cli ./my-database pull-rev folder/note.md ./exports/note.old.md 3-abcdef
|
||||||
livesync-cli ./my-database setup "obsidian://setuplivesync?settings=..."
|
livesync-cli ./my-database setup "obsidian://setuplivesync?settings=..."
|
||||||
echo "Hello" | livesync-cli ./my-database put notes/hello.md
|
echo "Hello" | livesync-cli ./my-database put notes/hello.md
|
||||||
livesync-cli ./my-database cat notes/hello.md
|
livesync-cli ./my-database cat notes/hello.md
|
||||||
livesync-cli ./my-database cat-rev notes/hello.md 3-abcdef
|
livesync-cli ./my-database cat-rev notes/hello.md 3-abcdef
|
||||||
livesync-cli ./my-database ls notes/
|
livesync-cli ./my-database ls notes/
|
||||||
livesync-cli ./my-database info notes/hello.md
|
livesync-cli ./my-database info notes/hello.md
|
||||||
livesync-cli ./my-database rm notes/hello.md
|
livesync-cli ./my-database rm notes/hello.md
|
||||||
livesync-cli ./my-database resolve notes/hello.md 3-abcdef
|
livesync-cli ./my-database resolve notes/hello.md 3-abcdef
|
||||||
livesync-cli init-settings ./data.json
|
livesync-cli init-settings ./data.json
|
||||||
livesync-cli ./my-database --verbose
|
livesync-cli ./my-database --verbose
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user