Reference
Documentation
KNTIC Pulse + @kntic/kntic CLI · v0.10.0
On this page
This document covers the KNTIC Pulse orchestration engine — environment configuration, task manifest schema, orchestrator behaviour, and the GIA validation pipeline. For CLI commands (kntic init, kntic start, kntic stop, kntic update), see the @kntic/kntic CLI section below.
Environment Variables
All configuration is done through .kntic.env in your project root. Copy bootstrap-templates/kntic.env as your starting point.
Required
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY | API key for the AI agent (passed to the agent process at runtime) |
UID | Host user ID — prevents volume permission issues. Run id -u to get yours |
GID | Host group ID. Run id -g to get yours |
.kntic.envis listed in.gitignoreand must never be committed to version control.
Required in remote mode (KNTIC_REMOTE_ENABLED=true)
These variables are only required when the orchestrator connects to a remote git repository (the default). When running in local-only mode (KNTIC_REMOTE_ENABLED=false), they can be left empty.
| Variable | Description |
|---|---|
GITLAB_TOKEN | GitLab personal access token with read/write access to the target repository. Used to authenticate git push/fetch operations and construct the authenticated remote URL. |
GIT_HOST | GitLab hostname, e.g. gitlab.example.com. Used for remote URL construction and the dashboard repository link. |
GIT_REPO_PATH | Repository path including .git, e.g. group/project.git. Used alongside GIT_HOST to build the remote URL (https://oauth2:{token}@{host}/{repo_path}) and to generate the dashboard repository navigation link. |
Authentication
| Variable | Default | Description |
|---|---|---|
DASHBOARD_AUTH_TOKEN | (empty) | Bearer token for dashboard API authentication. When empty, the dashboard runs in open mode and displays a warning banner. Set to a strong random string in production. |
Orchestrator
| Variable | Default | Description |
|---|---|---|
KNTIC_REMOTE_ENABLED | true | When false, all git push/fetch/pull operations are skipped. The orchestrator works against a local-only git repository — no GitLab instance required. Incompatible with KNTIC_ORCHESTRATOR_ID (startup will refuse if both are set). |
KNTIC_ORCHESTRATOR_ID | (auto-generated) | Unique UUID identifying this orchestrator instance. Required for multi-orchestrator deployments — used by the optimistic claim protocol to prevent two orchestrators from working the same task. |
KNTIC_TARGET_BRANCH | main | The git branch all orchestrator operations target — commits, pushes, and merges all go here. |
KNTIC_BRANCH_STRATEGY | trunk | trunk: commits directly to KNTIC_TARGET_BRANCH. per-task: creates an isolated branch (kntic/{oid}/{task_id}) per task and merges on GIA pass. Trunk mode is only safe for single-orchestrator deployments. |
KNTIC_MERGE_STRATEGY | merge | Merge strategy used when KNTIC_BRANCH_STRATEGY=per-task. merge: standard --no-ff merge. ff: fast-forward only (--ff-only). |
KNTIC_TASK_FILTER | (empty) | Comma-separated list of task ID prefixes this orchestrator will claim, e.g. BUG,DASHBOARD. When empty, all tasks are handled. |
Agent
| Variable | Default | Description |
|---|---|---|
KNTIC_AGENT_CMD | pi | The agent binary or command to invoke. Change this to use a different coding agent — claude, aider, codex, or any CLI agent. |
KNTIC_AGENT_ARGS | -p {prompt} | Argument template for the agent command. {prompt} is replaced with the full task prompt at runtime. |
KNTIC_AGENT_PERSISTENT | true | true: the orchestrator polls the task manifest every 2 seconds and terminates the agent process when a terminal status is detected. false: waits for the agent process to exit naturally. |
KNTIC_AGENT_TIMEOUT | 3600 | Maximum agent session duration in seconds. If the agent has not set a terminal status within this time, the process is terminated and the task is set to needs_review. |
Container Runtime
| Variable | Default | Description |
|---|---|---|
KNTIC_COMPOSE_PROVIDER | docker compose | The compose command used to manage containers. Supported: docker compose (V2 plugin), podman compose, podman-compose (standalone Python). |
General
| Variable | Default | Description |
|---|---|---|
TZ | Europe/Vienna | Timezone for all container processes. |
KNTIC_VERSION | (set by kntic init) | Platform version label — set automatically during kntic init and used for version tracking. |
Task Manifests
Tasks are defined as JSON files in .kntic/manifests/. The dashboard provides a UI for creating and editing them; you can also write them by hand.
Minimal example
{
"task_id": "FEAT-001",
"title": "Add user authentication",
"status": "todo"
}
Full example
{
"task_id": "FEAT-001",
"title": "Add user authentication",
"description": "Implement JWT-based login and session management.",
"status": "todo",
"priority": "high",
"depends_on": ["INFRA-003"],
"requirements": {
"features": [
"POST /auth/login endpoint returning a signed JWT",
"Token expiry of 24 hours",
"401 response on invalid credentials"
],
"files_to_create": ["src/auth.py", "tests/test_auth.py"]
},
"context_scope": {
"read_only": [".kntic/adrs/"],
"write_access": ["src/", "tests/"]
},
"notes": "Use the existing User model in src/models/user.py"
}
Status lifecycle
todo → in_progress → ready_for_merge → merged
│ ↖
▼ └──── refactoring
needs_review
backlog → (human promotes) → todo
| Status | Set by | Meaning |
|---|---|---|
todo | Human | Ready for the orchestrator to pick up |
in_progress | Orchestrator | Claimed — agent is actively working |
refactoring | Agent | GIA failed; agent is self-correcting |
needs_review | Agent / Orchestrator | Blocked — human must intervene |
ready_for_merge | Agent | Work complete; awaiting GIA |
merged | Orchestrator | GIA passed; changes pushed to git |
backlog | Human | Needs refinement before it can become todo |
⚠️ The status
"done"does not exist. Using it will break orchestration.
Key fields
| Field | Required | Description |
|---|---|---|
task_id | ✅ | Unique identifier, also the filename stem. Conventionally PREFIX-NNN (e.g. BUG-012, FEAT-003). |
title | ✅ | Short human-readable name. |
status | ✅ | Current state machine status (see above). |
description | Longer description of the task goal. | |
priority | high, medium, or low. Affects dispatch order. | |
depends_on | Array of task IDs that must be merged before this task is eligible. | |
requirements | Structured specification: features, files_to_create, files_to_modify, outputs, security. | |
context_scope | Files the agent may access: read_only and write_access path lists. | |
notes | Free-text commentary, blocking reasons, or context for the agent. |
Omission rule: fields that are empty must be omitted entirely — never set to null, "", or [].
Orchestrator Behaviour
Pulse loop
The orchestrator runs in a continuous pulse loop (5-second interval). Each pulse processes exactly one task:
ready_for_merge— validate with GIA; merge and push on pass, setrefactoringon fail.todo/refactoring— claim and dispatch to the agent.refactoringalways takes priority overtodoto prevent a dirty working tree from contaminating the next task.- Idle — no actionable work. After 12 idle pulses (~1 minute), pull latest changes from remote.
Within each category, tasks are sorted by: status rank → priority → oldest updated_at first (FIFO).
Claim protocol (multi-orchestrator)
When multiple orchestrators run against the same repository, the claim protocol prevents conflicts:
- Orchestrator writes
status: in_progress+claimed_by+claimed_atto the manifest and pushes. - If the push is rejected (another orchestrator pushed first), the claim is abandoned and the task is skipped this pulse.
- Stale claims (older than
KNTIC_AGENT_TIMEOUT) are detected and reclaimed asneeds_review.
GIA — Global Impact Analysis
Before any task is merged, the full GIA hook suite runs against the codebase. GIA produces a weighted alignment score (0.0–1.0). Merge is only allowed when the score meets the configured threshold.
Built-in GIA hooks:
| Hook | Type | Description |
|---|---|---|
001-pytests.sh | specific | Runs the project test suite |
002-bootstrap-sync.sh | specific | Validates bootstrap template consistency |
001-adr-compliance.py | internal | Checks manifest schema, ADR structure, omission rule |
998-drift-stale-refs.py | internal | Detects stale file references in MEMORY.MD and ADRs |
999-drift-symlinks.py | internal | Detects broken symlinks |
When GIA fails, the failure reason, alignment score, dimension breakdown, and hook output are written back to the task manifest (gia_failure field) so the agent knows exactly what to fix on the next attempt.
Custom hooks can be added to .kntic/hooks/gia/specific/ and will be discovered automatically.
Dashboard
The dashboard is available at http://localhost:8000 (or the port configured via KNTIC_UI_PORT).
Features:
- Live task board with real-time WebSocket updates
- Create, edit, and manage task manifests through a structured form
- Per-status and per-prefix filtering
- GIA health indicator showing the current alignment score
- Actions audit log per task
- ADR and documentation viewer
- Repository link (when
GIT_HOSTandGIT_REPO_PATHare configured)
Authentication: when DASHBOARD_AUTH_TOKEN is set, all state-mutating API endpoints require a Bearer <token> header. The dashboard login page handles this automatically.
Package: @kntic/kntic · Version: 0.10.0 · Node.js: ≥ 18.0.0 · Platform: Linux (recommended)
The KNTIC CLI bootstraps, configures, updates, and manages projects running on the KNTIC Pulse manifest-driven AI agent orchestration platform. It has zero external dependencies — everything is built with Node.js stdlib.
Installation
npm install -g @kntic/kntic
Or run directly without installing:
npx @kntic/kntic <command>
Commands
kntic usage
Display all available commands and their options.
kntic usage
Running kntic with no arguments also shows the usage screen.
kntic init
Bootstrap a new KNTIC project in the current directory. Downloads the latest bootstrap archive and scaffolds the full .kntic/ directory structure, kntic.yml (Docker Compose file), and .kntic.env (environment configuration).
kntic init # Interactive mode (default)
kntic init --quick # Non-interactive mode
kntic init -q # Short alias for --quick
Modes
| Mode | Flag | Description |
|---|---|---|
| Interactive (default) | --interactive / -i | Walks through every .kntic.env variable, showing the current value as default. |
| Quick | --quick / -q | Silent auto-fill. Only auto-detected values are written. No prompts. |
What it does
- Preflight checks — Verifies the environment (warnings only, never blocks): platform, container runtime (Docker / Podman), GNU screen.
- Downloads the latest bootstrap archive from the KNTIC artifact server.
- Extracts the archive into the current directory. If a
.gitignorealready exists, the archive's entries are appended (with a# --- kntic bootstrap ---separator) instead of overwriting. - Auto-detects the git remote by parsing the
originremote URL — supports SSH (git@host:path) and HTTPS (https://host/path) formats. If aglpat-*token is found in the URL, it's extracted intoGITLAB_TOKEN. No remote → setsKNTIC_REMOTE_ENABLED=false. - Auto-fills the detected compose provider into
KNTIC_COMPOSE_PROVIDER. - Interactive setup (unless
--quick): Prompts for each variable in.kntic.env.
Scaffolded structure
your-project/
├── .kntic/
│ ├── lib/ # Orchestrator engine code
│ ├── adrs/ # Architecture Decision Records
│ ├── hooks/
│ │ └── gia/
│ │ ├── internal/ # Built-in GIA validation hooks
│ │ └── specific/ # Project-specific GIA hooks
│ ├── gia/
│ │ └── weights.json # GIA scoring weights
│ ├── manifests/ # Task manifests (JSON)
│ └── docs/ # Project documentation
├── kntic.yml # Docker Compose file for KNTIC services
├── .kntic.env # Environment configuration
└── .gitignore # Updated with KNTIC-specific entries
kntic update
Update an existing KNTIC project to the latest version. Downloads the latest bootstrap archive and selectively replaces components.
kntic update # Full update
kntic update --lib-only # Update only .kntic/lib
kntic update --compose # Also replace kntic.yml
Options
| Flag | Description |
|---|---|
| (no flags) | Full update — replaces .kntic/lib, .kntic/adrs, updates .kntic/hooks/gia/internal, bootstraps .kntic/hooks/gia/specific (if not yet present), replaces .kntic/gia/weights.json, and merges new env variables. |
--lib-only | Minimal update — only replaces .kntic/lib. Skips ADRs, hooks, weights, and env merge. |
--compose | Additionally replaces kntic.yml from the bootstrap template. The existing file is backed up to kntic.yml.bak first. |
Update semantics per component
| Component | Strategy |
|---|---|
.kntic/lib/ | Replaced — directory is cleared, then freshly extracted. |
.kntic/adrs/ | Replaced — directory is cleared, then freshly extracted. |
.kntic/hooks/gia/internal/ | Updated — existing files are overwritten, new files are added, but files not in the archive are preserved. |
.kntic/hooks/gia/specific/ | One-time bootstrap — only extracted if the directory does not already exist. |
.kntic/gia/weights.json | Replaced if present in the archive. |
.kntic.env | Merged — new variables from the template are appended. Existing values are never overwritten. |
kntic.yml | Not touched unless --compose is passed. |
KNTIC_VERSION | Always updated in .kntic.env to the latest version. |
kntic start
Build and start KNTIC services using the configured container compose provider.
kntic start # Start in foreground
kntic start --screen # Start inside a GNU screen session
Options
| Flag | Description |
|---|---|
| (no flags) | Runs <provider> -f kntic.yml --env-file .kntic.env up --build in the foreground. |
--screen | Wraps the compose command in a GNU screen session. Session name from KNTIC_PRJ_PREFIX or current directory name. |
Screen behavior
- If
screenis not installed, falls back to foreground mode with a warning. - If already inside a screen session (detected via the
STYenvironment variable), skips the screen wrapper and runs in foreground.
The compose command is read from KNTIC_COMPOSE_PROVIDER in .kntic.env. Defaults to docker compose if not set.
kntic stop
Stop running KNTIC services.
kntic stop
Runs <provider> -f kntic.yml --env-file .kntic.env stop using the configured compose provider.
Environment Configuration (.kntic.env)
All runtime configuration lives in .kntic.env at the project root. This file is used by both the CLI and the Docker Compose services.
| Variable | Description | Auto |
|---|---|---|
ANTHROPIC_API_KEY | API key for the AI agent (Claude) | — |
GITLAB_TOKEN | GitLab personal access token (glpat-*) | ✓ |
GIT_HOST | Git server hostname | ✓ |
GIT_REPO_PATH | Repository path on the git server | ✓ |
UID | Host user ID for container file permissions | — |
GID | Host group ID for container file permissions | — |
TZ | Timezone (e.g. Europe/Vienna) | — |
KNTIC_VERSION | Current KNTIC version (managed automatically) | ✓ |
KNTIC_PRJ_PREFIX | Project prefix — used for screen session name and branch naming | — |
KNTIC_UI_PORT | Port for the KNTIC dashboard UI | — |
DASHBOARD_AUTH_TOKEN | Authentication token for the dashboard | — |
KNTIC_AGENT_CMD | Command to run the AI agent | — |
KNTIC_AGENT_ARGS | Arguments passed to the agent command | — |
KNTIC_AGENT_PERSISTENT | Keep agent process alive between pulse cycles | — |
KNTIC_AGENT_TIMEOUT | Timeout (seconds) for agent execution per task | — |
KNTIC_ORCHESTRATOR_ID | Unique identifier for this orchestrator instance | — |
KNTIC_BRANCH_STRATEGY | Git branching strategy (per-task, etc.) | — |
KNTIC_TARGET_BRANCH | Target branch for merges (e.g. main) | — |
KNTIC_MERGE_STRATEGY | Git merge strategy (--no-ff, etc.) | — |
KNTIC_COMPOSE_PROVIDER | Container compose command | ✓ |
KNTIC_REMOTE_ENABLED | Whether git remote operations are enabled | ✓ |
Auto-detected values are filled in during kntic init based on your environment. All values can be overridden manually.
Preflight Checks
During kntic init, the CLI runs non-blocking preflight checks and prints warnings:
| Check | Warning |
|---|---|
| Non-Linux platform | ⚠ Non-Linux detected (<platform>) — KNTIC is designed for Linux, other platforms may have issues |
| No Docker or Podman | ⚠ No container runtime found (docker or podman) — required for kntic start |
| Podman without podman-compose | ⚠ podman-compose not found — install it via pip install podman-compose |
| No GNU screen | ⚠ screen not found — optional, needed for kntic start --screen |
These are advisory only — init always proceeds regardless of warnings.
Error Handling
All commands exit with code 1 on failure and print an error message to stderr. Unknown subcommands print the usage screen and exit with code 1.
$ kntic foobar
Unknown command: "foobar"
kntic v0.10.0 — KNTIC CLI
...
Quick Reference
kntic Show usage
kntic usage Show usage
kntic init Interactive bootstrap (default)
kntic init --quick | -q Non-interactive bootstrap
kntic update Full update (lib, adrs, hooks, weights, env)
kntic update --lib-only Update .kntic/lib only
kntic update --compose Also replace kntic.yml (with .bak backup)
kntic start Start services in foreground
kntic start --screen Start services in a screen session
kntic stop Stop services