RAS Playground 日本語 GitHub

VS Code and the CLI

Commands

ras <command> --help shows the options of each. From outside the project folder, specify it with ras --project <folder> <command>.

Project

Command Description
ras init [<folder>] [--workbook Book.xlsm] Creates ras.toml, src/main.ras, AGENTS.md and an empty macro-enabled workbook
ras check [--fix] Type check and lint. --fix writes mechanically fixable warnings (such as names spelled the VBA way) back to the source. --target stand-in also warns about APIs that cannot be used in runs without Excel
ras fmt Formats the code
ras build [--release] Writes .bas / .cls / .rasmap files to build/. With --target js, writes JavaScript for debug runs to build/debug/
ras watch Watches for changes and rebuilds (also packs if the workbook is closed)

Writing to the workbook (Syncing with and importing from Excel)

Command Description
ras pack [<workbook>] [--overwrite] Writes directly into the workbook's VBA project without starting Excel
ras unpack [<workbook>] Extracts the handwritten VBA in the workbook into vba/
ras sync Applies to the workbook open in Excel (Windows only)
ras form new <name> / ras form pull / ras form check Create a user form skeleton, extract forms from the workbook, and check them (User forms)
ras sheet list / add / copy / rename / remove List, add, copy, rename and delete sheets, in the workbook and the objects/ files together (Sheets and workbook code)

Running and verifying without Excel

Command Description
ras run [<Module.func>] Runs a function without Excel and shows the output, errors and changed cells (Running without Excel)
ras test [<file>...] Runs the tests in test/**/*.test.ras without Excel (Testing)
ras book dump / diff / view / edit Print the contents of a workbook as text, compare two workbooks, show it as a grid, and edit cells (Viewing, comparing and editing workbooks)

Looking things up

Command Description
ras explain <code> Explanation, typical causes and fixes for an error or warning code (such as E0301)
ras doc <name> Signature, description, VBA name and stand-in support of an API of Excel, VBA or a library (--list lists the members, --stand-in the stand-in support)
ras cheatsheet Cheat sheet of syntax and Excel operations (Cheat sheet)
ras lsp --stdio Starts as a language server (used by the VS Code extension)

check, build, pack, run and test print diagnostics as JSON, one per line, with --message-format json.

ras check --message-format json
ras explain E0320
ras doc Range.find
ras doc --list Excel.Worksheet

ras setup, ras typegen, ras pack --via-excel and ras sync --pull are not implemented (running them prints a message saying so and exits). The implementation status of each command is in Status and verification.