CLI Getting Started

Get up and running with the Scriptling command-line interface.

Installation

Homebrew (macOS & Linux)

brew install paularlott/tap/scriptling

The SQLite, SQL, Valkey and BadgerDB database plugins are compiled in.

Prefer a leaner binary? scriptling-slim is the same CLI without them (mutually exclusive with scriptling); the drivers can still be loaded at runtime from their own formula:

brew install paularlott/tap/scriptling-slim
brew install paularlott/tap/scriptling-plugins
export SCRIPTLING_PLUGIN_DIR="$(brew --prefix)/opt/scriptling-plugins/libexec/plugins"

Release zips carry the binary named plainly scriptling whether default or slim.

See Plugins for how plugins load and the database reference for the APIs.

GitHub Releases

Download pre-built binaries from GitHub Releases:

  • Linux (AMD64, ARM64)
  • macOS (AMD64, ARM64)
  • Windows (AMD64, ARM64)

Build from Source

git clone https://github.com/paularlott/scriptling.git
cd scriptling

# Build CLI for current platform
make build

# Run scripts
./bin/scriptling script.py

Your First Script

Create a file called hello.py:

name = "World"
print(f"Hello, {name}!")

# Use standard libraries
import json
import math

data = json.dumps({"numbers": [1, 2, 3]})
print(data)
print(f"sqrt(16) = {math.sqrt(16)}")

Run it:

scriptling hello.py

Interactive Mode

Launch the REPL to experiment:

scriptling --interactive

Pipe a Script

echo 'print("Hello")' | scriptling

HTTP Server

Server modes evaluate a startup script before accepting requests. Create setup.py for any one-time initialization:

print("Server initialized")

Then run Scriptling as an HTTP server:

scriptling --server :8000 setup.py

MCP Server

The same startup script can initialize a Model Context Protocol server; tools are loaded from the directory passed to --mcp-tools:

scriptling --server :8000 --mcp-tools ./tools setup.py

Next Steps