Installation
Prerequisites
- VSCode 1.75.0 or later
- Node.js 16+ (optional, for diagram server)
Install VSCode Extension
Option 1: VSCode Marketplace
- Open VSCode
- Press
Ctrl+Shift+X(orCmd+Shift+Xon Mac) to open Extensions - Search for "Craft" or visit the marketplace page
- Click Install
Option 2: Command Line
bash
code --install-extension craftOption 3: Manual Installation
- Download the
.vsixfile from GitHub Releases - Open VSCode
- Go to Extensions (
Ctrl+Shift+X) - Click the
...menu → "Install from VSIX..." - Select the downloaded file
Verify Installation
- Create a new file:
test.craft - Type:craft
use_case "Test" { when user does something } - You should see syntax highlighting
Install Diagram Server (Optional)
To generate diagrams, you need to run the Craft diagram server.
TIP
If you just want to write Craft code with syntax highlighting, you can skip this step.
Using Docker (Recommended)
Run the latest Craft server directly from Docker Hub — no build needed:
bash
docker run --rm -p 8080:8080 tiagocarcao/craft:latestThe server will start on http://localhost:8080.
From Source
bash
# Clone the repository
git clone https://github.com/tcarcao/craft.git
cd craft
# Generate ANTLR parser (pulls tiagocarcao/antlr4-craft:4.13.2 from Docker Hub automatically)
make generate-grammar
# Build and run the server container
make docker-build && make docker-runThe server will start on http://localhost:8080.
Configure Extension
Open VSCode settings (Ctrl+,) and search for "craft":
json
{
"craft.server.url": "http://localhost:8080",
"craft.server.timeout": 30000,
"craft.logging.level": "warn"
}Test Diagram Generation
- Create a file
example.craft - Add some content:craft
services { UserService { contexts: Authentication } } - Press
Ctrl+Shift+Cto preview C4 diagram - If configured correctly, you'll see the generated diagram
WARNING
Make sure the diagram server is running before trying to preview diagrams.
Next Steps
- Quick Start Tutorial to write your first use case
- Extension Features to learn all the capabilities
- Examples to see complete applications