AI Pilot tools reference
Every tool AI Pilot can use in terminal and storage tabs, with parameters, limits and approval rules, plus command-end detection, timeouts and output limits.
AI Pilot acts through a fixed set of tools. The model decides which tool to call; kaiport carries it out, applies the approval rules and hands the result back to the model. This page lists every tool with its parameters and limits. The tool names also appear in the audit log file ai-audit.jsonl.
Overview
Terminal tabs are SSH connections; storage tabs are FTP, S3, WebDAV and Azure connections in the transfer view.
| Tool | Purpose | Terminal tabs | Storage tabs | Without Autopilot | With Autopilot |
|---|---|---|---|---|---|
run_command | Run a command in the terminal | yes | – | asks | runs; dangerous commands ask |
send_input | Send text or keys to the terminal | yes | – | asks | runs |
read_screen | Read the visible terminal screen | yes | – | runs | runs |
read_file | Read a text file | yes | yes | runs | runs |
write_file | Create or replace a text file | yes | yes | asks | terminal tabs: runs; storage tabs: runs, replacing asks |
list_dir | List a folder | yes | yes | runs | runs |
find_files | Find files by name, size and age | yes | yes | runs | runs |
search_files | Search file contents | yes | yes | runs | runs |
folder_report | Statistics of a folder tree | yes | yes | runs | runs |
ask_user | Ask you a question | yes | yes | waits for your answer | waits for your answer |
make_dir | Create a folder | – | yes | asks | runs |
rename | Rename or move | – | yes | asks | runs; onto an existing name asks |
delete | Delete a file or folder | – | yes | asks | asks |
upload | Copy a file from your computer to the storage | – | yes | asks | runs; replacing asks |
download | Copy a file from the storage to your computer | – | yes | asks | runs; replacing asks |
execute_plan | Carry out a list of changes after one approval | – | yes | asks | asks |
The connection's Denied commands (AI) and Allowed commands (AI) apply to run_command. read_file and search_files need Send file contents to the AI. See Approvals and safety for the rules in detail.
Terminal tools
run_command
Types a command line into the interactive terminal – the one you see – presses Enter and waits until the shell shows its prompt again.
| Parameter | Meaning |
|---|---|
command | The exact command line. |
timeout_seconds | How long to wait while the command keeps producing output: 60 seconds by default, 5 to 600 seconds. |
The result contains the status, the output, the exit code (with shell integration), the duration and the detection method.
| Status | Meaning |
|---|---|
completed | The prompt is back; the command has finished. |
running | No new output and no prompt for about 4 seconds. The command is still working or waits for input; AI Pilot checks with read_screen and answers with send_input. |
timeout | The command kept producing output beyond the time limit. It may still be running. |
blocked | The command couldn't start: another command is still running, the previous one still produces output, or the session is closed. |
Before a command runs, kaiport checks it against the connection's denied and allowed commands and against the list of dangerous commands.
send_input
Sends text and/or a special key to the terminal without waiting for a prompt – to answer a question, quit a program or move around in a full-screen program. Returns the screen afterwards.
| Parameter | Meaning |
|---|---|
text | Text to type. No line break is added. |
key | A key pressed after the text: enter, ctrl-c, ctrl-d, ctrl-z, ctrl-l, escape, tab, up, down, left, right, backspace or space. |
wait_seconds | How long to wait before reading the screen: 0.6 seconds by default, 0.1 to 30 seconds. |
read_screen
Returns the text currently visible in the terminal – to follow a long-running command, an interactive program or something you did in the terminal yourself. The optional wait_seconds (0 to 120) waits before reading.
File tools
In terminal tabs, the file tools work over SFTP on the connected system. In storage tabs, they have an extra parameter side: remote for the storage (the default) or local for your computer. Paths are absolute; remote paths start with /.
read_file
Reads a text file (path). Needs Send file contents to the AI. Binary files are refused, and files over 2 MB can't be read. The content handed to the model is capped at Limit per file (KB); a longer file keeps its beginning and its end.
write_file
Creates a file or replaces it completely (path, content). AI Pilot is instructed to read a file before it changes it and to tell you what it changed. In storage tabs, replacing an existing file always needs your approval.
list_dir
Lists a folder (path) with name, type, size, modification date and permissions of each entry. Up to 500 entries are returned.
find_files
Finds files and folders below a folder by metadata only, without reading contents.
| Parameter | Meaning |
|---|---|
path | Folder to start from. |
glob | Name pattern such as *.log, IMG_????.jpg or *.{jpg,png}; upper and lower case don't matter. |
type | file, dir or any (the default). |
min_size, max_size | Size in bytes. |
older_than_days, newer_than_days | Time since the last modification. |
max_depth | Folder levels to descend: 6 by default, at most 12. |
limit | Maximum number of results: 200 by default, at most 1,000. |
search_files
Searches the text files below a folder and returns the matching lines with path and line number – never whole files. Needs Send file contents to the AI.
| Parameter | Meaning |
|---|---|
path | Folder to search. |
pattern | The text to look for, or a regular expression with regex. |
regex | Treat pattern as a regular expression; off by default. |
case_sensitive | Tell upper and lower case apart; off by default. |
glob | Only files whose name matches, such as *.conf. |
max_files | Maximum number of files to read: 200 by default, at most 500. |
The search goes up to 6 folder levels deep. At most 100 matching lines are returned, each cut to 200 characters. Binary files and files larger than Limit per file (KB) are skipped. The result lists every file that was read; the card shows the list under Files read.
folder_report
Statistics of a folder tree (path, optional max_depth: 6 by default, at most 12) from metadata only: the number of files and folders and the total size, sizes by file type and extension, the age distribution, the 10 largest files, the 5 oldest and the 5 newest, up to 20 possible duplicates (same name and size), up to 20 empty folders and up to 20 cleanup candidates – temporary files, logs older than 30 days, backups older than 90 days and files over 10 MB unchanged for more than a year.
Storage tools
These tools only exist in storage tabs.
make_dir
Creates a folder (path, side), including missing parent folders where the storage supports that.
rename
Renames or moves a file or folder within the same side (from, to, side). Moving onto an existing name always asks.
delete
Deletes a file or folder (path, side). A folder with contents is only deleted with recursive set to true, which removes everything inside. Always asks.
upload and download
upload copies a file from your computer (local_path) into a folder of the storage (remote_dir). download copies a file from the storage (remote_path) into a folder on your computer (local_dir). Both handle single files, not folders. Replacing an existing file always asks. The transfers appear in the transfer view's Transfers list.
execute_plan
Carries out a list of operations after one approval.
| Parameter | Meaning |
|---|---|
summary | One sentence that describes the plan, shown on the card. |
operations | The steps in order. Each has an op – make_dir, rename (or move), delete, write_file, upload or download – and the parameters of the matching tool. |
A plan holds up to 200 operations. Operations with missing fields or an unknown op are left out, and AI Pilot is told which. The steps run in order; the first failure stops the plan, and the remaining steps are reported as skipped. A plan always needs your approval. It is marked dangerous when it deletes something or would replace an existing file.
ask_user
Asks you a question (question) with up to five suggested answers (options). You can always type your own answer instead. kaiport never answers a question automatically, not even in Autopilot. If you stop the request instead of answering, AI Pilot is told that you didn't answer.
Command-end detection
To know when a command has finished, kaiport keeps a model of the terminal screen in the background and uses one of two methods. The expanded card shows which one under Detection:
- shell integration – with kaiport's shell integration (OSC 133), the shell reports the end of every command with its exit code. This is exact.
- heuristic – without it, kaiport treats a command as finished when the output has been quiet for about half a second and the cursor line looks like a prompt – it matches the prompt kaiport saw when the session started, ends in a prompt character such as
$,#,%,>or❯or a Powerline separator, or follows auser@hostpattern. There is no exit code; when AI Pilot needs one, it can append; echo "exit=$?"to the command.
Timeouts
| What | Limit |
|---|---|
A command (run_command) | 60 seconds by default; AI Pilot can set 5 to 600 seconds per command |
Reported as running | after about 4 seconds without new output and without a prompt |
| Waiting before the screen is read | send_input: 0.6 seconds by default (0.1 to 30); read_screen: 0 to 120 seconds |
| A response from the model | ends with an error after 120 seconds without any data |
| Load models | 20 seconds |
| Test connection | 60 seconds |
| System check at session start | 12 seconds; a request waits up to 4 seconds for its result |
Output limits
| What | Limit |
|---|---|
Command output (run_command) | 12,000 characters; longer output keeps the first 60% and the last 40%, with a note on how much was cut |
| Very long command output | also limited by the terminal's scrollback (2,000 to 20,000 lines, from Settings → Terminal → Scrollback); AI Pilot is told when the beginning was lost |
Screen (send_input, read_screen) | 8,000 characters |
File content (read_file) | Limit per file (KB), 64 KB by default; files over 2 MB can't be read |
Folder listing (list_dir) | 500 entries |
Folder walks (find_files, search_files, folder_report) | 5,000 entries; 6 folder levels (up to 12 for find_files and folder_report) |
Content search (search_files) | 100 matching lines, 200 files by default (at most 500), 200 characters per line |
Plan (execute_plan) | 200 operations |
Question (ask_user) | 5 suggested answers |
| Attachments | 25 MB per file, 120,000 characters of extracted text |
| Conversation | the 80 most recent messages; older ones are summarized or dropped, see Long conversations |