Skip to content

Dev Environment Setup

Your local development environment is where you’ll build, test, and publish PhyStack apps using the PhyStack CLI.

Once configured, you’ll be able to create edge apps, screen apps, and manage other aspects of your PhyStack workflow from your terminal.

You’ll need access to a PhyStack tenant. If you don’t yet have one, please refer to the Tenant Setup guide.

Before installing the PhyStack CLI, make sure your development machine meets these requirements:

  • macOS 15.4+
  • Ubuntu 22.04/24.04

Note: Windows support is coming soon. For now, you can use WSL2 with Ubuntu.

If you plan to build edge apps, you’ll also need:

Install the CLI globally using npm:

Terminal window
npm i -g @phystack/cli

Verify the installation was successful:

Terminal window
phy --version

If you see the CLI version printed without errors, you’re ready to proceed.

Connect your CLI to your PhyStack tenant:

Terminal window
phy login

This command will:

  • Open your default web browser
  • Prompt you to authenticate with your PhyStack account
  • Show a confirmation prompt in the browser, confirm to complete the login

If you’re already logged into your PhyStack tenant in your browser, you can confirm the operation without re-entering credentials.

If you’re using the CLI in an environment without a GUI browser, use the device code flow:

Terminal window
phy login --use-device-code

Follow the instructions displayed in your terminal to authenticate using a web browser on another device.

Once authentication is complete, verify your CLI connection by listing your available tenants:

Terminal window
phy tenant list

If you see your tenant’s name displayed without any errors, your authentication is working correctly and you’re ready to proceed.

You must enable the containerd image store, a requirement for proper edge apps image handling with PhyStack.

To do this:

  1. Open Docker Desktop
  2. Go to Settings General
  3. Enable the option “Use containerd for pulling and storing images”
  4. Click Apply & Restart

This feature is available in Docker Desktop ≥ 4.29

If you plan to use Docker Hub as your container registry, log in now:

Terminal window
docker login

This ensures the Docker CLI can pull and push images during the app creation process.

The PhyStack CLI includes a local device simulator for testing apps without a physical device. Both screen and edge app templates integrate with the simulator out of the box.

For full simulator documentation including commands, options, and how it works, see the Simulator reference.

After completing these steps, you should have:

  • PhyStack CLI installed, authenticated and working
  • Docker configured (if building edge apps)
  • Simulator available for local testing

With your development environment ready, you can now:

Problem: phy command not found after installation
Solution: Make sure your npm global bin directory is in your PATH:

Terminal window
npm config get prefix

Add <prefix>/bin to your PATH if it’s not already there.

Problem: Browser doesn’t open during phy login
Solution: Use the device code flow: phy login --use-device-code

For additional help, contact support at [email protected].