Skip to content
kaiport

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.

ToolPurposeTerminal tabsStorage tabsWithout AutopilotWith Autopilot
run_commandRun a command in the terminalyes–asksruns; dangerous commands ask
send_inputSend text or keys to the terminalyes–asksruns
read_screenRead the visible terminal screenyes–runsruns
read_fileRead a text fileyesyesrunsruns
write_fileCreate or replace a text fileyesyesasksterminal tabs: runs; storage tabs: runs, replacing asks
list_dirList a folderyesyesrunsruns
find_filesFind files by name, size and ageyesyesrunsruns
search_filesSearch file contentsyesyesrunsruns
folder_reportStatistics of a folder treeyesyesrunsruns
ask_userAsk you a questionyesyeswaits for your answerwaits for your answer
make_dirCreate a folder–yesasksruns
renameRename or move–yesasksruns; onto an existing name asks
deleteDelete a file or folder–yesasksasks
uploadCopy a file from your computer to the storage–yesasksruns; replacing asks
downloadCopy a file from the storage to your computer–yesasksruns; replacing asks
execute_planCarry out a list of changes after one approval–yesasksasks

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.

ParameterMeaning
commandThe exact command line.
timeout_secondsHow 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.

StatusMeaning
completedThe prompt is back; the command has finished.
runningNo 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.
timeoutThe command kept producing output beyond the time limit. It may still be running.
blockedThe 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.

ParameterMeaning
textText to type. No line break is added.
keyA key pressed after the text: enter, ctrl-c, ctrl-d, ctrl-z, ctrl-l, escape, tab, up, down, left, right, backspace or space.
wait_secondsHow 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.

ParameterMeaning
pathFolder to start from.
globName pattern such as *.log, IMG_????.jpg or *.{jpg,png}; upper and lower case don't matter.
typefile, dir or any (the default).
min_size, max_sizeSize in bytes.
older_than_days, newer_than_daysTime since the last modification.
max_depthFolder levels to descend: 6 by default, at most 12.
limitMaximum 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.

ParameterMeaning
pathFolder to search.
patternThe text to look for, or a regular expression with regex.
regexTreat pattern as a regular expression; off by default.
case_sensitiveTell upper and lower case apart; off by default.
globOnly files whose name matches, such as *.conf.
max_filesMaximum 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.

ParameterMeaning
summaryOne sentence that describes the plan, shown on the card.
operationsThe 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 a user@host pattern. There is no exit code; when AI Pilot needs one, it can append ; echo "exit=$?" to the command.

Timeouts

WhatLimit
A command (run_command)60 seconds by default; AI Pilot can set 5 to 600 seconds per command
Reported as runningafter about 4 seconds without new output and without a prompt
Waiting before the screen is readsend_input: 0.6 seconds by default (0.1 to 30); read_screen: 0 to 120 seconds
A response from the modelends with an error after 120 seconds without any data
Load models20 seconds
Test connection60 seconds
System check at session start12 seconds; a request waits up to 4 seconds for its result

Output limits

WhatLimit
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 outputalso 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
Attachments25 MB per file, 120,000 characters of extracted text
Conversationthe 80 most recent messages; older ones are summarized or dropped, see Long conversations