Configuration
The virke.toml file configures a Virke project. It lives in the root of your project directory and is created by virke init.
Full Example
[project]
name = "my-app"
type = "fullstack"
[build]
command = "bun run build"
output = "dist"
[compute]
entry = "src/worker.ts"
language = "javascript"
[database]
name = "my-app-db"
async_writes = false
cache_ttl = 60
[kv]
namespace = "my-app-kv"
[storage]
bucket = "my-app-assets"
[domains]
production = "myapp.com"
Sections
[project]
Required. Identifies the project.
| Key | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Project name. Used as the slug for <name>.virke.dev. Lowercase letters, numbers, and hyphens only. |
type |
"static" | "compute" | "component" |
No | Project type. Default: "static" |
[build]
Optional. Configures the build step before deployment.
| Key | Type | Required | Description |
|---|---|---|---|
command |
string | No | Shell command to run before deploying (e.g. bun run build) |
output |
string | No | Directory containing build output. Default: dist |
[compute]
Optional. Configures an edge compute project (Virke Run).
| Key | Type | Required | Description |
|---|---|---|---|
entry |
string | No | Entry point file. Default: src/worker.ts |
language |
"javascript" | "rust" |
No | Programming language. Default: "javascript" |
[database]
Optional. Attaches a Virke DB database.
| Key | Type | Required | Description |
|---|---|---|---|
name |
string | No | Database name. Default: <project>-db |
async_writes |
boolean | No | Enable async write-back. Default: false |
cache_ttl |
number | No | Edge cache TTL in seconds. Default: 60. Set to 0 to disable. |
[kv]
Optional. Attaches a Virke KV namespace.
| Key | Type | Required | Description |
|---|---|---|---|
namespace |
string | No | KV namespace name |
[storage]
Optional. Attaches a Virke OS3 bucket.
| Key | Type | Required | Description |
|---|---|---|---|
bucket |
string | No | Object Storage bucket name |
[github]
Optional. Configures GitHub integration for auto-deploy.
| Key | Type | Required | Description |
|---|---|---|---|
repo |
string | No | GitHub repository (owner/repo) |
branch |
string | No | Branch to auto-deploy. Default: main |
preview |
boolean | No | Enable preview deploys per PR. Default: true |
[[cron]]
Optional. Defines cron jobs (can have multiple). Requires a compute project.
| Key | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Job name |
schedule |
string | Yes | Cron expression (5-field) |
handler |
string | Yes | HTTP endpoint path in your compute service |
[domains]
Optional. Configures custom domains.
| Key | Type | Required | Description |
|---|---|---|---|
production |
string | No | Custom domain with auto SSL |
Project Type Templates
Static site
[project]
name = "my-site"
[build]
command = "bun run build"
output = "dist"
Compute (edge function)
[project]
name = "my-api"
[compute]
entry = "src/worker.ts"
language = "javascript"
Fullstack
[project]
name = "my-app"
[build]
command = "bun run build"
output = "dist"
[compute]
entry = "src/worker.ts"
language = "javascript"
[database]
name = "my-app-db"
[kv]
namespace = "my-app-kv"
[storage]
bucket = "my-app-assets"
Rust compute
[project]
name = "my-api"
[compute]
entry = "src/main.rs"
language = "rust"
Virke Components
[project]
name = "my-component"
type = "component"
[compute]
entry = "src/handler.ts"
Compute with cron jobs
[project]
name = "my-api"
[compute]
entry = "src/worker.ts"
language = "javascript"
[[cron]]
name = "cleanup"
schedule = "*/5 * * * *"
handler = "/cron/cleanup"
[[cron]]
name = "daily-report"
schedule = "0 9 * * 1-5"
handler = "/cron/report"
GitHub auto-deploy
[project]
name = "my-app"
[build]
command = "bun run build"
output = "dist"
[github]
repo = "myorg/my-app"
branch = "main"
preview = true
Environment Variables
These override virke.toml settings and stored auth:
| Variable | Description |
|---|---|
VIRKE_API_KEY |
API key for authentication (overrides stored key) |
VIRKE_API_URL |
API base URL (default: https://api.virke.dev) |
TypeScript Definition
interface VirkeConfig {
project: {
name: string;
type?: "static" | "compute" | "component";
};
build?: {
command?: string;
output?: string;
};
compute?: {
entry?: string;
language?: "javascript" | "rust";
};
database?: {
name?: string;
async_writes?: boolean;
cache_ttl?: number;
};
kv?: {
namespace?: string;
};
storage?: {
bucket?: string;
};
github?: {
repo?: string;
branch?: string;
preview?: boolean;
};
cron?: Array<{
name: string;
schedule: string;
handler: string;
}>;
domains?: {
production?: string;
};
}