Walkthroughs: Starting an Agent & Signing In to a Remote Agent (CLI & Web)
This guide walks step-by-step through two core everyday workflows — starting an agent and signing in to a remote agent/provider — on both the CLI (kompile chat) and the Web Harness (kompile chat --web).
Both surfaces drive the exact same local kompile CLI engine, credential store, and session history (~/.kompile/conversations/), so credentials you add or sessions you start in one immediately appear in the other.
Walkthrough 1: Starting an Agent
Option A: Starting an Agent on the CLI
1. Launch in your project directory
cd /path/to/your/repo
kompile chat # starts with your saved config, or opens SetupWizard on first run
# or force the interactive setup wizard at any time:
kompile chat --setup2. Step through SetupWizard
If no config exists yet (or you passed --setup), Kompile asks four numbered questions:
- Chat Mode
- Standard Chat — Kompile's own agentic loop with dedicated file/search/LSP tools, Enforcer, Judge, persistent memory, and subagents.
- Passthrough — drives an installed client CLI (
claude,codex,agy,opencode,pi) either Kompile-managed (recommended — injects MCP tools, memory, reminders, and guardrails inside Kompile's TUI) or Direct (raw vendor TUI). - Workflow — launches a multi-model team (
designer → workers → reviewer). - Resume / Resume All — reopens an existing conversation or restores recent terminal sessions.
- Runtime / Provider
- For Standard Chat: choose Direct model provider (OpenAI/Codex, Anthropic/Claude, Gemini/
agy, GitHub Copilot, OpenCode, OpenRouter, Fireworks, Together, etc.), Kompile local model (local-runtime), External local endpoint (Ollama/vLLM/LM Studio), or Kompile instance. - For Passthrough: pick the installed agent (
agy,claude,codex,opencode,pi). If a catalog harness isn't installed yet, Kompile auto-installs it via its official vendor installer (or run/install <agent>inside chat — see Installable Client Harnesses).
- For Standard Chat: choose Direct model provider (OpenAI/Codex, Anthropic/Claude, Gemini/
- Authentication & Live Model Discovery
- Pick an existing saved credential or sign in on the spot.
- Select from the provider's live model catalog and choose a thinking / reasoning effort level (
off,low,medium,high).
- Save Scope & Optional Profile
- Save for this session only, project defaults (
.kompile/chat-config.json), or global defaults (~/.kompile/chat-config.json), optionally under a named project profile for one-key reuse.
- Save for this session only, project defaults (
3. Direct one-line CLI launches (skip the wizard)
Once you know the route you want, start an agent directly with flags:
# Standard Kompile agent on a direct provider
kompile chat --provider openai --auth oauth --model gpt-5.6-sol
kompile chat --provider gemini --auth native # drives Antigravity (agy acp)
kompile chat --provider anthropic --auth native # drives Claude Code login
# Managed passthrough wrapping an external client CLI
kompile chat --mode passthrough --agent agy
kompile chat --mode passthrough --agent claude
kompile chat --mode passthrough --agent codex
kompile chat --mode passthrough --agent opencode
# Generic ACP v1 client (any ACP-compatible agent preset or custom command)
kompile chat --acp-command opencode
kompile chat --acp-command "my-agent acp"
# Expose Kompile itself as an ACP v1 agent server for Zed / JetBrains / Neovim
kompile acp --agent coder
# Headless one-shot turn for scripts & CI
kompile chat --prompt "Audit src/auth for token refresh races" --output-format stream-json4. Verify your running agent
Inside the chat REPL, verify the active route, model, and quota at any time:
/status # active mode, provider, model, session ID
/model # switch models live from the discovered catalog
/usage # check account quota / allowance
/install # check or install external client harnesses (agy, claude, codex, opencode, pi, gemini)Option B: Starting an Agent on the Web Harness
1. Start the browser workspace
cd /path/to/your/repo
kompile chat --web --open-browser
# Optional: pin a port or restrict to one folder
# kompile chat --web --web-port 9081
# kompile chat --web --single-chatkompile chat --web launches immediately — even before you have signed into any provider — and prints its local and LAN URLs (default port :8081).
2. Register your repository (if starting in another folder)
The directory where you ran kompile chat --web is registered automatically. To start agents in additional repositories, click Add Project in the left sidebar and enter the repository's absolute path on the host.
3. Open the New chat dialog
Click + New chat in the top bar (or click the + icon next to any project in the sidebar). You have two tabs:
- Browser setup (default structured form, backed directly by the CLI catalog)
- Complete CLI wizard (runs the full interactive
kompile chatwizard inside an embedded terminal for advanced team templates, local model downloads, or bulk resume)
In Browser setup, fill out the five numbered sections:
- 1 · Chat mode and saved configuration
- Enter a Chat title.
- Select Mode:
Standard,Passthrough,Workflow, orResume. - Optionally pick a Saved project profile (or leave on
Fresh setup / folder defaults). If Mode isWorkflow, also choose Lead mode.
- 2 · Runtime and authentication
- For Standard: select Runtime, Vendor / provider, Authentication, Authentication scope (
SessionorGlobal), and Existing account (or paste a session API key / custom Endpoint URL). - For Passthrough: select Native framework (
agy,claude,codex,opencode,pi) and Management style (Kompile-managed vs. direct). - Not signed in yet? Click Sign in (
<provider>) / Manage accounts & sign in right inside this section to open Provider Accounts & Sign-In without losing your place.
- For Standard: select Runtime, Vendor / provider, Authentication, Authentication scope (
- 3 · Model and generation options
- Choose from the live-discovered Model dropdown (click Refresh live models and options after signing in or switching accounts).
- Pick Thinking / effort and optional Fast mode or Ultracode (when eligible).
- 4 · Workflow (shown only when Mode = Workflow)
- Choose a Saved team (or click Templates / create or edit a team in the complete wizard).
- 5 · Destination, profile and judge defaults
- Choose Destination:
Web chat(opens a live browser pane) orCLI terminal. - Choose Configuration save scope:
This session only,Project defaults, orGlobal defaults, optionally save as a named project profile, and pick per-vendor judge defaults if desired.
- Choose Destination:
4. Launch and steer the agent
Click Create chat. Your new agent starts immediately in its own streaming pane (up to 8 concurrent chat panes across projects):
- Send prompts or queue follow-ups while the agent is streaming.
- Switch to
/processesto inspect live tasks, background commands, subagent threads, and 2,000-line logs. - Closing the tab or putting your laptop to sleep never stops the agent — reopening the page automatically replays missed SSE events and reattaches live.
Walkthrough 2: Signing In to a Remote Agent
When Kompile runs on a remote server, SSH workstation, container, or LAN box while your browser is on a different laptop, phone, or tablet, standard http://localhost:... OAuth callbacks cannot reach the remote host.
Kompile solves this identically across CLI and Web with manual paste-back OAuth, device-code OAuth, remote-safe native CLI login (agy, claude), and named API keys.
Option A: Signing In on the CLI (SSH / Remote Host)
1. Inspect current authentication state
kompile auth list2. Complete sign-in (interactive wizard first, or direct flags)
Interactive wizard (recommended — no flags to memorize):
kompile auth login # Walks through provider picker, OAuth / native / API-key login, and account namingYou can also run bare /auth inside any kompile chat session to sign in interactively without leaving chat.
Direct CLI flags (for SSH paste-back, device code, or non-interactive scripts):
Pick the explicit flow below when you want to jump straight to a remote-safe flag combination:
A. OAuth with manual paste-back (works over any SSH session)
Pass --manual so Kompile does not wait for a local loopback callback on the remote host:
# OpenAI / ChatGPT Codex subscription (named credential optional)
kompile auth login openai --oauth --manual --name work
# Anthropic / Claude setup-token or manual OAuth
kompile auth login anthropic --oauth --method setup-token --name work- Copy the authorization URL printed in your SSH terminal.
- Open it in your local browser and finish approving access.
- Your browser will redirect to a landing URL (or show a code). Copy that full redirect URL or code and paste it back into the SSH terminal prompt.
B. Device-code OAuth (no redirect URL at all)
Ideal on locked-down networks or mobile browsers:
# GitHub Copilot (add --enterprise <domain> for GitHub Enterprise)
kompile auth login github-copilot
# OpenAI device-code flow
kompile auth login openai --oauth --method device- Open the printed verification URL in any browser.
- Enter the short user code shown in the terminal.
- The remote CLI polls automatically and saves the credential as soon as you approve.
C. Native client harness sign-in (agy, opencode, claude, codex)
# Antigravity (runs `agy acp --login`; prints a Google sign-in link and accepts paste-back on headless/SSH hosts)
kompile auth login agy
# OpenCode
kompile auth login opencodeD. API keys (zero browser interaction, never stored in shell history)
# Pipe a secret via stdin
kompile auth login openrouter --stdin --name prod
# Or bind to an environment variable on the remote host
kompile auth login fireworks --from-env FIREWORKS_API_KEY
kompile auth login together --from-env TOGETHER_API_KEY3. Switch or verify accounts
kompile auth list # confirm the credential is stored and active
kompile auth switch openai work # switch active named account (propagates to open chats)
kompile auth logout openai work # revoke/remove a stored credentialTIP
Connecting to a remote Kompile peer node (mTLS GPU / agent sharing)? Pair the remote host once with kompile peer pair and list peers with kompile peer list (see Peers & Sources), then start chat with --provider kompile-peer. If you are administering inbound chat channels on a remote admin server, authorize your browser with kompile auth channel web-login (see Authentication, Channels, and Sources).
Option B: Signing In on the Web Harness (Remote Host from Your Browser)
When you access a remote kompile chat --web instance from your laptop, tablet, or phone browser (directly on LAN, over Tailscale/VPN, or via ssh -L 8081:localhost:8081 user@remote-host), all credential storage and OAuth handshakes stay on the remote CLI (kompile auth --web-login). The browser dialog automatically starts interactive OAuth flows in remote-safe manual: true mode, so loopback redirects are never required.
1. Open Provider Accounts & Sign-In
You can open the sign-in dialog from any of four places in the Web Harness:
- Navigate to
/settings→ click the Provider Accounts & Sign-In card. - In any
/chatpane, type/auth(or/auth agy,/auth openai,/auth anthropic, etc.) in the composer. - Inside the
New chatdialog (2 · Runtime and authentication), click Sign in (<provider>) or Manage accounts & sign in. - Click the disconnected-provider Sign in button next to the model selector in any chat header.
2. Select the provider or client harness
In the left sidebar of Provider Accounts & Sign-In, select the provider (for example Antigravity (agy), Claude, OpenAI, GitHub Copilot, OpenRouter, Fireworks, or Together). The header immediately shows live Connected / Disconnected status and any known accounts.
3. Complete the remote sign-in flow in your browser
Depending on the provider, the dialog presents the matching card:
- OAuth / Native CLI Sign-In (link + paste-back — e.g.
agy,openai,anthropic):- If multiple methods are offered, pick Method (for example
browser,device,setup-token, ormanual). - Optionally enter a Credential label (such as
personalorwork) for non-native OAuth providers. - Click Sign in (or Sign in / switch account).
- Click Open Sign-In Page (opens in a new tab on your local machine) or Copy Link.
- Complete sign-in in that tab, copy the authorization code or final landing URL, paste it into the Paste authorization code or landing URL box back in Kompile, and click Submit.
- If multiple methods are offered, pick Method (for example
- Device-Code Sign-In (e.g.
github-copilot, OpenAIdevice):- Click Sign in.
- Click Copy Code, then click Open Verification Page.
- Enter the code on the vendor page — the Kompile dialog polls automatically and updates to Connected once approved.
- API Key:
- Enter an optional Credential label (
default,work,prod). - Paste the secret into API key (masked; never echoed back by status APIs) and click Save API key.
- Enter an optional Credential label (
4. Switch accounts & refresh models
- Under Stored Credentials, you can switch which named credential is Active or log out of individual accounts at any time.
- Close Provider Accounts & Sign-In — if you opened it from New chat or a chat pane, Kompile refreshes live model discovery automatically (or click Refresh live models and options).
5. Connecting to a remote Kompile peer from the Web UI
To use a remote Kompile peer's models or sync artifacts from the browser:
- Open the
/sourcestab to inspect or pair with remote Kompile peers. - Open
+ New chatand select providerkompile-peerto chat against the remote peer with zero local GPU required.
Related Documentation
- CLI vs. Web Harness — Side-by-side comparison of
kompile chatandkompile chat --web. - Installable Client Harnesses — Exact install commands and client capabilities for
agy,claude,codex,opencode,pi, andgemini. - ACP v1 (Server & Client) — Running
kompile acpfor editors or driving external ACP agents via/acp. - Quickstarts by Audience — Provider-specific tips for Codex, Claude, Antigravity (
agy), GitHub Copilot, OpenCode, and API routers. - Authentication, Channels, and Sources — Full
kompile authCLI reference, including Slack/Telegram/Discord channels and source OAuth. - Connecting Two Peers & Remote Storage Walkthrough — Step-by-step CLI and Web guide for pairing two peers behind a VPN, pulling remote memories/transcripts/tools, and offloading writes.
- Peers & Sources — Encrypted mTLS peer federation and remote model/artifact sharing.