Intro

I find one of the barriers to using the Domo CLI effectively can often be its reliance on needing to be stored and executed locally from a users laptop. In an ideal world, we would host the CLI within our Domo environment, where we’re able to execute it from a small container or VM, allowing us to run it in a scheduled manner without having to have a local machine running 24/7.

Of course, we can spin up a small VM on a public cloud provider to do this, but it seems like a unnecessarily convoluted way to access and run the CLI ‘from anywhere’.

So, in step Domo’s Jupyter Workspaces integration (disclaimer, this is a premium platform feature, reach out to your CSM if you’d like to trial the feature, if it’s not already enabled.) With Domo Jupyter Workspaces integration, as well as allowing you to create interactive notebooks for your analysis and data science needs it also provides a command line and hosted file system to store files, which we can leverage to store the CLI and then execute as and when we need remotely.

I would love to see a point in time where Domo allows you to run a small container, or terminal within the platform, something similar to GCP’s Cloud Shell for this very purpose, but until then, this ability to execute the CLI from a Jupyter Workspace is a great alternative, by copying the commands below you can have it running within 30 seconds (yes I timed it).

The How

So you have a couple of options here, you can either execute some commands in series within the terminal, or, upload a script that will execute the required commands for you, both options are below…

Some context here; the CLI requires the installation of a JDK to run, so the script downloads this, unpacks it and then sets a ‘PATH’ variable, there’s nothing complicated going on here and if you’re an avid user of the CLI it’s likely you’ve done most of this before, this is just packaging it up in a to a repeatable script.

So, to get this going, (assuming you have created a Jupyter Workspace already within Domo, if not check out the docs here to get started with the feature).

  • Open a new terminal within your Jupyter Workspace.
  • In the terminal, run the below command to download the script:
    wget https://gist.githubusercontent.com/jamtm/6a4cc625eb99fe9fc6324747ee688278/raw/a48d509b45cceba6ba262cc10737d031594b5f64/install_CLI.sh
  • To make the file executable, run:
    chmod +x install_CLI.sh
  • Finally, to execute the script run:
    ./install_CLI.sh
    And you’re finished, you can now run the CLI within Domo using:
    java -jar domoUtil.jar

If you’d prefer you can also run each of the below lines one by one within the terminal to achieve the same result, this is probably quicker, although if you need to do this repeatedly, the script may make more sense.

1
2
3
4
5
wget https://app.domo.com/labs/java-sdk/latest/domoUtil.jar
wget https://download.oracle.com/java/19/latest/jdk-19_linux-x64_bin.tar.gz
tar zxvf jdk-19_linux-x64_bin.tar.gz
export PATH=jdk-19.0.2/bin:$PATH
rm jdk-19_linux-x64_bin.tar.gz

And finally, a .gif of the above process in action, around 30 seconds from start to finish…