Skip to content

MeetTak/rmtrix

Repository files navigation

Micronaut 4.9.1 Documentation


Feature http-client documentation

Feature serialization-jackson documentation

rmtrix

A CLI tool built with Micronaut and Picocli for efficient system maintenance and automation, leveraging GraalVM native image for optimal performance.


Table of Contents


Prerequisites

  • Java 17 (GraalVM 17) installed via SDKMAN
    sdk install java 17.0.12-graal
    sdk use java 17.0.12-graal
  • Native Image tool installed:
    gu install native-image
    To verify installation:
    gu list
    You should see output resembling:
    ComponentId              Version             Component name                Stability     Origin
    -----------------------------------------------------------------------------------------------
    graalvm                  23.0.5              GraalVM Core                  Supported
    native-image             23.0.5              Native Image                  Early adopter
    

Note: Native Image is supported only by OpenJDKs (JDK 8 to JDK 17).


Setup

Clone this repository and navigate to its root directory.


Building the Project

Clean and Build

Use the Gradle Wrapper to clean and build the project:

./gradlew clean build

Enable Gradle Daemon

Using the Gradle Daemon will speed up builds (similar to JVM for Java).
Refer to the Gradle Daemon Documentation for setup and details.

Assemble with Daemon

To build the project with the Gradle Daemon:

./gradlew --daemon assemble

Running the Application

After building, you can run the CLI application using:

java -jar build/libs/rmtrix-0.1-all.jar Search -s ollama

Use Ctrl+C to terminate the current operation.


Native Image Compilation

Build a native executable using the following command:

native-image -cp build/libs/rmtrix-0.1-all.jar --initialize-at-run-time=ch.qos.logback,org.slf4j,io.netty --no-fallback com.github.meettak.RmtrixCommand rmtrix

Locate the Native Executable

To find where the binary was created:

find . -name rmtrix -type f -executable

Typically, it may be found in:

build/native/nativeCompile/rmtrix -s ollama

Making the CLI Globally Available

  1. Ensure the file is executable:
    chmod +x rmtrix
  2. Move the executable to a directory in your PATH:
    sudo mv rmtrix /usr/local/bin/
  3. Now you can run the CLI from anywhere:
    rmtrix Search -s <filename>

References


Acknowledgements

Special thanks to the stackoverflow-cli project, which inspired and supported aspects of this CLI's development.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages