Configuration¶
Settings read by the backend, the dashboard and the CLI.
The backend and dashboard settings only matter when you run your own instance, for example while contributing to kikx. The hosted dashboard needs none of them. See Run kikx locally.
Backend¶
kikx-backend options:
Flag |
Environment variable |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
integer |
|
Port to listen on |
|
|
host or IP address |
|
Address to bind |
|
|
comma-separated list of origins |
empty |
Browser origins allowed by CORS. Empty allows any loopback origin. See HTTP API |
|
— |
— |
— |
Print help |
kikx-backend has no --version option.
--allow-origin accepts a comma-separated list and can be repeated. Each origin is trimmed; empty entries are dropped.
On start the backend prints:
kikx-backend listening on http://127.0.0.1:4000
Precedence¶
Highest first:
Command-line flag.
Environment variable set in the process environment.
Environment variable from a
.envfile.Built-in default.
The .env file is loaded with dotenvy from the working directory, or from the nearest parent directory that has one. It never overrides a variable already set in the environment. A line that dotenvy cannot parse, for example an unquoted value containing a space, stops loading at that line without an error; that line and every line after it are ignored.
backend/.env.example:
KIKX_PORT=4000
KIKX_BIND=127.0.0.1
KIKX_ALLOWED_ORIGINS=
A list with spaces must be quoted:
KIKX_ALLOWED_ORIGINS="https://a.example.com, https://b.example.com"
Startup errors¶
Exit status 1, message on stderr:
Condition |
Message |
|---|---|
Origin is not a valid header value |
|
Address cannot be bound |
|
An invalid flag value exits with status 2.
Dashboard¶
Variable |
Required |
Description |
|---|---|---|
|
yes |
Base URL of the backend, without |
Read by Next.js from web/.env.local or the environment. When unset, every API call fails with code not_configured and the message NEXT_PUBLIC_KIKX_API_URL is not set — point it at your kikx backend (see web/.env.example).
web/.env.example:
NEXT_PUBLIC_KIKX_API_URL=http://localhost:4000
CLI¶
The CLI reads no environment variables. It reads kikx.toml from the current directory for kikx add.
kikx.toml¶
Written by kikx init and kikx setup, read by kikx add. TOML, one table.
[project]
name = "platform"
default_namespace = "platform"
output_dir = "infra"
Key |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
yes |
— |
Project name |
|
string |
no |
|
|
|
string |
no |
|
Directory, relative to |
A missing [project] table or name key fails with failed to parse <path>/kikx.toml.
Project defaults¶
Compiled into kikx-core (backend/core/src/config.rs) and served by GET /api/config.
Constant |
Value |
|
Used for |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
Project name when the current directory has no name |