psh turns a natural-language shell task into one shell command, shows it for review, and asks before running it.
psh run clean up docker
psh clean up docker
printf %s "clean up docker" | psh runInstall with curl:
curl -fsSL https://raw.githubusercontent.com/modoterra/promptshell/main/bin/psh.sh | sh -s -- installThe -s flag tells sh to read the downloaded script from stdin and pass install to psh.
Or with wget:
wget -qO- https://raw.githubusercontent.com/modoterra/promptshell/main/bin/psh.sh | sh -s -- installBy default, the installer writes psh to $HOME/.local/bin. Override the destination with PSH_INSTALL_DIR:
curl -fsSL https://raw.githubusercontent.com/modoterra/promptshell/main/bin/psh.sh | PSH_INSTALL_DIR=/usr/local/bin sh -s -- installUninstall the installed psh binary:
psh uninstalljqis required.curlis required for hosted providers.ddandsttyare required for interactive approval.codexis required only when usingPSH_PROVIDER=codex.
Run the interactive setup flow before your first hosted-provider request:
psh setuppsh setup requires an interactive terminal. It asks for:
- Provider: OpenAI, Fireworks, or Codex when
codexis installed. - Model: choose a listed model or enter a custom model.
- API key: required for OpenAI and Fireworks; not used for Codex.
The setup command saves config to ${XDG_CONFIG_HOME:-$HOME/.config}/psh/config.json with file mode 600.
Change only the configured model later without re-entering the provider or API key:
psh setup modelpsh setup model requires an existing config from psh setup.
You can also configure providers with environment variables:
OPENAI_API_KEY=... psh run list large files
PSH_PROVIDER=fireworks FIREWORKS_API_KEY=... psh run list large files
PSH_PROVIDER=codex psh run list large files
PSH_PROVIDER=codex CODEX_MODEL=gpt-5.4 psh run list large filesProvider/model environment variables:
PSH_PROVIDER:openai,fireworks, orcodex.OPENAI_API_KEY,OPENAI_MODELfor OpenAI.FIREWORKS_API_KEY,FIREWORKS_MODELfor Fireworks.CODEX_MODELfor Codex. The model is passed tocodex execwith-m.PSH_API_KEY,PSH_MODELas provider-agnostic fallbacks.
Environment variables override saved config for that run.
Use explicit run:
psh run show ports listening on this machineOr omit run; unknown commands are treated as a prompt:
psh show ports listening on this machinePipe a prompt through stdin:
printf %s "show ports listening on this machine" | psh runMore examples:
# Inspect the system
psh run show disk usage by top-level directory
psh run find files larger than 500 MB under the current directory
# Work with Git
psh run show commits on this branch that are not on main
psh run undo the last commit but keep the changes staged
# Compose with other shell commands
printf %s "list docker containers using the most memory" | psh run
printf %s "archive all log files older than 30 days" | psh run
# Use implicit run mode
psh compress all png files in this directory
psh replace spaces with underscores in filenames hereIn an interactive terminal, psh previews the generated command and asks for approval. Press y to run it. Press Enter, Esc, n, or anything else to cancel.
Without a controlling terminal, psh prints only the generated command to stdout and does not execute it. This keeps the CLI scriptable:
command=$(printf %s "show ports listening on this machine" | psh run)
printf '%s\n' "$command"Model output is treated as a proposal, not an instruction. Interactive runs show an AI review notice before approval, and higher-risk model results include risk and explanation metadata.
psh always requires interactive approval before execution. Non-interactive runs never execute generated commands.
Install test dependencies:
npm installRun syntax checks and the Bats integration suite:
make testRun the local installer smoke check:
make install-smoke- Read
CONTRIBUTING.mdbefore opening a pull request. - Use GitHub Issues for bugs and feature requests.
- Report security vulnerabilities privately; see
SECURITY.md.
Use common sense and decency. There is no formal code of conduct. We reserve the right to moderate this community to the extent of the law and the policy of the host. Write community@modoterra.xyz if you need us.
Prompt Shell is released under the MIT License. See LICENSE.