Pular para o conteúdo principal

Input routing

Parolsh never guesses whether a line is English or a shell command. The first character decides, always:

InputRoute
textThe active ACP agent
/commandThe active ACP agent, unchanged
!commandThe configured shell, default bash -ic
!bashAn interactive Bash session
#commandParolsh itself

find files modified today is always a question for the agent. To run the Unix find, type !find . -mtime -1.

!command​

The command runs as bash -ic "<command>" in Parolsh's current directory.

  • Your ~/.bashrc is loaded, so aliases, functions and shell options work as in your normal terminal. The shell is interactive (-i) because a plain bash -c ignores aliases, and the stock Debian/Ubuntu ~/.bashrc stops right away when the shell is not interactive.
  • Each command is independent. !cd /tmp or !export FOO=1 change nothing in Parolsh: the command runs and returns. Use #cd to change directory, or !bash for a session that keeps its state.
  • Commands stay out of your bash history. Parolsh sets HISTFILE=/dev/null for them and keeps its own history.
  • A non-zero exit code is printed after the output, for example exit 1.
  • Ctrl+C stops the running command, not Parolsh.
  • Parolsh has no job control. With the default bash -ic, Ctrl+Z is handled by that bash, as if you had typed the line in bash: the running program is paused (Stopped), the rest of the line continues, and the paused program ends when the command finishes. With a non-interactive shell such as ["bash", "-c"], Parolsh resumes the command right away. Use !bash when you need job control.

Loading ~/.bashrc costs a little time on every command (about 0.17 s on a typical Ubuntu setup). Anything ~/.bashrc or /etc/bash.bashrc prints also shows up in the output.

The shell is configurable, see Configuration:

shell = ["zsh", "-ic"]

!bash​

Opens a real interactive Bash in the current directory, with your full ~/.bashrc and completions. exit returns to Parolsh, in the directory it was in before: changes made inside the session stay there.

Text​

Anything that does not start with !, # or / is a question for the agent. The answer is printed as it arrives, with a status line showing what the agent is doing (see During a turn). Ctrl+C cancels the turn.

/command​

Lines starting with / belong to the agent. Parolsh reserves no / commands and forwards the line as typed, so the agent's own slash commands work.

#command​

CommandWhat it does
#helpShow the input rules and commands
#newStart a new conversation with the agent, in the current directory
#cd <path>Change Parolsh's directory and start a new conversation there. ~ and relative paths work; no path means your home directory. Reloads the configuration of the project found there. An agent chosen with #agent stays when that project configures it; otherwise the project's default_agent is used, and the agent restarts if it changed.
#agentShow the agent in use
#agent listList configured agents; * marks the one in use
#agent <name>Switch to another configured agent, with a new conversation. default_agent does not change.
#promptShow the prompt style in use
#prompt <name>Switch the prompt: parolsh, starship or minimal, until you leave Parolsh
#projectShow the project root
#project initCreate .parolsh/ in the current directory
#exitLeave Parolsh (Ctrl+D also works)