Complete reference for all Kilometers CLI commands, environment variables, and usage examples.
km --versionDisplay version information
km --versionKilometers CLI cli-v2025.07.10.1 Build time: 2025-07-10T05:50:24Z Go version: go1.24.4 Platform: darwin/arm64
km --helpShow help information and usage
km --helpUsage: km <mcp-server-command> [args...] Wrap an MCP server km version Show version information km update Update to latest version km help Show this help message Examples: km npx @modelcontextprotocol/server-github km python -m slack_mcp_server
km initInteractive configuration setup - guides you through setting up API key and other options
km init🚀 Kilometers CLI Configuration Setup This will guide you through setting up your Kilometers CLI configuration. You can press Enter to accept default values shown in brackets. API Key (required):
km updateUpdate to the latest version (currently shows placeholder message)
km updatekm cli tool @ cli-v2025.07.10.1 Update functionality coming soon! For now, download the latest version from: https://github.com/kilometers-ai/kilometers/releases/latest
km <mcp-server-command>Wrap and monitor any MCP server
km npx @modelcontextprotocol/server-github[km] Starting Kilometers CLI wrapper for: [npx @modelcontextprotocol/server-github] [km] Started process with PID: 12345 [km] Event #1: request tools/call (156 bytes)
KILOMETERS_API_URLAPI endpoint URL
http://localhost:5194https://api.kilometers.aiKILOMETERS_API_KEYAPI authentication key
(none)km_1234567890abcdefKILOMETERS_CUSTOMER_IDCustomer identifier
defaultcompany-123KM_DEBUGEnable debug logging
falsetrueKM_BATCH_SIZEEvents per API batch
1020KM_ENABLE_RISK_DETECTIONEnable client-side risk analysis
falsetrueKM_METHOD_WHITELISTComma-separated list of methods to capture
(none)tools/call,resources/readKM_PAYLOAD_SIZE_LIMITMaximum payload size in bytes (0 = no limit)
010240KM_HIGH_RISK_ONLYOnly capture high-risk events
falsetrueKM_EXCLUDE_PINGExclude ping messages from monitoring
truefalseMonitor a GitHub MCP server
km npx @modelcontextprotocol/server-githubEnable verbose logging to see what's being captured
KM_DEBUG=true km npx @modelcontextprotocol/server-githubOnly capture high-risk events with risk detection enabled
KM_ENABLE_RISK_DETECTION=true KM_HIGH_RISK_ONLY=true km your-mcp-serverOnly monitor specific MCP methods
KM_METHOD_WHITELIST="tools/call,resources/read" km your-mcp-serverLimit payload sizes and exclude ping messages
KM_PAYLOAD_SIZE_LIMIT=5120 KM_EXCLUDE_PING=true km your-mcp-serverAdd your environment variables to your shell profile (~/.bashrc, ~/.zshrc) to persist them across sessions.
Enable risk detection and use method whitelisting for production environments to minimize security risks.
Use payload size limits and exclude ping messages to reduce bandwidth usage and improve performance.
Learn about all available environment variables for configuration.
Environment Guide