Skip to content

Quick Start

This tutorial introduces the basic Devlish workflow: write a small text file, supply its inputs, and run it from a terminal. You will then add a calculation and return a structured result that another program could use.

Start after completing Installation. No model account or MCP client is needed for these examples. Ask names an input; the commands below provide that input with --input. Print displays a value, while Respond with returns a result to the caller.

Create a file called hello.dvl:

Ask "What is your name?" as user name
Print user_name

Ask declares an input parameter. Print outputs a value.

Terminal window
devlish --run hello.dvl --input '{"user_name": "World"}'

Output: World

Ask "Customer tier?" as customer tier
Ask "Deal size?" as deal size
discount_rate equals 0.05
If customer_tier is "enterprise"
discount_rate equals 0.15
discount equals deal_size times discount_rate
Print discount
Terminal window
devlish --run pricing.dvl --input '{"customer_tier": "enterprise", "deal_size": 500000}'
# 75000
Terminal window
devlish validate pricing.dvl

Returns exit 0 if the file is valid, or diagnostic errors with line numbers.

Terminal window
devlish compile pricing.dvl --output pricing.dvlc.json
devlish disassemble pricing.dvlc.json
devlish --run pricing.dvlc.json --input '{"customer_tier": "enterprise", "deal_size": 500000}'

Bytecode is the portable format. It runs natively (CLI), in browsers (WASM), or via MCP.

Replace Print with Respond with to return JSON instead of text:

Ask "Customer tier?" as customer tier
Ask "Deal size?" as deal size
discount_rate equals 0.05
If customer_tier is "enterprise"
discount_rate equals 0.15
discount equals deal_size times discount_rate
Respond with record with discount as amount and customer_tier as tier
Terminal window
devlish --run pricing.dvl --input '{"customer_tier": "enterprise", "deal_size": 500000}'
# {"amount":75000,"tier":"enterprise"}

Run devlish for the interactive model prompt, devlish --run workflow.dvl (or -r) for file execution, and devlish --server (or -s) for the foreground HTTP service at 127.0.0.1:7420. File mode compiles source in memory; a separate compile step is optional.

The prompt uses your configured provider and model. Project overrides live in .devlish/agent.dvl and .devlish/policy.dvl. See local tools and policy for authorization defaults and tool execution.

Command Description
devlish run <file> Run a .dvl source or .dvlc.json bytecode
devlish compile <file> Compile to bytecode
devlish validate <file> Check syntax
devlish lint <file> Style and correctness suggestions
devlish disassemble <file> Show bytecode instructions
devlish new <name> Scaffold a new project
devlish mcp Start the MCP server
devlish package Build a distributable artifact