CLI Tools

ToolPurpose
rill-execExecute a rill script file with positional arguments
rill-evalEvaluate a single rill expression (no file context)
rill-checkStatic analysis and lint validation
rill-runConfig-driven execution with extensions and modules

rill-exec

Execute a rill script file with arguments.

rill-exec <script.rill> [args...]
rill-exec -                         # Read from stdin
rill-exec --help
rill-exec --version

Arguments

Positional arguments pass to the script as a string list in $ (pipe value).

rill-exec greet.rill alice bob
# Inside script: $ == ["alice", "bob"]

Stdin

Use - to read a script from standard input:

echo 'log("hello")' | rill-exec -

Module Loading

rill-exec does not support the module scheme. Scripts that use use<module:name> require rill-run with a rill-config.json that declares module paths.

See rill-run for config-driven execution and Modules for the module system.

Exit Codes

Return ValueExit Code
true or non-empty string0
false or empty string1
[0, "message"]0 (prints message)
[1, "message"]1 (prints message)

rill-eval

Evaluate a single rill expression. No file context or module loading.

rill-eval <expression>
rill-eval --help
rill-eval --version

Examples

rill-eval '"hello".len'
# 5

rill-eval '5 + 3'
# 8

rill-eval '[1, 2, 3] -> fan(fn(x) { $x * 2 })'
# [2, 4, 6]

rill-check

Static analysis tool that validates rill scripts against lint rules.

rill-check [options] <file>

Options

FlagDescription
--fixApply automatic fixes to the source file
--format textHuman-readable output (default)
--format jsonMachine-readable JSON output
--verboseInclude rule category in JSON output
-h, --helpShow help
-v, --versionShow version

Exit Codes

CodeMeaning
0No issues found
1Diagnostics reported (or argument error)
2File not found or unreadable
3Parse error in source file

Output Formats

Text (default): one line per diagnostic.

script.rill:5:3: warning: message (RULE_CODE)

JSON: structured output with summary.

{
  "file": "script.rill",
  "errors": [
    {
      "location": { "line": 5, "column": 3, "offset": 42 },
      "severity": "warning",
      "code": "RULE_CODE",
      "message": "description"
    }
  ],
  "summary": { "total": 1, "errors": 0, "warnings": 1, "info": 0 }
}

Configuration

Place a .rill-check.json file in the project root to configure rules:

{
  "rules": {
    "NAMING_SNAKE_CASE": "on",
    "SPACING_OPERATOR": "off",
    "COMPLEX_CONDITION": "warn"
  },
  "severity": {
    "AVOID_REASSIGNMENT": "error"
  }
}

Rule states: "on" (enabled), "off" (disabled), "warn" (downgrade to warning).

Lint Rules

CodeCategoryDefaultDescription
NAMING_SNAKE_CASEnamingerrorVariable names must use snake_case
AVOID_REASSIGNMENTanti-patternswarningAvoid reassigning captured variables
COMPLEX_CONDITIONanti-patternsinfoCondition expression is complex
LOOP_OUTER_CAPTUREanti-patternswarningLoop body captures to outer variable
STREAM_PRE_ITERATIONanti-patternswarningStream method called before iteration starts
USE_DYNAMIC_IDENTIFIERanti-patternswarningDynamic identifier in use expression
USE_EMPTY_METHODstringswarningUse .empty instead of .len == 0
UNNECESSARY_ASSERTIONtypesinfoType assertion on a string, number, bool, list, tuple, or dict literal that already has the asserted type
USE_UNTYPED_HOST_REFtypeswarningUntyped host reference in use expression
VALIDATE_EXTERNALtypesinfoExternal data lacks type validation
TUPLE_ONE_POSITIONtypesinfotuple(T) names exactly one position
TEMPORAL_LITERALtypeswarningduration("...") or datetime("...") with a string literal that cannot parse, so the call halts #INVALID_INPUT
EQUALITY_NO_OVERLAPtypeswarning==, !=, .eq, or .ne (operator or pipe form), or .has, .has_any, or .has_all on a list literal of scalar literals, between operands whose types never overlap, so the comparison halts #TYPE_MISMATCH
PIPE_CONVERTS_INNERtypesinfoPipe into list(T), dict(...), or tuple(...) of a statically known source with elements of another scalar kind, so -> converts them; write -> :T to check without converting
PIPE_ZERO_PARAM_TARGETclosureswarningPipe target function with no parameters, so the call halts RILL-R045
BLOCK_CAPTUREclosureswarningBare block captured into a variable, { ... } => $x, or a call on that variable when the block provably yields no function; write fn { ... } to store a function, or drop the braces to bind the result
MIXED_ELEMENT_TYPE_READtypesinfo.^type or .^effective read from a list literal of distinct compound shapes, or from the result of iterating a dict literal of distinct value shapes, where the read reports a union element type
DECLARED_TYPE_PROBEtypesinfo.^type read from a value declared with a union, where the read reports the declared type; .^effective reports the value’s own type
ANY_CAPTURE_LOCKtypeserrorSecond capture of a different type into a variable first captured with :any, so the re-capture halts RILL-R001
MAP_MISSING_KEYtypesinfoMap literal checked against a closed key union (map(union(#a, #b), V)) with no entry for a member, so reading that key halts RILL-R009
MAP_NEGATIVE_INDEXtypesinfoNegative number literal index on a variable captured once from a map literal ($m[-1]); it selects the key -1 and does not count from the end. Silent when the literal has that key
TYPE_EXTRA_KEYtypeswarningTyped check, capture, or parameter on a statically known dict or ordered literal with a key the type does not name, so it halts #TYPE_MISMATCH or RILL-R001
SIGNATURE_BARE_KEYtypeswarning.signature compared with a string literal that spells a non-identifier key bare, so the comparison is always false (true for !=)
ENTRIES_PAIR_AS_LISTtypeswarningAn .entries pair checked against list(list) or used with a list-only method, field read, or -> dict, so it halts #TYPE_MISMATCH, RILL-R003, or RILL-R036
DISPATCH_SELECTOR_NOT_STRINGtypeswarningDispatch table piped a number, bool, or atom selector, so it halts #TYPE_MISMATCH before any lookup
DICT_KEY_SPELLINGtypesinfoNumber or bool key in a dict, ordered, or dispatch literal, stored as the string of its spelling
ATOM_CASE_MISMATCHerrorswarningAtom differs from a builtin only by case
ATOM_NOT_ERROR_CODEerrorswarning.!code compared with ==, !=, .eq, or .ne (operator, method, or pipe form) to an atom that is not #ok or a core error code, so the comparison halts #TYPE_MISMATCH
ATOM_DISCARDEDanti-patternswarningBare atom as a discarded statement; a comment needs a space after #
ON_LIST_SINGLEerrorsinfoon: list[#X] or on: [#X] holds one code; write on: #X
GUARD_BAREerrorsinfoBare guard catches every error; a guard with spread options is not bare
GUARD_OVER_TRY_CATCHerrorsinfoBranching on .! is manual try/catch
PRESENCE_OVER_NULL_GUARDerrorsinfoNil-checking conditional instead of ??
RETRY_TRIVIALerrorswarningretry(attempts: N) with N <= 1 has no effect
TIMEOUT_TRIVIALerrorswarningtimeout() with no total: or idle: limit has no effect
STATUS_PROBE_NO_FIELDerrorsinfoBare .! only yields a boolean invalid-test, not the status record
CAPTURE_INLINE_CHAINflowinfoCapture breaks a pipe chain
CAPTURE_BEFORE_BRANCHflowinfoCapture value before branching
LOOP_ACCUMULATORloopsinfoUse accumulator $@ pattern
PREFER_DO_WHILEloopsinfoConsider do-while for init-then-loop
USE_EACHloopsinfoUse each instead of while loop
BREAK_IN_PARALLELcollectionserrorbreak inside map or filter
COLLECTION_ARITYcollectionserrorseq, fan, filter, sort, start_when, stop_when, iterate, or chain function that does not take exactly one argument, or fold or acc function that does not take exactly two, so the call halts RILL-R045 (too few) or RILL-R044 (too many required)
BARE_CALLABLE_BODYcollectionswarningBare builtin or host name as a collection-op body is a zero-arg call, not a callable
PREFER_MAPcollectionsinfoUse map when body has no side effects
FOLD_INTERMEDIATEScollectionsinfoacc used only for its final value
FILTER_NEGATIONcollectionswarningNegated filter condition
METHOD_SHORTHANDcollectionsinfoUse method reference shorthand
USE_DEFAULT_OPERATORconditionalsinfoUse ?? instead of conditional
CONDITION_TYPEconditionalswarningCondition is a non-boolean literal
DISPATCH_MISSING_MEMBERconditionalswarningDispatch table with no default piped a union of string literals, where a member has no key, so that member halts RILL-R009
DISPATCH_FN_ENTRYconditionalswarningDispatch selects an fn literal entry by string, which dispatch returns uncalled; write a bare block to run it, or call the result
CLOSURE_LATE_BINDINGclosureswarningFunction captures late-bound variable
SPACING_OPERATORformattinginfoOperators need surrounding spaces
SPACING_BRACESformattinginfoBraces need inner spacing
SPACING_BRACKETSformattinginfoBrackets need consistent spacing
SPACING_CLOSUREformattinginfoSpace between an opening bracket and an fn literal
SPACING_DECLARATIONformattinginfoNo space before [ after a type or collection keyword (list, dict, tuple, ordered, map); one space before a scalar or atom value
SPACING_OPTIONSformattinginfoNo space between a control keyword (guard, retry, timeout, pass, do) and its ( option list
SPACING_MEMBERformattinginfoMember access dot must touch the field name
INDENT_CONTINUATIONformattinginfoContinuation line indentation
IMPLICIT_DOLLAR_METHODformattinginfoPrefer implicit $ for methods
IMPLICIT_DOLLAR_FUNCTIONformattinginfoPrefer implicit $ for functions
IMPLICIT_DOLLAR_CLOSUREformattinginfoPrefer implicit $ for function calls
THROWAWAY_CAPTUREformattinginfoCapture unused or used once, far away

rill-run

Config-driven execution. Loads extensions and settings from rill-config.json, then runs a script or named handler.

rill-run [--config <path>] [args...]
rill-run --help
rill-run --version

Config Discovery

rill-run locates config automatically or via an explicit flag:

MethodBehavior
No --config flagWalks upward from the current directory looking for rill-config.json
--config <path>Uses the specified file; stops directory walk

See Config Reference for the full rill-config.json format.

Options

FlagDescription
--config <path>Explicit path to rill-config.json
--helpShow help or, when main is a handler, print parameter list with types and descriptions
--versionShow version

Module Mode

When the main field of rill-config.json points to a script file (e.g., "main": "script.rill"), rill-run executes that script. Positional arguments forward to the script as the pipe value $.

rill-run alice bob
# Inside script: $ == ["alice", "bob"]

Handler Mode

When main names a specific handler (e.g., "main": "script.rill:processOrder"), rill-run switches to handler mode. Handler parameters come from --param_name value flags, not positional args.

rill-run --order_id "ORD-42" --region "us-east"

The handler must be annotated with parameter metadata for rill-run to match flags to arguments. Run rill-run --help to print the parameter list:

Handler: processOrder (script.rill)

Parameters:
  --order_id  string   Order identifier (required)
  --region    string   Deployment region (required)

See Closure Annotations for how to annotate handler parameters.

Exit Codes

CodeMeaning
0Script or handler completed successfully
1Script error or config error

See Also

DocumentDescription
Config Referencerill-config.json format and extension mounts
Host IntegrationEmbedding API
ModulesModule convention
ConventionsCoding style and best practices