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.
1. Write a program
Section titled “1. Write a program”Create a file called hello.dvl:
Ask "What is your name?" as user namePrint user_nameAsk declares an input parameter. Print outputs a value.
2. Run it
Section titled “2. Run it”devlish --run hello.dvl --input '{"user_name": "World"}'Output: World
3. Add logic
Section titled “3. Add logic”Ask "Customer tier?" as customer tierAsk "Deal size?" as deal size
discount_rate equals 0.05If customer_tier is "enterprise" discount_rate equals 0.15
discount equals deal_size times discount_ratePrint discountdevlish --run pricing.dvl --input '{"customer_tier": "enterprise", "deal_size": 500000}'# 750004. Validate syntax
Section titled “4. Validate syntax”devlish validate pricing.dvlReturns exit 0 if the file is valid, or diagnostic errors with line numbers.
5. Compile to bytecode
Section titled “5. Compile to bytecode”devlish compile pricing.dvl --output pricing.dvlc.jsondevlish disassemble pricing.dvlc.jsondevlish --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.
6. Structured output
Section titled “6. Structured output”Replace Print with Respond with to return JSON instead of text:
Ask "Customer tier?" as customer tierAsk "Deal size?" as deal size
discount_rate equals 0.05If customer_tier is "enterprise" discount_rate equals 0.15
discount equals deal_size times discount_rateRespond with record with discount as amount and customer_tier as tierdevlish --run pricing.dvl --input '{"customer_tier": "enterprise", "deal_size": 500000}'# {"amount":75000,"tier":"enterprise"}Application modes
Section titled “Application modes”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.
CLI commands
Section titled “CLI commands”| 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 |
What’s next
Section titled “What’s next”- Your First Tool - make this program callable by an LLM
- Language Reference - full syntax guide