ktx
Installs and configures ktx, the open-source context layer for data agents — runs ktx setup non-interactively with hidden CLI flags, configures database…
by skillmds★ 42 GitHub stars
Install ktx in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
ktx
Install and configure ktx, the open-source context layer for data agents. Use this skill when a user wants an agent to add ktx to a project, connect data sources, build initial context, install agent integration, or troubleshoot a local ktx setup.
Operating rules
- Act autonomously when the user asks you to install or configure ktx.
The non-interactive scripted flow below is the canonical path — bare
ktx setupis interactive (clack prompts) and an agent cannot drive it. - Setup's non-interactive flags are intentionally hidden from
--help. Use the flags listed below; verify uncommon flags against the docs athttps://docs.kaelio.com/ktx/or this skill — not against--helpoutput. - Ask only for values you cannot infer: project directory, connection targets, credentials, account identifiers, and source selections.
- Never ask the user to paste secrets when an
env:VAR_NAMEorfile:/pathreference would work. Pasting a literal URL is also safe —ktx setupauto-externalizes URLs into.ktx/secrets/<id>-url(see workflow step 2). - Do not commit
.ktx/secrets/*. - Print each command you run and its result.
- If a command fails, identify the cause and change something before retrying.
Gather inputs once
Before invoking ktx setup, collect in one round:
- Project directory (default: current working directory).
- LLM backend and key strategy. In
--no-inputmode the CLI defaults toanthropicand requires an API key. When the user is inside Claude Code, pass--llm-backend claude-codeexplicitly; otherwise pass--llm-backend anthropic --anthropic-api-key-env ANTHROPIC_API_KEY. - Embedding backend (
sentence-transformersis the local default and needs no key; useopenaionly if the user already has a key, then pass--embedding-api-key-env OPENAI_API_KEY). - Database: driver, connection id, URL (or
env:/file:ref), and one or more schemas. - Optional context sources (dbt, Metabase, Looker, LookML, MetricFlow,
Notion). Add each one with a follow-up
ktx setup --source …run (see Add context sources); use--skip-sourcesonly when the user has none.
Do not discover these inputs across multiple setup runs.
Install workflow
Detect the install path. If the working directory contains
packages/cli/dist/bin.jsorpnpm-workspace.yamlreferencing@kaelio/ktxyou are inside the ktx monorepo — build and link the local CLI withpnpmand do not runnpm install -g. Otherwise:node --version # require >= 22; stop and ask the user if older ktx --version || npm install -g @kaelio/ktxRun scripted setup (canonical path):
ktx setup --no-input --yes \ --project-dir <path> \ --llm-backend claude-code \ --embedding-backend sentence-transformers \ --database <driver> --database-connection-id <id> \ --database-url '<raw-url | env:NAME | file:/abs/path>' \ --database-schema <schema> \ --skip-sources- Configure one new database connection per setup invocation. For multiple connections, rerun setup once per connection.
- Pasting a literal
--database-urlis safe: the CLI relocates the URL into.ktx/secrets/<connection-id>-urland rewritesktx.yamlto afile:ref automatically.
Resumability and
--skip-*. Re-runningktx setupagainst an existing project resumes its config. Use--skip-llm,--skip-databases,--skip-sources, or--skip-embeddingsto leave a slice unconfigured but let the rest complete instead of aborting on the first failure. When resuming an existing project to change one slice (e.g. only LLM), still pass the database flags from the previous run — setup validates current flags, not persistedktx.yamlstate.Build context if setup did not already complete one:
ktx ingest <connection-id> --no-inputktx ingestalways builds enriched context and requires a configured model and embeddings (set during setup); a database connection without them fails with an enrichment-readiness error. Note:ktx ingestrejects--yestogether with--no-input(Choose only one runtime install mode);ktx setupaccepts both. Use--no-inputonly for ingest.Install agent integration:
ktx setup --agents --target <claude-code|claude-desktop|codex|cursor|opencode|universal> ktx mcp start --project-dir <path>Agent integration is not usable until
ktx mcp startis running. The--agentsstep prints this requirement asRequired before using agents.Fall back to bare
ktx setuponly when a human is at the keyboard — it uses interactive prompts an agent cannot answer.
Add context sources
Context sources (dbt, Metabase, Looker, LookML, MetricFlow, Notion) are added
one at a time — --source is not rep
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- metadata.json
FAQ
What does the ktx skill do?
Installs and configures ktx, the open-source context layer for data agents — runs ktx setup non-interactively with hidden CLI flags, configures database connections and embeddings, installs agent integration, and verifies readiness. Use when the user asks an agent to add ktx to a project, connect data sources, install agent rules, ingest schema, or troubleshoot a local ktx install.
How do I install the ktx skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the ktx skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…