← All modules
management

Configs

Live

Configuration management and synchronization with versioning and a diff viewer.

event.type === "config" modules/configs
Overview

What Configs does

Configs tracks every change to your environment files and config blobs (.env, CLAUDE.md, OAuth client lists, CORS allowlists) as a versioned snapshot with a unified diff. The plugin watches files on disk and emits a `config` event whenever a key is added, removed, or modified — values for keys matching `password`, `secret`, `token`, `private_key`, `auth` are redacted before they leave your process.

Each version is content-addressed by SHA-256 and stored alongside the diff from the previous version. Rolling back is a one-line UPDATE — you just point `current_version_id` at the older row. The dashboard shows a side-by-side diff viewer with REDACTED placeholders for any field that matched a redact rule.

Wire payload

Same shape, three syntaxes

The wire protocol is plain HTTP, plain JSON, HMAC-SHA256. The TypeScript tab uses the SDK; the cURL tab is the raw HTTP equivalent; the Python tab shows the preview SDK shape.

import { createCuittyClient } from "@cuitty/sdk";
import { configsPlugin } from "@cuitty/sdk/plugins/configs";

const cuitty = createCuittyClient({
  portalUrl: "https://app.cuitty.com",
  projectId: process.env.CUITTY_PROJECT_ID!,
  apiKey: process.env.CUITTY_API_KEY!,
});
cuitty.use(configsPlugin());
cuitty.start();

cuitty.use(configsPlugin({
  projectRoot: process.cwd(),
  envFiles: [".env", ".env.production"],
  watchForChanges: true,
}));

// Plugin emits automatically when files change:
// type: "config"
// data.diff: { added: ["NEW_KEY"], removed: [], changed: [] }
SDK plugin

Drop-in plugin

@cuitty/sdk/plugins/configs
import { configsPlugin } from "@cuitty/sdk/plugins/configs";

cuitty.use(configsPlugin({
  projectRoot: process.cwd(),
  envFiles: [".env", ".env.production"],
}));
Storage

Database schema

Excerpt from modules/configs/schema.sql. One libSQL file per module — back it up with cp.

CREATE TABLE IF NOT EXISTS config_versions (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  file_id INTEGER NOT NULL REFERENCES config_files(id) ON DELETE CASCADE,
  version INTEGER NOT NULL,
  content TEXT NOT NULL,
  checksum TEXT NOT NULL,
  content_size INTEGER NOT NULL,
  diff_from_previous TEXT,
  created_by TEXT NOT NULL,
  commit_message TEXT,
  created_at INTEGER DEFAULT (unixepoch()),
  UNIQUE(file_id, version)
);

Related modules