Introduction
Insh is a graphical, interactive, terminal environment.
Install
To install the latest version of insh and inshd run:
cargo install --locked --git https://github.com/AustinScola/insh --tag latest insh inshd
Usage
By default, Insh starts out in a file browser.
Universal Commands
Some commands work from all components:
| Command | Description |
|---|---|
<Ctrl>-x | Exit Insh. |
r | Refresh. |
Input Bar Commands
Several components use the input bar which has the following commands:
| Command | Description |
|---|---|
<Ctrl>-q | Exit the input bar. |
| Any character | Append the character to the current input. |
<Enter> | Search for files matching the input. |
<Backspace> | Remove the last character from the input. |
<Tab> | Fill in the input with the suggestion. |
Directory Bar Commands
Several components use the directory bar. From these components Ctrl-d focuses on the directory
bar. The directory bar has the following commands:
| Command | Description |
|---|---|
<Ctrl>-q | Exit the directory bar. |
| Any character | Append the character to the current input. |
<Backspace> | Remove the last character from the input. |
<Ctrl>-w | Remove the last part from the input. |
<Tab> | Fill in the input with the suggestion. |
<Enter> | Use the directory and return focus |
Multiplexing
Insh has terminal multplexing inspired heavily by tmux. The session, window, and pane concepts are all borrowed. As is the usage of a prefix.
Normal Mode
| Command | Status bar command | Description |
|---|---|---|
<Ctrl>-b % | split-vertically [component] [args]… | Split the current pane vertically. |
<Ctrl>-b " | split-horizontally [component] [args]… | Split the current pane horizontally. |
<Ctrl>-b + | split-quad [component] [args]… | Split the current pane horizontally and then vertically. |
<Ctrl>-b c | new-window [name] | Create a new window. |
| new-session [name] | Create a new session. | |
<Ctrl>-b x | kill-pane [name] | Kill a pane (default current). |
| kill-window [name] | Kill a window (default current). | |
| kill-session [name] | Kill a session (default current). | |
<Ctrl>-b j | <Ctrl>-b <Down> | focus-down | Select the pane below the current pane. |
<Ctrl>-b k | <Ctrl>-b <Up> | focus-up | Select the pane above the current pane. |
<Ctrl>-b h | <Ctrl>-b <Left> | focus-left | Select the pane to the left of the current pane. |
<Ctrl>-b l | <Ctrl>-b <Right> | focus-right | Select the pane to the right of the current pane. |
<Ctrl>-b <Ctrl>-<Down> | resize-pane-down | Resize the pane downwards. |
<Ctrl>-b <Ctrl>-<Up> | resize-pane-up | Resize the pane upwards. |
<Ctrl>-b <Ctrl>-<Left> | resize-pane-left | Resize the pane left. |
<Ctrl>-b <Ctrl>-<Right> | resize-pane-right | Resize the pane right. |
<Ctrl>-b y | synchronize-panes | Synchronize panes. |
<Ctrl>-b z | toggle-zoom | Toggle zooming the current pane. |
<Ctrl>-b { | switch-pane-previous | Switch the current pane with the previous pane. |
<Ctrl>-b } | switch-pane-next | Switch the current pane with the next pane. |
<Ctrl>-b } | swap-pane | Swap two panes. |
| rename-pane | Rename the current pane. | |
<Ctrl>-b , | rename-window | Rename the current window. |
<Ctrl>-b $ | rename-session | Rename the current session. |
| set-dir [–window | -w | –session | -s] <dir> | Set the default starting directory for a window/session (default window). | |
| change-dir [–window | -w | –session | -s] <dir> | Change the directory for a window/session (default window). | |
| dir [–window | -w | –session | -s] <dir> | A combination of set-dir and change-dir. | |
<Ctrl>-b [ | change-mode copy | Enter copy mode |
<Ctrl>-b s | list-sessions | ls | View the session, window, and pane switcher. |
<Ctrl>-b : | change-mode prompt | Prompt for a command. |
| send-keys | Send keys to a pane. | |
| detach | Detach from the current session. |
Copy Mode
| Command | Description |
|---|---|
h | <Left> | Move the cursor left. |
j | <Down> | Move the cursor down. |
k | <Up> | Move the cursor up. |
l | <Right> | Move the cursor right. |
w | Move the cursor to the next word. |
W | Move the cursor to the next WORD. |
b | Move the cursor to the beginning of the word. |
B | Move the cursor to the beginning of the WORD. |
e | Move the cursor to the end of the word. |
E | Move the cursor to the end of the WORD. |
0 | <Home> | Move the cursor to the start of the line. |
$ | <End> | Move the cursor to the end of the line. |
gg | Move the cursor to the start of the buffer. |
G | Move the cursor to the end of the buffer. |
v | <Space> | Start selecting at the current cursor position. |
y | <Enter> | Copy the selection to the clipboard. |
<Escape> | Unselect. |
/ | Search. |
? | Search backwards. |
q | Exit out of copy mode. |
Search Mode
| Command | Description |
|---|---|
n | Go to the next hit. |
p | Go to the previous hit. |
Browser
The file browser shows the current directory at the top, and lists the entries of the directory below. The currently selected entry is highlighted in yellow when focused.
| Command | Description |
|---|---|
j | <Down> | Move the selection down by one entry. |
k | <Up> | Move the selection up by one entry. |
J | <End> | Move the selection to the last entry. |
K | <Home> | Move the selection to the first entry. |
l | <Enter> | If the currently selected entry is a file, then open it in the editor. Else, if the currently selected entry is a directory, then change the current directory to the selected directory. |
v | If the currently selected entry is a file, then open it in vim. |
h | <Backspace> | Change directories to the parent of the current directory (if the current directory is not the root directory). |
<Ctrl>-e | Scroll down without changing the selection. |
<Ctrl>-y | Scroll up without changing the selection. |
b | Run bash with the working directory set to the current directory. |
e | Open the file editor prompt. |
c | Open the file creator for creating a file. |
C | Open the file creator for creating a directory. |
f | Open the file finder. |
s | Open the file contents searcher. |
R | Open find and replace. |
a | Open the the ai chat. |
m | Toggle showing the metadata of the entries. |
yE | Yank the selected entry filename to the clipboard. |
yy | Yank the selected entry file path to the clipboard. |
Y | Yank the selected entry file contents to the clipboard. |
File Creator
The file creator can be used to create a file in a directory.
The file creator shows the directory at the top, then an input bar, then any error from attempting to create a new file.
Editor
The editor is a modal editor heavily inspired by vim.
Modes
| Mode | Description |
|---|---|
| Normal | Navigate. |
| Command | Use commands. |
| Insert | Insert text. |
| Visual | Visually select characters. |
| Visual Line | Visually select lines. |
| Visual Block | Visually select blocks. |
| Search | Search for text. |
Common
| Command | Description |
|---|---|
<Ctrl>-e | Scroll down. |
<Ctrl>-y | Scroll up. |
Normal Mode
| Command | Description |
|---|---|
[modifier]<Movement> | Move the cursor. |
: | Enter command mode. |
i | Enter insert mode. |
a | Insert after the cursor. |
A | Insert at the end of the line. |
o | Open a line after the cursor and enter insert mode. |
O | Open a line before the cursor and enter insert mode. |
v | Enter visual mode. |
V | Enter visual line mode. |
<Ctrl>-v | Enter visual block mode. |
| Insert a space. |
y<movement> | Yank. |
yy | Yank the line. |
p | Paste after. |
P | Paste before. |
x | Delete a character. |
d<movement> | Delete the movement. |
dd | Delete the line. |
r | Replace a character. |
u | Undo. |
<Ctrl>-r | Redo. |
/ | Enter search mode. |
n | Go to next search hit. |
N | Go to previous search hit. |
Command Mode
| Command | Description |
|---|---|
<Esc> | Cancel the command and enter normal mode. |
<Printable> | Add the printable character to the command. |
<Enter> | Run the command and enter normal mode. |
<Backspace> | Backspace. |
Commands
| Command | Description |
|---|---|
w | Write the file. |
q | Quit (refuse if there are unwritten changes). |
q! | Quit (even if there are unwritten changes). |
wq | Write and quit. |
vim | Open the file in vim (refuse if there are unwritten changes). |
vim! | Open the file in vim (even if there are unwritten changes). |
Insert Mode
| Command | Description |
|---|---|
<Esc> | Enter normal mode. |
<Printable> | Insert the printable character. |
<Tab> | Enter 4 spaces. |
<Enter> | Enter a newline character. |
<Backspace> | Backspace. |
<Paste> | Insert the clipboard. |
Common Visual
Visual modes share many of the same commands.
| Command | Description |
|---|---|
<Esc> | Enter normal mode. |
[modifier]<Movement> | Move the cursor. |
y | Yank. |
Y | Yank to clipboard. |
x | d | Delete the selection. |
u | Lowercase the selection. |
U | Uppercase the selection. |
r | Replace the selection. |
p | Replace the selection with the paste buffer. |
Visual Mode
| Command | Description |
|---|---|
V | Enter visual line mode. |
<Ctrl>-v | Enter visual block mode. |
Visual Line Mode
| Command | Description |
|---|---|
v | Enter visual mode. |
<Ctrl>-v | Enter visual block mode. |
Visual Block Mode
| Command | Description |
|---|---|
v | Enter visual mode. |
V | Enter visual line mode. |
Search Mode
| Command | Description |
|---|---|
<Esc> | Cancel the search and enter normal mode. |
<Enter> | Go to the next hit. |
<Printable> | Add the printable character to the search. |
<Backspace> | Backspace. |
Modifiers
| Modifier | Description |
|---|---|
<Num> | Perform the action the specified number of times. |
Movements
| Movement | Description |
|---|---|
h | Left. |
j | Down. |
k | Up. |
l | Right. |
w | Start of next word. |
W | Start of next WORD. |
b | Start of previous word. |
B | Start of previous WORD. |
e | End of current/next word. |
E | End of current/next WORD. |
0 | Beginning of line. |
$ | End of line. |
J | G | End of file or line number if a number modifier is used. |
K | gg | Beginning of file. |
Finder
The file finder shows the directory at the top, then an input bar, then the found files. The finder starts out with the input bar focused. The input can be any valid regular expression.
The finder finds files in the current directory (recursively) for which the regex pattern matches the file name.
Found Files Commands
| Command | Description |
|---|---|
<Ctrl>-q | Return focus to the input bar. |
j | <Down> | Move the selection down by one hit. |
k | <Up> | Move the selection up by one hit. |
J | <End> | Move the selection to the last hit. |
K | <Home> | Move the selection to the first hit. |
l | <Enter> | Open the hit in the editor. |
v | Open the hit in vim. |
<Ctrl>-e | Scroll down without changing the selection. |
<Ctrl>-y | Scroll up without changing the selection. |
g | Go to the hit in the file browser. |
G | Go to the hit in the file browser and select it. |
yE | Yank the hit filename to the clipboard. |
yy | Yank the hit file path to the clipboard. |
Y | Yank the hit file contents to the clipboard. |
Searcher
The file contents searcher searches all files in the current directory recursively for a given input string.
The searcher displays the directory at the top, then an input bar, and then the hits. For each hit, the file name is displayed, then a line for each occurrence of the string with the line number.
The commands for the input bar are the same as those for the Finder.
Searcher Contents Commands
| Command | Description |
|---|---|
<Ctrl>-q | Return focus to the input bar. |
f | Add a file filter. |
j | <Down> | Move the selection down. |
k | <Up> | Move the selection up. |
J | <End> | Move the selection to the last file hit. |
K | <Home> | Move the selection to the first file hit. |
<Ctrl>-e | Scroll down without changing the selection. |
<Ctrl>-y | Scroll up without changing the selection. |
l | <Enter> | Open the hit in the editor. If the file path of a hit is selected, then open the editor at the start of the file. Else, if an occurrence of the string is selected, then open the editor at the line of the occurrence. |
v | Open the hit in vim. If the file path of a hit is selected, then open vim at the start of the file. Else, if an occurrence of the string is selected, then open vim at the line of the occurrence. |
g | Go to the hit in the file browser. |
G | Go to the hit in the file browser and select it. |
yE | Yank the hit to the end. If the file path of a hit is selected, yank the relative file path. Else, if an occurrence of the string is selected, yank that line. |
yy | Yank the hit line. If the file path of a hit is selected, yank the full file path. Else, if an occurrence of the string is selected, yank that line. |
Y | Yank the hit file contents to the clipboard. |
Find and Replace
The find and replace component can be used to find and replace text.
Commands
| Command | Description |
|---|---|
y | Replace the next occurance. |
n | Do not replace the next occurance. |
Y | Replace all occurances. |
N | Do not replace any occurances. |
Inshie
Inshie is an AI chatbot and coding harness.
| Command | Description |
|---|---|
<Ctrl>-q | Exit Inshie. |
| Any character | Append the character to the current input. |
<Ctrl>-o | Append a newline to the current input. |
<Backspace> | Remove the last character from the input. |
<Enter> | Send the prompt to Inshie. |
<Ctrl>-e | Scroll down. |
<Ctrl>-y | Scroll up. |
<Ctrl>-n | Start a new conversation. |
<Ctrl>-h | Open the Inshie conversation history. |
Inshie Commands
Inshie has / commands that can be used from a chat.
| Command | Description |
|---|---|
/usage | Print usage statistics. |
/effort high | medium | low | Set the reasoning effort level. |
Inshie Conversation History
View and manage the conversation history for Inshie.
| Command | Description |
|---|---|
<Ctrl>-q | Exit the Inshie conversation history and go back to Inshie. |
j | <Down> | Move the selection down by one entry. |
k | <Up> | Move the selection up by one entry. |
J | <End> | Move the selection to the last entry. |
K | <Home> | Move the selection to the first entry. |
l | <Enter> | Open the selected chat. |
<Ctrl>-e | Scroll down. |
<Ctrl>-y | Scroll up. |
n | Start a new chat. |
r | Rename a chat. |
/ | Search past chats. |
dd | Delete the selected chat. |
Inshie Conversation History Searcher
Searches past chats.
Configuration
Insh Configuration
Insh can be configured by the file ~/.insh/config.yaml.
general.tab_width (usize): The width of the <Tab> character (default=4).
general.bell (bool): Whether or not the bell sound should be made (default=true).
multiplexing.enabled (bool): Whether or not multiplexing should be enabled (default=true).
browser.sort (map|null): How files are sorted alphabetically. If null, then files are not sorted (default={}).
browser.sort.case_insensitive (bool): Whether or not the filename case is ignored when sorting files (default=true).
browser.sort.hidden (first|last|mixed): How hidden files (files with a leading .) are sorted. If mixed, then the leading . is ignored when sorting files (default=last).
browser.metadata (bool): Whether or not to show metadata (default=false).
render.engine (full|incr): The rendering engine to use (default=incr).
Inshd Configuration
Inshd can be configured by the file ~/.insh/inshd-config.yaml.
server.request_handlers.num (usize): The number of request handlers (default=8).
database.pool.size (usize): The size of the database pool (default=8).
multiplexing.commands.history.length (usize): The number of multiplexing command to store (default=1000).
multiplexing.pane.buffer_size (usize): The buffer size of a pane (default=20000).
browser.history.length (usize): The number of visited directories to store (default=1000).
finder.history.length (usize): The number of file finds to store (default=1000).
searcher.history.length (usize): The number of searches to store (default=1000).
ai.base_url (str|null): The base URL for the AI inference engine (default=null).
ai.api_type (anthropic|openai): The AI inference engine type (default=anthropic).
ai.api_key (str|null): The AI inference engine API key (default=null).
ai.model (str): The AI model (default=claude-opus-5).
ai.instructions.override (str|null): Used to override the AI instructions (default=null).
ai.instructions.additional (str|null): Additional AI instructions (default=null).
ai.search.threshold (float): The maximum cosine distance for semantic search to be considered a hit; lower is stricter (default=0.7).
ai.tools.web.provider (exa): The web provider (default=exa).
ai.tools.web.api_key (str): The web provider API key.
ai.tools.web.base_url (str|null): Used to override the web provider’s base URL (default=null).
ai.tools.web.search.num_results (usize): The number of pages a web search returns (default=5).
ai.tools.web.search.highlight_characters (usize): The maximum number of characters of relevant passages returned per page by a web search (default=1000).
ai.tools.web.fetch.max_characters (usize): The maximum number of characters of a page returned by a web fetch (default=20000).