From 86b4ce2fd81489df61342d64ea705a84d6cae9e2 Mon Sep 17 00:00:00 2001 From: git-jxj <65210887+git-jxj@users.noreply.github.com> Date: Fri, 2 Oct 2026 17:33:00 +0800 Subject: [PATCH] docs: preserve the working directory between examples --- examples/README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/examples/README.md b/examples/README.md index 2a13e6a..f8aa8a8 100644 --- a/examples/README.md +++ b/examples/README.md @@ -6,17 +6,26 @@ The examples show the smallest installer primitive integration: pass `appId`, `s The temporary `HOME` wrapper keeps the demos from writing to your real user skill directory and provides a Codex detection path for the SDK's default auto agent selection. +Run these commands from the repository root. Each directory change runs in a +subshell so the next example also starts from the root. + ```bash tmp="$(mktemp -d)" && mkdir -p "$tmp/.codex" && HOME="$tmp" pnpm --dir examples/ts install-skill -cd examples/go -tmp="$(mktemp -d)" && mkdir -p "$tmp/.codex" && HOME="$tmp" go run . +( + cd examples/go && + tmp="$(mktemp -d)" && mkdir -p "$tmp/.codex" && HOME="$tmp" go run . +) -cd examples/rust -tmp="$(mktemp -d)" && mkdir -p "$tmp/.codex" && CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" RUSTUP_HOME="${RUSTUP_HOME:-$HOME/.rustup}" HOME="$tmp" cargo run --quiet +( + cd examples/rust && + tmp="$(mktemp -d)" && mkdir -p "$tmp/.codex" && CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" RUSTUP_HOME="${RUSTUP_HOME:-$HOME/.rustup}" HOME="$tmp" cargo run --quiet +) -cd examples/python -tmp="$(mktemp -d)" && mkdir -p "$tmp/.codex" && HOME="$tmp" uv run python main.py +( + cd examples/python && + tmp="$(mktemp -d)" && mkdir -p "$tmp/.codex" && HOME="$tmp" uv run python main.py +) ``` Production CLIs should call the workflow API before installing so explicit agents, `*`, `--yes`, TTY, non-TTY, summary confirmation, scope prompting, and cancellation behavior stay aligned across languages.