xbscli

command module
v0.0.0-...-1394002 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

README

xbscli - CLI interface for xBrowserSync

xbscli is a command line client for interacting with the xBrowserSync API.

NOTE: this project is not affiliated with the xBrowserSync project in any way

NOTE: this project is also in a very early stage of development - the interfaces (commands, output) are likely to change.

Installation

go install git.sr.ht/~bitfehler/xbscli

Or checkout the repo and run go build.

Usage

Config file

Create a config file at $XDG_CONFIG_HOME/xbscli/config (usually this resolves to ~/.config/xbscli/config). The config file is in .ini format. Example config:

[xbscli]

# Change this if you are using a different server
api = https://api.xbrowsersync.org

# Your Sync ID
sync-id = ae6d5e350f27449ebfac406607da626e

# Uncomment this to store the password in the config file. But using a command
# (see below) is preferrable
#password = mySecretSyncPassword

# Use a command to get the password
pass-cmd = pass show web/api.xbrowsersync.org

Commands

For all commands, additional help can be displayed with the -h flag.

Show current bookmarks in JSON format:

xbscli bookmarks show

Show the "last-updated" timestamp of current bookmarks:

xbscli bookmarks show -l

Update the bookmarks stored on the server:

cat bookmarks.json | xbscli bookmarks write -l 2022-03-08T18:38:36.698Z

NOTE: handling of potential synchronization conflicts is currently left to the user, be careful when using multiple clients at the same time.

Show API info:

xbscli info

Low level commands

There are low level commands for encoding and decoding data in a way that is compatible with the official clients. They could be used as minimal building blocks for scripts if you want to tinker with the API.

Example:

curl -Ss https://api.xbrowsersync.org/bookmarks/ae6d5e350f27449ebfac406607da626e \
  | jq -r .bookmarks | ./xbscli decode

There is also the inverse encode command, but usage is left as an excercise to the reader.

The low-level commands still require a proper config file, as both the Sync ID as well as the password are required for the encryption or decryption process.

Contact

Until something more appropriate is in place, feel free to send comments, questions, or patches to my public inbox.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL