Mudis CLI

CLI utilities for Mudis development and runtime debugging. The CLI loads your application environment, attaches to the Mudis entry point, and provides a small set of commands for inspection and mutation.

Install

bundle add mudis-cli

Usage

Load a Rails app and list keys:

mudis -r ./config/environment.rb keys

Read a key:

mudis -r ./config/environment.rb get user:42

Write a key with TTL:

mudis -r ./config/environment.rb set --ttl 60 user:42 '{"name":"Ada"}' --json

Run a Mudis-QL expression:

mudis -r ./config/environment.rb ql "from('users').where(id: 42).first"

Start a REPL with helpers:

mudis -r ./config/environment.rb repl

Commands

  • keys [--namespace NS]
  • get [--namespace NS] [--raw] KEY
  • set [--namespace NS] [--ttl SECONDS] [--json] KEY VALUE
  • del [--namespace NS] KEY
  • clear-namespace NAMESPACE
  • metrics
  • reset
  • reset-metrics
  • least-touched
  • ql 'EXPR'
  • repl

Global Options

  • -r, --require PATH Require a file before running (repeatable).
  • -e, --env NAME Set RACK_ENV / RAILS_ENV before requiring files.
  • --const NAME Constant name for Mudis entry point (default: Mudis).
  • --format FORMAT Output format: text or json.
  • --[no-]color Enable/disable colored output (default: auto). Respects NO_COLOR.
  • --verbose Show stacktraces on errors.

Notes

  • The CLI defaults to the Mudis constant. Use --const if your app exposes a different entry point.
  • ql and repl depend on mudis-ql and will fail if it is not installed.
  • ql evaluates the expression with mudis and ql variables in scope (ql points to MudisQL).

Development

bundle exec ruby -I lib bin/mudis --help