Ever tempted to use or try out the infamous pi-coding-agent but got put off by its lack of out-of-the-box sandbox?
Some people use and/or develop guardrails extensions or poor-man sandboxing solutions; others just deploy it to their VPS so that any potential damage is contained.
But the virtue is somewhere in the middle:
- No need to go to the extreme of complicated cloud deploys to just try out some clanking business.
- No need to setup potentially-unsafe tweaks or plugins that may give you a false sense of security, or too many permissions issues for your clanker to be productive.
Why not just use the unix model? Give Pi a user in your system, a $HOME where to place its git repositories and you're off to the races.
This repository is just a quick npx tool that helps you set up this ideal approach: run it with a simple npx skynot and it will guide you through the process and ask you for sudo permissions in each step that it requires, informing you of what it is doing at all times.
(This repo is of course opensource too so that you can check that what it says it does is what it really does.)
npx skynot [options]The following command‑line flags are available:
| Flag | Alias | Description |
|---|---|---|
--help |
-h |
Show the help message with all available options. |
--auth |
-a |
Ask about auth details (provider name and API key) to add it to launcher script. |
--extensions |
-e |
After installing Pi, also install recommended extensions. |
--ssh |
-s |
Copy SSH keys to the pi user for git+ssh (& add GitHub to known_hosts). |
--update |
-u |
Wipe any previous existing install of Pi and reinstall, to get the latest version. |
--verbose |
-v |
Show more output from install commands (useful for debugging/low-bandwidth). |
--version |
-V |
Output the version number. |
Please note, -u would technically not wipe or reinstall extensions, as they normally live in a different place (.pi subdir under pi user's $HOME, and/or $NPM_CONFIG_PREFIX dir).
- Create a user
pi, if missing. - Download & install Pi under
~pi/pi/. - Install the recommended extensions and/or authentication files if user used flags for them.
- Add the agent's binary directory to the
piuser's$PATH. - Create a launcher script at
$HOME/bin/pifor the current user. - Create a proper work dir inside
~piowned bypiand a newaiteamgroup, whichpiand current user will be members of.
- The script runs many operations as the
piuser viasudo. It setsnpm_config_prefixto$HOME/.npm-globalto avoid permission errors when installing extensions from NPM. - To test locally (directly from sources instead of using
npx), usenpm run exec -- [options](e.g.npm run exec -- -e).