Skip to main content
Shell aliases let you start psys with a single command from anywhere in your terminal.

Quick Setup

Create a psys alias to start the application in background mode with one command.
1

Build the application

Run the build command at least once:
cd /path/to/psys
npm run build
2

Add alias to shell configuration

Open your shell configuration file and add the alias.
alias psys='cd /path/to/psys && npm run start:bg'
Replace /path/to/psys with the actual absolute path to your psys project directory.
3

Reload shell configuration

Apply the changes by reloading your shell configuration:
source ~/.zshrc
4

Run the alias

Now you can start psys from anywhere:
psys
The app starts in the background on port 30999.

Shell Configuration Files

Choose the correct configuration file based on your shell:
ShellConfiguration FileHow to Check
Zsh~/.zshrcecho $SHELL returns /bin/zsh or /usr/bin/zsh
Bash~/.bashrcecho $SHELL returns /bin/bash or /usr/bin/bash
Not sure which shell you’re using? Run echo $SHELL in your terminal.

Example: Finding Your Project Path

To get the absolute path for the alias:
1

Navigate to the project

cd ~/projects/psys
2

Get the full path

pwd
Output example: /home/username/projects/psys
3

Use in alias

alias psys='cd /home/username/projects/psys && npm run start:bg'

Advanced Aliases

You can create additional aliases for different operations:
# Start psys in background
alias psys='cd /path/to/psys && npm run start:bg'

# Stop psys
alias psys-stop='pkill -f "next start -p 30999"'

# Rebuild and restart psys
alias psys-rebuild='cd /path/to/psys && npm run build && npm run start:bg'

# Open psys in browser
alias psys-open='open http://localhost:30999'
The open command works on macOS. On Linux, use xdg-open instead.

Verifying the Alias

After setting up your alias:
1

Check the alias definition

alias psys
This displays the alias definition to verify it’s correct.
2

Test the alias

psys
The application should start in the background.
3

Verify it's running

Open http://localhost:30999 or check with:
ps aux | grep "next start"

Troubleshooting

Make sure you reloaded the shell configuration:
source ~/.zshrc  # or ~/.bashrc
Or open a new terminal window.
Ensure Node.js and npm are installed and in your PATH:
which npm
node --version
npm --version
Run the build command first:
cd /path/to/psys
npm run build
The production build must exist before using npm run start:bg.
Another instance might be running. Stop it first:
pkill -f "next start -p 30999"
Or use lsof -ti:30999 | xargs kill to kill the process using that port.