2026-01-05 13:46:58 -08:00
## plano CLI - Local Development
2024-10-03 18:21:27 -07:00
2026-01-05 13:46:58 -08:00
This guide will walk you through setting up the plano CLI for local development using uv.
2024-10-03 18:21:27 -07:00
2026-01-05 13:46:58 -08:00
### Install uv
2024-10-03 18:21:27 -07:00
2026-01-05 13:46:58 -08:00
First, install the uv package manager. This is required for managing dependencies and running the development version of planoai.
2024-10-03 18:21:27 -07:00
2026-01-05 13:46:58 -08:00
**On macOS and Linux:**
2024-10-03 18:21:27 -07:00
```bash
2026-01-05 13:46:58 -08:00
curl -LsSf https://astral.sh/uv/install.sh | sh
2024-10-03 18:21:27 -07:00
```
2026-01-05 13:46:58 -08:00
**On Windows:**
```powershell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
2024-10-03 18:21:27 -07:00
```
2026-01-05 13:46:58 -08:00
### Setup
2024-10-03 18:21:27 -07:00
2026-01-05 13:46:58 -08:00
1. **Install dependencies**
2024-10-09 15:53:12 -07:00
2026-01-05 13:46:58 -08:00
In the cli directory, run:
2024-10-09 15:53:12 -07:00
2026-01-05 13:46:58 -08:00
```bash
uv sync
```
2024-10-09 15:53:12 -07:00
2026-01-05 13:46:58 -08:00
This will create a virtual environment in `.venv` and install all dependencies from `pyproject.toml` .
2024-10-09 15:53:12 -07:00
2026-01-05 13:46:58 -08:00
2. **Install the CLI tool globally (optional)**
2024-10-09 15:53:12 -07:00
2026-01-05 13:46:58 -08:00
To install planoai as a global tool on your system:
2024-10-09 15:53:12 -07:00
2026-01-05 13:46:58 -08:00
```bash
uv tool install --editable .
```
2025-12-26 11:21:42 -08:00
2026-01-05 13:46:58 -08:00
This installs planoai globally in editable mode, allowing you to run `planoai` commands from anywhere while still using the source code from this directory. Any changes you make to the code will be reflected immediately.
2024-10-09 15:53:12 -07:00
2026-01-05 13:46:58 -08:00
3. **Run plano commands**
2024-10-09 15:53:12 -07:00
2026-01-05 13:46:58 -08:00
Use `uv run` to execute plano commands with the development version:
2025-12-26 11:21:42 -08:00
2026-01-05 13:46:58 -08:00
```bash
uv run planoai build
```
2025-12-26 11:21:42 -08:00
2026-01-05 13:46:58 -08:00
Or, if you installed globally with `uv tool install .` :
2025-12-26 11:21:42 -08:00
2026-01-05 13:46:58 -08:00
```bash
planoai build
```
2025-12-26 11:21:42 -08:00
2026-01-05 13:46:58 -08:00
Note: `uv run` automatically uses the virtual environment - no activation needed.
### Development Workflow
2024-10-09 15:53:12 -07:00
2026-01-05 13:46:58 -08:00
**Build plano:**
2024-10-09 15:53:12 -07:00
```bash
2025-12-26 11:21:42 -08:00
uv run planoai build
2024-10-09 15:53:12 -07:00
```
2026-01-05 13:46:58 -08:00
**View logs:**
2024-10-10 17:44:41 -07:00
```bash
2025-12-26 11:21:42 -08:00
uv run planoai logs --follow
2024-10-09 16:22:27 -07:00
```
2024-10-09 15:53:12 -07:00
2026-01-05 13:46:58 -08:00
**Run other plano commands:**
```bash
uv run planoai < command > [options]
```
2026-02-17 12:59:09 -08:00
### CI: Keep CLI templates and demos in sync
The CLI templates in `cli/planoai/templates/` are the source of truth for mapped
demo `config.yaml` files.
Use the sync utility to write mapped demo configs from templates:
```bash
uv run python -m planoai.template_sync
```
2026-01-05 13:46:58 -08:00
### Optional: Manual Virtual Environment Activation
While `uv run` handles the virtual environment automatically, you can activate it manually if needed:
2024-10-09 15:53:12 -07:00
```bash
2026-01-05 13:46:58 -08:00
source .venv/bin/activate
planoai build # No need for 'uv run' when activated
```
2026-02-17 12:59:09 -08:00
**Note:** For end-user installation instructions, see the [Plano documentation ](https://docs.planoai.dev ).