Skip to content

Configuration

Kyushu works out of the box. Each command uses defaults but supports its own optional config file to override them.

The build config typically lives on your local machine and in CI, while the run config lives where you serve your worker.

Controls how kyu build bundles and pre-initializes your worker.

FieldTypeDefaultDescription
input.srcstringsrc/index.tsPath to your TypeScript or JavaScript entry point
output.dirstringworkerOutput directory for the built worker
output.filestring__kyushu_worker.wasmOutput filename for the built worker
[input]
src = "src/server.ts"
[output]
dir = "dist"

Run shell commands before or after kyu build. Useful for example when using static assets, to build your frontend app or website beforehand.

[scripts]
prebuild = ["pnpm build"]
postbuild = ["echo done"]
FieldTypeDefaultDescription
scripts.prebuildarrayCommands to run before kyu build
scripts.postbuildarrayCommands to run after kyu build

Controls static asset bundling during kyu build. See the Static Assets guide for setup instructions.

FieldTypeDefaultDescription
assets.dirstringDirectory of static assets to bundle into the worker
assets.precompressarrayCompression formats to pre-generate: "brotli", "gzip"
[assets]
dir = "dist"
precompress = ["brotli", "gzip"]

Controls how kyu run loads and serves your worker.

FieldTypeDefaultDescription
run.wasmstringworker/__kyushu_worker.wasmPath to the built worker .wasm file
run.portnumber5987Port to listen on
worker.mountsarrayFilesystem mounts to expose to the worker
worker.mounts[].hoststringPath on the host filesystem
worker.mounts[].gueststringPath inside the worker sandbox
worker.mounts[].writableboolfalseWhether the mount is writable
worker.envarrayEnvironment variables to expose to the worker
worker.env[].keystringEnvironment variable name
worker.env[].valuestringEnvironment variable value
worker.network.ip_name_lookupboolfalseAllow IP name lookup (resolving hostnames to IP addresses, e.g. DNS)
worker.network.tcpboolfalseAllow outbound TCP connections
worker.network.udpboolfalseAllow outbound UDP connections
[run]
wasm = "build/__custom_kyushu_worker.wasm"
port = 8080
[[worker.mounts]]
host = "./public"
guest = "/public"
[[worker.mounts]]
host = "./data"
guest = "/data"
writable = true
[[worker.env]]
key = "API_KEY"
value = "secret"
[worker.network]
ip_name_lookup = true
tcp = true

Controls how kyu dev serves your worker during development with live-reload.

[dev]
port = 5987 # default
FieldTypeDefaultDescription
dev.portnumber5987Port to listen on
dev.watchbooltrueWatch for file changes and reload automatically

A custom [input] or [worker] configuration can also be applied; the details are omitted for brevity but follow the same options documented above.