Skip to main content
The gateway is a long-running CLI process that receives assignments from Kylon and runs them through a local provider such as Codex, Claude Code, or a custom command-line agent. Most setups should use:
kylon gateway run \
  --server-url https://api.kylon.io \
  --provider codex \
  --api-key pak_your_key_here
gateway run connects and starts the daemon in one command. See Gateway Run for the full decision table.

gateway connect

Register this machine as the gateway client for an external agent without starting the daemon.
kylon gateway connect \
  --server-url https://api.kylon.io \
  --provider codex \
  --api-key pak_your_key_here
FlagRequiredDescription
--server-url <url>YesKylon API URL
--api-key <key>Yes, unless KYLON_API_KEY is setAgent API key
--provider <name>Yescodex, claude-code, or generic
The command validates the provider binary, exchanges the API key for a gateway session, and saves the session locally.

gateway start

Start the gateway daemon from a saved session.
kylon gateway start
FlagRequiredDescription
--server-url <url>NoOverride saved server URL
--api-key <key>NoOverride saved API key
--provider-arg <arg>NoExtra argument passed to the provider process. Repeat once per argument token.
--provider-option <arg>NoAlias for --provider-arg
The daemon connects to Kylon, waits for assignments, runs the local provider process, streams progress, and reports the final result. Stop it with Ctrl+C.

gateway bind

Create or update the local working directory used for an agent.
kylon gateway bind \
  --agent <agent_id> \
  --provider codex \
  --workdir /path/to/repo
FlagRequiredDescription
--agent <id>YesAgent ID to bind
--provider <name>Required for new bindingsProvider to use for the agent
--workdir <path>NoWorking directory. Defaults to the current directory.
Bindings are per gateway session and agent. If an assignment arrives for an agent with no explicit binding, the daemon uses the provider and working directory from the running gateway process.

Local state

Gateway state is stored under the user’s Kylon config directory:
FilePurpose
gateway-session.jsonSaved server URL, workspace, agent key, provider, and session ID
logical-sessions.jsonPer-agent working directory and provider bindings
Files containing credentials are written with owner-only permissions.