/altv-cli

handy altv cli tool, for fast and easy updates of your local altv-server, integrating nicely in ci

Primary LanguageGo

altv cli Test & Release License Version

⚠️  Not production ready yet! This cli is very experimental and has not reached a stable release yet.

Incredibly flexible and easy to use altv server manager. Install or update only necessary files, reducing the bandwidth usage and time spent to a minimum. Supports every official module and continues working even on module file renamings by respecting their manifest.json. Extendable to support custom modules, feel free to open a pull request to add compatibility.

Table of Contents

Motivation

There are several altv server updater libraries and scripts out there, but none of them is as flexible and resilient as this one. I was annoyed by the fact that I always had to download the whole server files every time an update released. This is especially annoying if your internet connection poor. Additionally I wanted to have a tool that is able to update the server files even if the module files are renamed. See for example the js-module node library name.

Features

  • ⚑  Fast
  • πŸ”€  Flexible
  • πŸ’Ž  Resilient
  • πŸ…  Supports every official module
  • πŸ›   Supports custom modules
  • πŸ“‰  Reduces bandwidth usage to a minimum

Planned Features

  • πŸ”¨  Workspace configs for use of cli without having to set flags every time: altv init -p ./server -b dev -t 30
  • βš™   JSON configuration for cdn's
  • πŸ€–  CI integrations

Supported Modules

  • βœ…  alt:V Server (server)
  • βœ…  alt:V Server Data (data-files)
  • βœ…  JS Module v1 (js-module)
  • βœ…  JS Bytecode Module (js-bytecode-module)
  • βœ…  C# Module (csharp-module)
  • 🚧  alt:V Voice (voice)
  • 🚧  JS Module v2 (js-module-v2)
  • ⚠️  Go Module (go-module)

    Go Module uses experimental custom github cdn provider. No checksum support.

Installation

If you have Go installed, you can install the cli with the following command:

go install github.com/timo972/altv-cli/cmd/altv@latest

Otherwise you can use the prebuilt binaries from github releases or npm. (❗x64 linux / windows only❗)

# npm / yarn / pnpm
npm i -g @timo972/altv-cli

Usage

Type altv --help to get a list of all available commands and flags.
Consider using Makefile or a package.json script to simplify the usage.

Example Makefile:

.PHONY: install update verify

dir = ./server
branch = dev
timeout = 30

install:
    altv install -p $dir -b $branch -m server -m data-files -m csharp-module -m js-module -t $timeout
update:
    altv update -p $dir -b $branch -m server -m data-files -m csharp-module -m js-module -t $timeout
verify:
    altv verify -p $dir -b $branch -m server -m data-files -m csharp-module -m js-module -t $timeout

Example package.json:

{
  "scripts": {
    "altv-install": "altv install -p ./server -b dev -m server -m data-files -m csharp-module -m js-module -t 30",
    "altv-update": "altv update -p ./server -b dev -m server -m data-files -m csharp-module -m js-module -t 30",
    "altv-verify": "altv verify -p ./server -b dev -m server -m data-files -m csharp-module -m js-module -t 30"
  }
}

This way you can use make install, make update or make verify to install, update or verify your server files.
If you prefer using npm, you can use npm run altv-install, npm run altv-update or npm run altv-verify instead.