AI Pilot in the terminal
Open AI Pilot next to a terminal, give it a task, follow each command it runs, answer its questions and pick up the conversation later.
On this page
- Open AI Pilot
- Start a conversation
- Follow along
- Status of a step
- How AI Pilot knows a command has finished
- Interactive programs and long commands
- What AI Pilot knows about the system
- Questions from AI Pilot
- Answers, reasoning and code
- Attach files
- Explain a selection or fix an error
- Stop, start over and continue later
- Model and Autopilot per chat
- sudo and passwords
In a terminal tab, AI Pilot works in the shell you have open on an SSH server. You give it a task, it runs commands in your terminal, reads their output and reports back. This page walks through a session, from opening the panel to continuing the conversation another day.
Open AI Pilot
- Press ⌘JCtrlJ.
- Or click the AI Pilot button in the narrow bar on the right edge of the window.
- Or open the command palette with ⌘PCtrlP and choose the action AI Pilot.
- On macOS, the menu View → Toggle AI Pilot works too.
The panel opens on the right side of the tab. It shares this place with the Files panel (⌘BCtrlB), so only one of the two is visible at a time. Drag the panel's left edge to make it wider or narrower.
Each tab has its own chat; AI Pilot in one tab doesn't see what happens in another. If the tab is split into panes, the panel belongs to the active pane, and each pane has its own chat.
Start a conversation
An empty chat shows How can I help?, a line that tells you whether you confirm each command, and four suggestions:
- What is running on this server? Give me an overview.
- How are disk and memory usage?
- Show the latest errors in the system logs.
- Which services are active and which ports are open?
Click a suggestion to send it. Suggestions need an active connection; while the tab is disconnected, the panel says The assistant needs an active connection.
To write your own task, type into Enter a task or question… and press Enter. ShiftEnter starts a new line. Describe the goal and what AI Pilot can't know on its own: which service, which directory, what must stay untouched. AI Pilot replies in the language you write in.
Follow along
AI Pilot works in steps. For each step it picks a tool – run a command, read the screen, read a file – and the step appears in the chat as a card. Commands are typed into your terminal, so you see them and their output live. Without Autopilot, each command first waits for you to click Run; see Approvals and safety.
While AI Pilot works, the input area says The assistant is working…. A finished task ends with a short summary.
Status of a step
| Status | Meaning |
|---|---|
| Awaiting approval | The step waits for you to click Run or Deny. |
| Awaiting answer | AI Pilot asked you a question. |
| running | The step is in progress. |
| exit 0, exit 1 … | The command finished. The number is its exit code, reported by shell integration. |
| done | The step finished: a command without a known exit code, or a file operation. |
| 12 matches | The number of results of a file search. |
| still running | The command showed no new output and no prompt for about 4 seconds. It is still working or waits for input. |
| timeout | The command kept going beyond its time limit: 60 seconds, unless AI Pilot set another limit (up to 10 minutes). It may still be running. |
| blocked | The command couldn't start, for example because another command is still running. |
| denied | You denied the step, or the connection's command lists refused it. |
| error | The step failed, for example because a file doesn't exist. |
Finished commands also show how long they took. Click a card to expand it: you see the output and, for commands, how the end was detected – shell integration or heuristic.
How AI Pilot knows a command has finished
With shell integration, your shell reports the end of every command and its exit code. Without it, AI Pilot waits until the output has been quiet for a moment and the cursor sits on a line that looks like your prompt. That works for common prompts, including oh-my-zsh, powerlevel10k and Starship, but it can't report exit codes.
The plug icon in the panel's header turns green when shell integration is active. Click it to see how to set it up, or to switch it on for the current session.
Interactive programs and long commands
Some commands keep running or wait for input: a long installation, a [y/N] question, a pager, a full-screen program. When a command reports still running or timeout, AI Pilot reads the visible screen to see what's happening. It can then send text and keys to the program – for example y and Enter, Ctrl-C, Escape, Tab or the arrow keys. Sending keys needs your approval like a command, unless Autopilot is on.
AI Pilot prefers non-interactive options such as -y or --no-pager, so this happens rarely. Reading the screen also lets it pick up what you did in the terminal yourself.
What AI Pilot knows about the system
Right after an SSH connection is established, kaiport runs a short check on a separate channel. Nothing appears in your terminal. It collects:
- kernel, operating system and distribution,
- host name, user and groups, login shell,
- whether
sudoworks without a password, needs one or isn't installed, - the package managers present (
apt-get,dnf,yum,pacman,zypper,apk,brew,nix-env,pkg), - common tools such as
systemctl,docker,podman,kubectl,git,python3,node,nginx, Apache, Caddy,mysql,psql,redis-cliandtmux, - the number of CPUs, memory, usage of the root file system and uptime.
AI Pilot gets this summary with every request, so it doesn't have to run these checks in your terminal.
Questions from AI Pilot
When a decision is yours – which of several services, which site, which version – AI Pilot asks. The question appears as a card with Awaiting answer, up to five suggested answers as buttons and a field Your own answer…. Click one of the suggestions, or type your own answer and send it with Enter.
AI Pilot continues with your answer. If you click Stop instead, the question counts as unanswered.
Answers, reasoning and code
AI Pilot writes its answers in Markdown, with headings, lists, tables and code. If the model shares its reasoning, it appears as a collapsed Reasoning block; click it to read along.
Code blocks have a Copy button. Shell code blocks also have Insert into terminal: it types the code at your prompt without pressing Enter, so you can check it before you run it.
Attach files
You can give AI Pilot documents to work with, such as a log, a configuration file, a spreadsheet or a PDF manual.
- Click the paperclip (Attach a file) in the input area, or
- drag files onto the input area; it shows Drop files here to attach them.
| Supported | Files |
|---|---|
| Text | .txt, .md, .csv, .tsv, .json, .yaml, .yml, .log and many configuration and source code formats, also files without an extension |
| Documents | PDF, Word (.docx and the older .doc), RTF |
| Spreadsheets | .xls, .xlsx, .xlsm, .ods |
A file can be up to 25 MB. kaiport extracts the text – each spreadsheet sheet becomes a CSV table – and sends it with your message; the original file isn't sent. Extracted text longer than 120,000 characters is cut off, and the attachment shows truncated. For old .doc files, kaiport can only recover plain text, so the extraction may be incomplete.
Attachments appear as chips above the input field. Remove one with its × before you send.
Explain a selection or fix an error
Select text in the terminal and right-click it. Besides Copy, the menu offers:
- Explain selection (AI) – asks AI Pilot to explain the selected output.
- Fix this error (AI) – asks AI Pilot to find the cause of the selected error and fix it.
Both open the AI Pilot panel with a prepared message that contains the selection. Nothing is sent yet: add details if you like, then press Enter.
The Files panel works the same way: Ask the AI about this file in a file's row prepares a request to look at the file and explain what it does.
Stop, start over and continue later
- Stop – while AI Pilot works, the send button turns into a stop button. It ends the request; steps that wait for approval and open questions count as denied. A command that already runs in the terminal keeps running: press ⌃CCtrlC in the terminal to cancel it.
- New chat – the trash icon in the panel's header clears the conversation and its token counters. The model and Autopilot setting of the tab stay.
- Continue later – kaiport saves the conversation after each request, per connection. When you open the same connection again, even after restarting kaiport, the panel shows the last conversation and AI Pilot continues with it. kaiport keeps the latest conversation of up to 30 connections, each with up to 120 messages. New chat also deletes the saved conversation of that connection.
Model and Autopilot per chat
The toolbar below the panel's header has three controls:
- Model picker – switches the model for this tab's chat. It offers the models loaded in the settings, see Set up AI Pilot.
- Context & tokens – a ring that shows how full the model's context window is, see Context, tokens and privacy.
- Autopilot – when it's on, commands run without asking; dangerous commands still ask. New tabs start with the default from the settings. If you switch Autopilot on while a step waits for approval, that step runs, unless it is dangerous.
sudo and passwords
AI Pilot never asks for a password in the chat. When a command such as sudo wants one, AI Pilot tells you to type it into the terminal:
- Click into the terminal.
- Type the password and press Enter.
- AI Pilot reads the screen and continues. If it has already finished its turn, tell it in the chat that you entered the password.
Thanks to the check at session start, AI Pilot usually knows in advance whether sudo needs a password on this system.