Crates.io | cg-local |
lib.rs | cg-local |
version | 0.1.1 |
source | src |
created_at | 2024-02-11 09:47:20.801129 |
updated_at | 2024-02-15 06:01:19.950551 |
description | Rust port of the original CG local app |
homepage | |
repository | https://codeberg/Vulpesx/cg-local |
max_upload_size | |
id | 1135743 |
size | 35,579 |
Rust implementation of local CG Local. A replacement of the Java App and works with the original extensions
download the latest and run it
# linux
./path/to/cg-local [options] --target <TARGET>
# windows
.\path\to\cg-local.exe [options] --target <TARGET>
cargo install cg-local
git clone https://codeberg.org/Vulpesx/cg-local.git && cd cg-local
cargo install --path .
Usage: cg-local [OPTIONS] --target <TARGET>
Options:
-b, --bind <BIND>
Address to bind to, DO NOT CHANGE
this is the port the original extensions connect to changing this will mean the original extions wont work this is to support other extensions if they exist
[default: 127.0.0.1:53135]
-t, --target <TARGET>
Path to target file, doesnt have to exist
cg-local will watch this file for changes and upload them to the extension and download from the extension if twoway or download
-d, --download
downloads the file immediately
download the file on connection to extension
-p, --play
auto play on file upload
sets the extension to when it receives new code to play the test cases
--two-way
two way synchronizing, you can use the IDE too
when the extension detects changes in the browser side ide it will send them to cg-local, this will set cg-local to accept the changes and write them to the file, you may have to reload editor to see them locally
--timeout <TIMEOUT>
time to wait for browser extension (ms)
the time cg-local waits for the extension to send something this cannot be zero, if zero it would wait forever but dont worry cg-local wont accept a zero
[default: 500]
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
# Synchronize main.rs with the IDE, enable auto-play by default
cg-local -p -t main.rs
done unless someone makes a new extension, then i might update it
jmerle for the orginal app and extensions as well as vtavernier for a rust port of the original app that allowed me to make my first version despite being very sleep deprived.
you might be pleased to know that my port is less than half the code of vtavernier's and without an ungodly amount of async. pls check if using async or a lib to do something is over kill, you do not need another thread to watch a file or that much async either.