Skip to content

The cli-lite is a lightweight yet powerful command-line interface designed to make managing Balancer's infrastructure effortless, even for non-technical users.

License

Notifications You must be signed in to change notification settings

bitcoin-balancer/cli-lite

Repository files navigation

cli-lite

The cli-lite is a lightweight yet powerful command-line interface designed to make managing Balancer's infrastructure effortless, even for non-technical users. It enables you to:

  • Quickly set up your instance – Scaffold your Balancer instance safely and efficiently, following best practices
  • Automate infrastructure tasks – Seamlessly handle provisioning, scaling, and monitoring with minimal effort
  • Securely access remote servers – Connect to your production environment via secure SSH connections on DigitalOcean
  • And more!

With its intuitive syntax and comprehensive functionality, cli-lite streamlines complex operations, saves time, and ensures consistency in infrastructure management.




Usage

Navigate into cli-lite directory and start the program:

cd cli-lite && npm start




Requirements

Software

  • UNIX-like OS
  • git ^v2.43.0
  • Node.js ^v22.11.0
  • npm ^v10.9.0
  • Docker Engine ^v27.3.1
  • Docker Compose ^v2.29.7

Hardware

  • 1 Shared CPU
  • 1 GB Memory
  • 25 GB Storage (Regular SSD)




Getting Started

  1. Setup a virtual machine (DigitalOcean)
  2. Install dependencies
  3. Install and configure cli-lite
  4. Setup Telegram (Optional)




CLI Actions

Docker Compose

up

Generates the environment assets and the compose.yaml file. Next, it prunes docker objects and restarts the daemon. Finally, it pulls the latest images from the registry, creates and starts the containers.


When executed, after generating the environment assets and the compose.yaml file, it runs:

docker system prune --all --force

systemctl restart docker

docker compose up --pull always --no-build --detach

down

Stops containers and removes containers, networks, volumes, and images created by up.


When executed, it runs:

docker compose down

down-up

Stops containers and removes containers, networks, volumes, and images created by up with:


docker compose down

Finally, it generates the environment assets, the compose.yaml file and runs:


docker system prune --all --force

systemctl restart docker

docker compose up --pull always --no-build --detach


restart

Restarts all stopped and running services with:


docker compose restart

logs

Displays and subscribes to the log output from all services. If a variation is provided, it narrows down the logs to a specific service.

docker compose logs -f

# if a variation is provided
docker compose logs <variation> -f

The following variations are supported:

  • logs:postgres displays log output from the postgres service

  • logs:api displays log output from the api service

  • logs:gui displays log output from the gui service

  • logs:ct displays log output from the cloudflared service


prune

Removes all unused containers, networks and images (both dangling and unused) with:

docker system prune --all --force

restart-daemon

Restarts the Docker service on the host machine with:

systemctl restart docker


Configuration

view-config

Displays the data stored in the config.json file.


update-config-*

Updates the mutable properties in the config.json file one at a time. The following properties are mutable and can be changed by this action:

  • GUI_URL
  • TELEGRAM
  • EXCHANGE_*
  • TUNNEL_TOKEN


CLI Management

update-cli

Downloads the latest version of cli-lite, installs its dependencies, and compiles it.


When executed, it runs:

git pull origin main

npm ci

npm run build


Database Management

psql

Starts the terminal-based front-end to PostgreSQL.


When executed, it runs:

docker compose exec -it postgres psql -U postgres




Docker Images




Tests

# run the integration tests
npm run test:integration

# run the unit tests
npm run test:unit




License

Apache v2.0

About

The cli-lite is a lightweight yet powerful command-line interface designed to make managing Balancer's infrastructure effortless, even for non-technical users.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published