/fluent-cli

A fluent CLI for Domino

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

Domino Data Lab Fluent CLI

License: GPL 3.0 Quarkus CI

Domino Data Lab Fluent CLI (Command Line Interface) is a client used provision and control Domino.

Features

  • Ability to output results as plain text, JSON, or XML
  • Zero dependency native executable
  • Detailed context sensitive help for each command
  • Easily script and chain commands together in your favorite shell (Bash, PowerShell, etc)

Requirements

To use this CLI you will need to download the binary for your operating system such as Windows, Linux, or MacOS. We provide pre-built binaries that have no other requirements found on our Releases page.

Domino Settings

To connect to Domino you will need at least the URL of where your Domino installation is and a personal API key to access the API. You can set your variables either as environment variables DOMINO_API_KEY and DOMINO_API_URL or use the command line parameters -k and -u.

Linux

To add environment variables in Linux so that they are always available upon login, you can modify the shell configuration file for your user. The specific file you need to edit may vary depending on the shell you are using (e.g., Bash, Zsh). Here are the general steps to add environment variables:

  1. Identify the shell you are using: Open a terminal and type echo $SHELL. This will display the path to the current shell binary.

  2. Open the shell configuration file: Use a text editor to open the configuration file for your shell. Here are some common configuration files for popular shells:

    • Bash: ~/.bashrc or ~/.bash_profile
    • Zsh: ~/.zshrc or ~/.zprofile
    • Fish: ~/.config/fish/config.fish
  3. Add environment variable assignments: Open the shell configuration file in a text editor and add the following lines at the end:

export DOMINO_API_KEY="your_api_key"
export DOMINO_API_URL="your_api_url"

Replace "your_api_key" and "your_api_url" with the actual values you want to assign to the environment variables.

  1. Save and close the file.

  2. Apply the changes: To make the environment variables available in your current terminal session, run the following command in the terminal:

source ~/.bashrc

Replace ~/.bashrc with the actual path to your shell configuration file if you are using a different file.

Now, the environment variables DOMINO_API_KEY and DOMINO_API_URL will be set every time you log in to your Linux system or open a new terminal session.

Windows

To add your environment variables in Windows Powershell you can add them like this:

[Environment]::SetEnvironmentVariable("DOMINO_API_KEY", "your_api_key", "User")
[Environment]::SetEnvironmentVariable("DOMINO_API_URL", "your_api_url", "User")

Replace "your_api_key" and "your_api_url" with the actual values you want to assign to the environment variables.

Test

To test the CLI is working, run the following command to print out your current user information:

$ domino-cli user current

If you are not using environment variables it would be:

$ domino-cli -k YOUR_KEY -u https://domino.yourcompany.com/v4 user current

Output:

{
  "firstName": "Homer",
  "lastName": "Simpson",
  "fullName": "Homer Simpson",
  "id": "6124ffbfa7db86282dde302a",
  "userName": "hs12345",
  "email": "homer.simpson@springfield.org"
}

Help

image

Build

To build the project requires Apache Maven. You can build as a JAR file which requires a JVM to run, or as a native executable which requires nothing else to run.

JVM Build

$ mvn clean package

To test the CLI:

$ java -jar ./target/domino-cli.jar --version

    ___                _
   /   \___  _ __ ___ (_)_ __   ___
  / /\ / _ \| '_ ` _ \| | '_ \ / _ \
 / /_// (_) | | | | | | | | | | (_) |
/___,' \___/|_| |_| |_|_|_| |_|\___/

Domino CLI 2.0.0-SNAPSHOT
Copyright 2023, OpenSCE Collaborative
Java OpenJDK Runtime Environment 11.0.18+10 Oracle Corporation
OS Windows 10 10.0 amd64

Native Executable Build

Quarkus has excellent instructions for building native executables.

Linux

For Linux follow the instructions for building native executables which may require you to installed GraalVM.
Once you have everything installed you can build a Linux native executable with:

mvn clean package -Pnative

Windows

To build a native executable on Windows will require you install the Visual Studio 2017 Visual C++ Build Tools or if you already have full Visual Studio installed. Once you have everything installed you can build a Windows native executable with:

mvn clean package -Pnative

You will find the fully portable executable in /target/domino-cli-2.0.0.exe which you can rename and move to any other windows machine.

Releasing

  • Click on GitHub Actions
  • Find the Release action and execute the action manually
  • It will ask for Release version and next SNAPSHOT version. Simply fill out and it is all automated!

License

Licensed under the GNU General Public License version 3.

SPDX-License-Identifier: GPL-3.0-or-later

Copyright

Domino and Domino Data Lab are © 2023 Domino Data Lab, Inc. Made in San Francisco.