An implementation of the localsend protocol in go. The gclsnd binary has only the cli logic, the gocalsend binary supports both cli and tui mode.
The actual parameters might still change in the future.
Use gclsnd --cmd=ls
to discover peers.
gclsnd --cmd=ls --lstime=4
The lstime
parameter is optional and specifies how long to wait for peers to respond.
After having found the alias of the peer you want to send your files to, use gclsnd --cmd=send
to send them.
gclsnd --cmd=send --peer=<your peer alias here> <file1> <file2> <file3>
Instead of --cmd=send
you could also use the short form '--cmd=snd'. Gotta save those characters.
Use gclsnd --cmd=receive
to wait for incoming files from peers on the network.
gclsnd --cmd=receive
Gocalsend accepts all incoming sessions right now and saves their files to the base download folder. To change where the files go, use the --out=<path>
flag. If you need gocalsend to use a different port use the --port=1234
flag. The default port is 53317 as used by the localsend reference implementation.
gclsnd --cmd=receive --out=<path> --port=53320
Instead of receive
you may also pass rcv
, rec
or recv
to save some time.
If you really want to save time then don't pass any command, to receive files is the default behavior.
gocalsend uses a rsa 2048 bit privte key as that is what the localsend reference implementation does. Per default, gocalsend generates certificates in the config folder if they don't already exist If you want to use your own certificate you will have to specify where the cert and its key are stored, either via flags or in the config file.
gclsnd --cert=<path/to/cert> --key=<path/to/key>
The log level can be set to one of either none
, debug
or info
.
gocalsend --loglevel=debug
The none
log level will be implemented soonTM
gocalsend --help
The configuration file is stored in the xdg config folder. If this environment variable is unset this location defaults to $HOME/.config/ on unix based systems or %appdata% on windows.
When first running gocalsend the program will create a new folder called gocalsend
in this directory. Within that folder you will find a file called config.toml
as well as the tls certificate and key. The keys of the configuration file are not yet final, which is indicated by the version number 0 in the config file. Command line flags always take precedence over values from the config file. The --config
flag can be used to supply a different configuration.
Building requires make
and the go compiler. If you are running windows you can use GnuMake32.
Run for a release build:
make release
The resulting binary is build/release/gocalsend
. The default build is in release mode, so you could also just run make
.
For a development build with debug symbols and a bunch of odd test binaries:
make debug
- protocol Protocol documentation
- charmbracelet/log A slog compatible pretty logger
- charmbracelet/bubbletea Awesome terminal ui framework
- charmbracelet/bubbles Useful stylable components
- charmbracelet/lipgloss CSS like styling for bubbletea
- go-toml toml parsing
If your implementation is missing here, let me know
- localsend The reference implementation
- localsend-rs Awesome rust tui
- go-localsend An alternative go implementation, check the docs folder for the english readme