From a0572e2c97eab661949a943076050a0c611f4435 Mon Sep 17 00:00:00 2001 From: Philippe Assis Date: Fri, 23 Jan 2026 19:40:09 -0300 Subject: [PATCH 1/3] docs: update debug instructions --- site/docs/advanced/debug.md | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/site/docs/advanced/debug.md b/site/docs/advanced/debug.md index 6dbb098..22c797b 100644 --- a/site/docs/advanced/debug.md +++ b/site/docs/advanced/debug.md @@ -3,46 +3,46 @@ sidebar_position: 2 title: Debug --- -# Debug do Phlow +# Phlow Debugging -O modo debug pausa a execucao antes de cada step e permite inspecionar o contexto (main/payload), o step atual e o historico de execucao via um servidor TCP e o TUI inspector. +Debug mode pauses execution before each step and lets you inspect the context (main/payload), the current step, and the execution history through a TCP server and the TUI inspector. -## Ativando o debug +## Enabling debug -O debug eh habilitado por variavel de ambiente. Use `PHLOW_DEBUG=true`: +Debug is enabled via an environment variable. Use `PHLOW_DEBUG=true`: ```bash -PHLOW_DEBUG=true cargo run -p phlow-runtime -- ./examples/qualquer.phlow +PHLOW_DEBUG=true phlow ./examples/any.phlow ``` -Por padrao o servidor debug escuta em `0.0.0.0:31400`. Para mudar a porta, use `PHLOW_DEBUG_PORT`: +By default the debug server listens on `0.0.0.0:31400`. To change the port, use `PHLOW_DEBUG_PORT`: ```bash -PHLOW_DEBUG=true PHLOW_DEBUG_PORT=31400 cargo run -p phlow-runtime -- ./examples/qualquer.phlow +PHLOW_DEBUG=true PHLOW_DEBUG_PORT=31400 phlow ./examples/any.phlow ``` -## Inspecao com o phlow-tui-inspect +## Inspecting with phlow-tui-inspect -Em outro terminal, conecte o inspector na mesma porta: +In another terminal, connect the inspector to the same port: ```bash -PHLOW_DEBUG_PORT=31400 cargo run -p phlow-tui-inspect +PHLOW_DEBUG_PORT=31400 phlow --inspect ``` -O inspector se conecta em `127.0.0.1`, entao para depurar remotamente use tunel/port-forward. +The inspector connects to `127.0.0.1`, so use a tunnel/port-forward if you need remote debugging. -## Comandos principais +## Main commands -Voce pode digitar os comandos diretamente na barra do inspector: +You can type commands directly in the inspector bar: -- `STEP` - mostra o step aguardando execucao -- `SHOW` - mostra o script compilado -- `NEXT` - libera um step -- `RELEASE` - libera o pipeline atual -- `ALL` - mostra historico de steps -- `PAUSE` - pausa qualquer liberacao em andamento +- `STEP` - shows the step waiting for execution +- `SHOW` - shows the compiled script +- `NEXT` - releases one step +- `RELEASE` - releases the current pipeline +- `ALL` - shows step history +- `PAUSE` - pauses any ongoing release -Atalhos do inspector (equivalentes aos comandos acima): +Inspector shortcuts (equivalent to the commands above): - `/n` (Ctrl+n) - NEXT + STEP - `/a` (Ctrl+a) - NEXT + ALL @@ -50,9 +50,9 @@ Atalhos do inspector (equivalentes aos comandos acima): - `/w` (Ctrl+w) - SHOW - `/g` (Ctrl+g) - STEP -Use `/m` para abrir o resumo de comandos e `ESC` para fechar. +Use `/m` to open the command summary and `ESC` to close it. -## Observacoes e seguranca +## Notes and safety -- Quando o debug esta ativo, a execucao pausa a cada step ate receber `NEXT` ou `RELEASE`. -- O servidor debug eh uma porta TCP simples. Use apenas em ambiente confiavel e evite expor para a internet. +- When debug is active, execution pauses at each step until it receives `NEXT` or `RELEASE`. +- The debug server is a simple TCP port. Use it only in trusted environments and avoid exposing it to the internet. From 9e4acb05862915300f752f31280381fd1fb955b8 Mon Sep 17 00:00:00 2001 From: Philippe Assis Date: Fri, 23 Jan 2026 19:42:45 -0300 Subject: [PATCH 2/3] scripts: download inspect cli --- scripts/install-phlow.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/install-phlow.sh b/scripts/install-phlow.sh index 255102c..8adfe8d 100755 --- a/scripts/install-phlow.sh +++ b/scripts/install-phlow.sh @@ -4,8 +4,10 @@ set -e REPO="phlowdotdev/phlow" BIN_NAME="phlow" +INSPECT_BIN_NAME="phlow-cli-inspect" INSTALL_DIR="$HOME/.phlow" BIN_PATH="$INSTALL_DIR/phlow" +INSPECT_BIN_PATH="$INSTALL_DIR/phlow-cli-inspect" ADD_PATH_CMD='export PATH="$HOME/.phlow:$PATH"' echo "🔍 Detecting platform..." @@ -16,13 +18,16 @@ ARCH=$(uname -m) # Identificando o asset correto if [[ "$OS" == "Darwin" ]]; then ASSET_NAME="${BIN_NAME}-macos" + INSPECT_ASSET_NAME="${INSPECT_BIN_NAME}-macos" elif [[ "$OS" == "Linux" ]]; then case "$ARCH" in x86_64) ASSET_NAME="${BIN_NAME}-amd64" + INSPECT_ASSET_NAME="${INSPECT_BIN_NAME}-amd64" ;; aarch64 | arm64) ASSET_NAME="${BIN_NAME}-arm64" + INSPECT_ASSET_NAME="${INSPECT_BIN_NAME}-arm64" ;; *) echo "❌ Unsupported Linux architecture: $ARCH" @@ -41,13 +46,18 @@ LATEST=$(curl -s https://api.github.com/repos/$REPO/releases/latest | grep tag_n echo "📦 Latest version is $LATEST" URL="https://github.com/$REPO/releases/download/$LATEST/$ASSET_NAME" +INSPECT_URL="https://github.com/$REPO/releases/download/$LATEST/$INSPECT_ASSET_NAME" echo "🚚 Downloading $BIN_NAME from $URL..." mkdir -p "$INSTALL_DIR" curl -L "$URL" -o "$BIN_PATH" +echo "🚚 Downloading $INSPECT_BIN_NAME from $INSPECT_URL..." +curl -L "$INSPECT_URL" -o "$INSPECT_BIN_PATH" + echo "⚙️ Making binary executable..." chmod +x "$BIN_PATH" +chmod +x "$INSPECT_BIN_PATH" echo "🔧 Updating shell configuration files..." for shell_rc in "$HOME/.bashrc" "$HOME/.zshrc"; do From 5fa3bdd1f052dfcb6e51a071680837a1b8e6d935 Mon Sep 17 00:00:00 2001 From: Philippe Assis Date: Fri, 23 Jan 2026 19:44:00 -0300 Subject: [PATCH 3/3] docs: recommend inspector binary --- site/docs/advanced/debug.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/docs/advanced/debug.md b/site/docs/advanced/debug.md index 22c797b..7ee4c12 100644 --- a/site/docs/advanced/debug.md +++ b/site/docs/advanced/debug.md @@ -26,7 +26,7 @@ PHLOW_DEBUG=true PHLOW_DEBUG_PORT=31400 phlow ./examples/any.phlow In another terminal, connect the inspector to the same port: ```bash -PHLOW_DEBUG_PORT=31400 phlow --inspect +PHLOW_DEBUG_PORT=31400 phlow-cli-inspect ``` The inspector connects to `127.0.0.1`, so use a tunnel/port-forward if you need remote debugging.