Skip to content
This repository has been archived by the owner on Oct 24, 2021. It is now read-only.
/ cljog Public archive

cljog - Jogger for Automation Scripting and CLI Tools

License

Notifications You must be signed in to change notification settings

axrs/cljog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cljog

(= "Clojure Command Jogger" cljog)

Making Clojure automation scripts and CLI tools run... or at least Jog.

AXRS

   ____ _        _  ___   ____ 
  / ___| |      | |/ _ \ / ___|
 | |   | |   _  | | | | | |  _ 
 | |___| |__| |_| | |_| | |_| |
  \____|_____\___/ \___/ \____|
                                   

Developers tend to automate all the things. From cloud infrastructure setup (Terraform) and browser control (Selenium); to the day to day tasks of performing updates, and performing system backups. It helps us to:

  • focus of other activities
  • reduce human error and risk
  • share efficiencies
  • become DRY

Why?

I've always wanted to move away from Bash for automation into something that:

  • is standalone
  • allows specifying dependencies and required versions
  • has an existing and established library of code available
  • easy to write, run, extend, and share
  • is performant
  • interpreted (no compilation necessary)
  • can be considered cross-platform
  • supports simple sub-command discovery and invocation (similar to git)
  • easy to setup

Python, Node.js, and Java are all languages that can be used for automation, if you can use the standard libraries. Anything more complex requires additional steps to install dependencies and maintain. Inspired Alan Franzoni and his article Standalone, single-file, editable Python scripts WITH DEPENDENCIES, I decided to create cljog for writing Clojure (with some inspiration from Eric Normand Boilerplate for running Clojure as a shebang script Gist) as a Bash replacement.

Similar Projects

Installation

  1. Download cljog. wget https://raw.githubusercontent.com/axrs/cljog/0.2.0/cljog
  2. Make executable. chmod +x cljog
  3. Move to a bin directory. mv cljog /usr/bin/

Usage

  1. Install cljog into a bin directory and make it executable
  2. Create a script with the cljog interpreter shebang. #!/usr/bin/env cljog
  3. Make the script executable and invoke it; or run it directly through cljog
./script.clj 
# or
cljog script.clj

Example Scripts

asciicast