Skip to content

CLI-to-CLI peers ​

TIP

Looking for the conceptual overview of how TLS peers, blob stores, GitHub Releases, local dirs, and external harnesses fit together across CLI, MCP, and the Web Harness /#/sources tab? See Peers & Sources: Multi-Machine Federation & Shared Harness State.

kompile peer and the peer MCP/chat tool share one implementation. No web app is required. Bare kompile peer opens a wizard. Native chat, stdio MCP, and daemon/socket MCP register the tool; progressive clients activate integrations to discover it.

Guided onboarding wizard & agent auto-configuration ​

To configure a minimal Kompile install without learning individual /commands, run the interactive wizard (or /onboard inside chat):

sh
kompile onboard

Or run non-interactive auto-configuration (dry-run by default; add --yes to apply):

sh
kompile onboard --status
kompile onboard --auto --import-all --yes
kompile onboard --auto --install claude,codex --import-all \
  --peer-name main-box --peer-address tls://HOST:7337 \
  --peer-fingerprint SHA256 --peer-token-file /private/path/token --yes

The same operations are exposed as MCP/chat tools (in the integrations and workflow groups) so an agent can auto-configure a minimal install directly:

  • onboarding (action=inspect|auto_configure|import_all|connect_peer): inspect readiness, auto-configure home + peer identity + starter harness config, import conversations across detected harnesses, and pair/verify a TLS peer.
  • harness_manager (action=detect|list|detect_conversations|install): auto-detect installed harnesses (claude, codex, gemini, opencode, agy, pi), discover importable conversation stores, and download missing harnesses via their official vendor installers.
  • conversation_import (action=discover|list|import|import-all, including source="all"): import conversations from all 11 supported external harnesses into ~/.kompile/conversations/.

Bootstrap a fresh box without SSH ​

If another machine does not have Kompile installed yet, serve install.sh and the distribution archive directly from this machine with the built-in read-only HTTP server (pure JDK, zero external tools):

sh
kompile peer serve-install --yes
  • Auto-detects install.sh and dist/kompile-dist-*-cli-harness-any.{tar.gz,zip} (or pass --archive <file|dir>, --variant <name>, --bind, --port defaulting to 8765, --advertise-host).
  • Serves an explicit allowlist only (/install.sh, /dist/<archive>, /dist/<archive>.sha256, computing .sha256 on startup if missing). Never exposes peer identity keys, passwords, or tokens.
  • Prints the exact one-line curl -fsSL ... | bash -s -- ... command to paste on the target machine (Java 17+ required on PATH for cli-harness) and, if ~/.kompile/peer/identity exists, the follow-up kompile peer add pairing command with this host's SHA-256 fingerprint.

Runtime artifact sync over TLS (no SSH) ​

Once two machines are paired via kompile peer, you can also push runtime artifacts (launcher, cli-harness, chat-harness, remote-cli, harness, cli, local-runtime, etc.) over the pinned TLS connection — no SSH required:

On the target listener, explicitly opt in to receiving allowlisted runtime artifacts (bin/kompile, lib/kompile-*.jar, .dist-info.json):

sh
kompile peer listen --bind 0.0.0.0 --port 7337 --allow-artifacts --yes

On the sender, use either kompile sync or kompile peer sync:

sh
# Preview then apply slim harness jars over TLS
kompile sync b --artifacts harness --artifacts-only --dry-run
kompile sync b --artifacts harness --artifacts-only --yes

# Or via kompile peer sync (with optional state sync in the same pass)
kompile peer sync b --artifacts harness --apply --yes

Artifacts stream in 1 MiB chunks with SHA-256 verification before atomic replacement, purge stale lib/.boot-inf-extracted caches on JAR swaps, and reject any non-allowlisted or symlink destination. Listeners without --allow-artifacts refuse artifact writes while still answering read-only probes.

Federated local + peer search without transferring files ​

Paired TLS peers can be queried server-side across transcripts, memories, skills, roles, prompts, provider-skills, agents, config, extensions, and judge-records without copying files onto the querying box.

On the listener, remote search is enabled by default for the exposed --only families. Use --search-only to expose read-only searchable families (such as transcripts) without allowing sync writes to them, or --no-search to disable remote search:

sh
# Expose skills/memories/roles for sync + search, and transcripts for read-only search/read:
kompile peer listen --bind 0.0.0.0 --port 7337 --search-only transcripts --yes

On the querying machine:

sh
# Search locally + all registered TLS peers across memories, transcripts, skills, roles:
kompile peer search "cuda graph replay"
kompile peer search "cuda graph replay" --only memories,transcripts,skills

# Search a specific peer only (--no-local skips local):
kompile peer search b --query "cuda graph replay" --only transcripts --no-local

# Page a matched transcript, memory, or skill directly from the peer (nothing written locally):
kompile peer read b --component transcripts --path <session-id> --offset 1 --limit 120
kompile peer read b --component memories --path gpu_diagnostics.md

The chat/MCP tools also support peers directly as a search source alongside local files:

  • memory: pass include_peers=true (or peer="<name>") on search/recall, or peer="<name>" on read.
  • transcript_search: pass include_peers=true (or peer="<name>") on fulltext/search/read.
  • peer: action="search" and action="read" (read-only; available to supervised subagents too).

Pair two machines ​

On B, in the project whose agents should receive messages:

sh
kompile peer init --yes
kompile peer listen --bind 0.0.0.0 --port 7337 --only skills,memories,roles,transcripts,judge-records,cli-settings,credentials --yes

init creates owner-only ~/.kompile/peer/identity/ containing identity.p12, password, and token. It needs JDK keytool (Java home/bin, otherwise PATH), including with a native CLI. Existing identities are never replaced. The listener prints its SHA-256 certificate fingerprint, not its token. Default bind is loopback; choose a reachable interface and allow the port in your firewall. Ctrl+C stops a CLI listener. MCP listen starts a host-owned daemon listener; stop closes only that host's listener. A separate CLI invocation cannot stop another CLI process; use Ctrl+C in that listener. No automatic listener startup after a host restart.

Copy only B's token to an owner-only file on A through a trusted channel, and independently verify B's fingerprint. Never share B's private key/password. On A:

sh
chmod 600 /private/path/b-token
kompile peer add b --address tls://B_ADDRESS:7337 --fingerprint B_SHA256 --token-file /private/path/b-token --yes
kompile peer status b
kompile peer sync b --only skills,transcripts,judge-records,cli-settings,credentials
kompile peer sync b --only skills,transcripts,judge-records,cli-settings,credentials --apply --yes

The first sync previews; the second applies. Default direction is bidirectional; --direction push|pull|both selects direction. Conflicts abort before writes; explicitly choose --conflict local|remote if appropriate. Deletions require --allow-delete on caller and listener. Baselines bind local/remote profile mounts and TLS certificate identity. Use separate peer names for different profiles; remove and explicitly re-pair to change identity. Existing kompile sync b also accepts these registered TLS peers with its existing flags. SSH/local-subprocess sync remains supported.

Repeat pairing in the other direction if B must initiate requests to A. A listener does not initiate reverse connections, automatically sync in the background, or traverse NAT. Addresses are exactly tls://host:port, without plaintext, URL path, userinfo, query, or fragment. TLS verifies the pinned certificate before sending the token. A token grants access to the listener's selected families and project agent mailbox. There is no per-client grant isolation behind one token. To revoke it, stop the listener, replace the token with an owner-only 32-random-byte hex secret, restart, and explicitly re-pair trusted clients.

Exactly what synchronizes ​

Defaults remain skills,memories,roles. Additional selections are explicit:

FamilyAllowlisted state
prompts, provider-skills, agentsExisting portable Kompile families
configPortable JSON configs under ~/.kompile/config/ (including mcp-servers.json, excluding machine-bound backend/GPU configs)
extensionsInstalled process extensions under ~/.kompile/extensions/ (preserves executable permissions on POSIX; subject to 16MiB per-file limit)
cli-settingsGlobal chat-config.json, harness-config.json, judge-defaults.json
credentialsGlobal managed auth.json (API keys/file-backed OAuth credentials)
transcriptsTop-level conversations/<session>.txt
judge-recordssessions/<session>/judgements.jsonl only
harness-settings, harness-credentialsExisting explicit Codex/Claude mounts; see harness sync

all includes secrets. Settings, transcripts, and judge inputs can themselves contain credentials. Both sides must explicitly select/expose these families. They are global-only. Address listeners expose one fixed Kompile profile/project, not caller-selected filesystem roots. --home selects the local CLI profile; --user-home selects local external harness mounts. Existing SSH sync supports project-scope portable content.

Close active chat/harness writers before applying snapshots. Files are replaced, not merged. Concurrent target changes are rejected against inventory hashes; source payload hashes are checked. There is no transaction spanning all files: a mid-transfer failure can leave earlier writes applied, with the baseline unadvanced. Review the next plan before retrying. Credential refresh races cannot be made safe by copying a live auth store. Environment/keychain credentials are not exported; copied refresh tokens may invalidate the original login.

Symlinks/traversal/unallowlisted fetch/apply paths are rejected. Sensitive IO uses anchored no-follow secure directory handles and owner-only replacements; unsupported filesystems fail closed. Peer identity/token files require private POSIX permissions. Files are limited to 16MiB and frames to 24MiB; archive/split large transcripts first. Caches, models, PID/session ownership, resume claims, approvals/overrides, tool-results, locks and runtime state are not transferred. A copied transcript/judge log does not create a running session or remap historical working directories.

Agent-to-agent messages ​

Run listeners in both agents' projects and pair in both directions:

sh
kompile peer agents b
kompile peer send b --target-session REMOTE_COORDINATION_ID --message 'Please review this result'
kompile peer inbox --project /local/project --session LOCAL_COORDINATION_ID
kompile peer ack --project /local/project --session LOCAL_COORDINATION_ID --message-id MESSAGE_ID

Native or external CLI agents use the same tool:

json
{"action":"agents","peer":"b"}
{"action":"send","peer":"b","targetSessionId":"remote-agent-id","message":"Please review this result"}
{"action":"inbox"}
{"action":"ack","messageId":"delivered-message-id"}

Messages are durable, target an active registered agent in the listener's project, and inherit the coordinator mailbox TTL. They have stable IDs and explicitly marked untrusted peer content. Inbox/ack tools are bound to the caller's local coordination session. Use replyTo when replying. Reading does not acknowledge; acknowledge after handling. Retries may duplicate messages; retain IDs if processing has side effects. Successful send means mailbox delivery, not model consumption: no automatic wake-up of idle native/headless/external turns. Agents cooperate by polling. Peer text is never an operator approval or permission bypass.

Advisory peer judge calls ​

B explicitly enables --allow-judge when listening and has an available globally enabled configured judge. Judge requests use the host's default authenticated profile and the listener project's backend configuration. Custom --home listeners must leave remote judge calls disabled to avoid billing/credential profile mismatches. A asks:

sh
kompile peer judge b --prompt 'Review the proposed result' --output-file result.txt --yes

Equivalent MCP request:

json
{"action":"judge","peer":"b","prompt":"Review the proposed result","output":"Agent result","confirmed":true}

This discloses supplied text to B's judge/provider and may incur costs. The returned quality verdict is advisory: it executes no proposed command, modifies no live controls, imports no approvals/overrides, and does not implicitly reconfigure the caller's enforcement backend. Evaluation is bounded to 45 seconds; unavailable/failed evaluations return errors. Calls are not automatically inserted into native supervision. Existing local logs can separately be synced via judge-records.

MCP operations ​

peer exposes init, listen, stop, add, list, remove, status, local_status, agents, sync, send, inbox, ack, judge. confirmed=true requires explicit operator authorization for profile/exposure changes, applied sync and judge usage. Delegated children may communicate/poll their own inbox but cannot change profile/exposure state or authorize judge usage. Parameters never accept raw tokens, arbitrary remote commands, remote roots or cross-session judge controls. Sync defaults to dryRun=true; apply with dryRun=false,confirmed=true. local_status reports the caller's coordination session ID and listener status.

Root explainer & guided onboarding (kompile explain, kompile onboard) ​

Use kompile explain (aliases: kompile overview, kompile whats-configured; in chat: /explain [section]) for a single zero-secret overview of everything installed and configured on a machine:

sh
kompile explain                # Full overview (install, harnesses, auth names, subagents, chat, judge/edit-locks, process limits, enforcer, MCP, LSP, peers)
kompile explain subagents      # Single section: install|harnesses|auth|subagents|chat|harness|processes|enforcer|mcp|lsp|federation|commands
kompile explain --json         # Machine-readable JSON for agents and scripts
kompile explain --probe-peers  # Include live TLS peer reachability/capability probe

Use kompile onboard (in chat: /onboard) to bootstrap a fresh or minimal install interactively or non-interactively:

sh
kompile onboard                                         # Interactive wizard (auto-configure, subagents/judge/auto-compact/limits, harnesses, import, peers, explain)
kompile onboard --status                                # Quick readiness snapshot
kompile onboard --auto --configure-subagents --yes      # Non-interactive home + TLS identity + starter harness + recommended subagent defaults

Agents can inspect, explain, and configure every easy-to-miss subsystem via the onboarding MCP tool (action=inspect|explain|configure|auto_configure|import_all|connect_peer):

Unified harness sources (kompile sources, /sources, sources MCP tool) ​

Mix TLS peers, blob stores (S3/R2/MinIO, mounted filesystem, or kompile-http), local/shared directories, and external CLI harness transcript stores under one source registry (~/.kompile/config/sources.json, zero secrets):

sh
kompile sources                                                         # Show configured sources & discovered backends
kompile sources discover                                                # Discover peers, blob stores & external harnesses
kompile sources auto-attach --yes                                       # Attach all discovered backends in one step
kompile sources add team-s3 type=blob-store ref=r2-archive components=memories,skills,roles,transcripts
kompile sources add gpu-box type=peer ref=gpu-box mode=read-write
kompile sources add team-dir type=local-dir ref=/mnt/shared-kompile
kompile sources search "query" --component memories,transcripts         # Federated search across local + all matching sources
kompile sources read team-s3 memories feedback_rule.md                  # Paged read from any source
kompile sources write team-s3 skills deploy/SKILL.md --file ./SKILL.md --yes
kompile sources pull team-s3 --components memories,skills --yes         # Import components from any source into local home
kompile sources push team-s3 --components memories,skills --yes         # Export local components to any writable source

In chat, use /sources ... (alias /source, also supported in web chat). Agents use the sources MCP tool directly, or pass include_sources=true / source="<name>" to existing memory (recall/search/read/write) and transcript_search (search/fulltext/read) tools. Credential files (auth.json, .credentials.json) and machine-bound configs (nd4j-environment-config.json, gpu-limits.json, etc.) are never exposed or writable through sources.

In the slim and full chat webapps (kompile-app-chat-harness / kompile-app-chat), open the Sources tab (/#/sources, backed by /api/agents/chat/sources/**) to list/discover/auto-attach sources, connect/pair TLS peers, browse and read items across all component families (memories, transcripts, skills, roles, prompts, provider-skills, agents, config, extensions), run federated search, write items to writable sources, and preview/apply pull and push transfers.

Released under the Apache-2.0 License.