CragCLI: Command Line Calculator

with AI and dimensional analysis

the boring bits:

Arithmetic

  • +add,-subtract, *multiply, /divide
  • () parentheses (bidmas precedence)
  • -ve numbers
  • % modulo operator

Just type crag in your console: exit to quit.

...starts in 1 second [note 1]

the cool stuff:

LLM

Grab AI info directly into your calculations.

  • get text ... ?<query>

  • get amount ... ?^<query in units>

Use amounts in calculations, store them in memory.

...most popular LLM platforms

Get Started

CragCLI is Open Source Software written in Raku, provided under Artistic License 2.0.


*PROVIDED "AS IS" WITHOUT WARRANTY OR LIABILITY*

*NOT INTENDED FOR USE IN MISSION CRITICAL APPLICATIONS*


Step 1

Install the Raku compiler:

Then:

See https://raku.org/install for other platforms and package managers

Step 2

Install and run App::Crag:


Get Help


Notes

  1. Starts in approx. 1sec (as measured on an M1 MacBook, takes longer on first run).

  2. For LLM::DWIM features, you will need e.g. a free of charge ChatGPT key and go export OPENAI_API_KEY=mykeygoeshere.

  3. Currency exchange rates are provided as at the installation date, reinstall crag (zef install App::Crag --/test --force-install) to refresh them.

  4. crag is a full Raku repl - so you can write subroutines, loops, conditionals, comparisons and so on (see https://docs.raku.org)

  5. If your calculations outgrow the crag app, you can use the underlying crag modules in Raku code.

some stories:

Artemis Launch Phase

  • Liftoff acceleration over one and a half gravity

  • Immense thrust lifting thousands of tons skyward

  • Rapid climb to orbital velocity in a few minutes

...using mass, force, speed, acceleration

Formula1 - Kinematics

A kinematic perspective.

  • You start already insanely fast (~260 km/h)

  • Still gain ~70 km/h in just ~5 seconds

  • Acceleration is “only” ~0.37g — because at those speeds, aerodynamic drag is brutal

  • Distance sanity check is ±30% - real-world is non-linear

...using distance, time and speed