Use pixi on Uppcoder
Every Uppcoder app comes with pixi, the package manager from prefix.dev, and its own pixi.toml. Here is how to add libraries and tools, run tasks and bring your own pixi project, from the terminal in your browser.
What you already have
Open your app and its terminal (or connect over SSH). In the app folder you will find:
- pixi.toml: your app's manifest. It is yours to read, change and commit
- pixi.lock: the exact versions, so the same environment comes back every time
- Packages come from conda-forge, where most Python and Node libraries and many command-line tools live
- The welcome text in the terminal shows the name of your app's environment, for example web-fastapi
Add a library to your app
In the app folder, run pixi add with the package name, for example: pixi add httpx. It is written into pixi.toml and pixi.lock and is ready straight away: python in the terminal can import it, and so can your app. Frameworks that run in reload mode pick it up on your next save; if yours does not, press Restart on the stack page. To take a library out again: pixi remove httpx.
Install a tool, no root needed
Command-line tools go in with add, for example: add htop. It installs into your app's own environment, so you do not need sudo, and the tool is there in every new terminal. remove htop takes it out.
Save commands as tasks
Commands you run often can be saved in pixi.toml as tasks: pixi task add seed "python seed.py", then pixi run seed. pixi task list shows them all. If a task needs your app's libraries, run it in your app's environment: pixi run -e web-fastapi seed (use the name the terminal shows). Leave the init and start tasks that came with your app as they are: Uppcoder uses them to start the app.
Bring your own pixi project
A project that already has a pixi.toml works as it does on your laptop. Clone it into a folder of its own, not into the app folder itself (that one has its own pixi.toml), then run pixi install and pixi run with your task. For example: git clone <your repository> ~/projects/myproject, cd ~/projects/myproject, pixi install, pixi run start.
Good to know
Said up front:
- Commit pixi.toml and pixi.lock with your code, so the environment travels with it
- pixi itself is installed and kept up to date by Uppcoder
- Libraries from conda-forge are what this guide covers; check a package exists there first (prefix.dev or anaconda.org)
- The free plan runs one app with one database; your own pixi projects in folders run inside that app
Questions about pixi on Uppcoder
Is this the normal pixi?
Yes. It is pixi from prefix.dev, with packages from conda-forge. pixi add, pixi remove, pixi run and pixi task work as they do on your own machine.
Do I need root or sudo to install a tool?
No. add htop (or any other tool from conda-forge) installs it into your app's own environment, without sudo.
Can I use my own pixi project?
Yes. Clone it into a folder of its own, not into the app folder, then run pixi install and pixi run with your task.
Your app, its own pixi.toml, and pixi add from the terminal in your browser: free, with no card.