Expand description
Where yapi keeps its state. Same layout as pi, under yapi’s own directories.
Constants§
- AGENT_
DIR_ ENV - Environment variable overriding the agent directory.
- APP_
NAME - Application name in messages and paths.
- PROJECT_
DIR - Project configuration directory name.
- PROJECT_
ONLY_ ENV - Environment variable that turns on project-only mode, as
--project-onlydoes. Child processes get it while the mode is on. - SESSION_
DIR_ ENV - Environment variable overriding the session directory.
--session-dirwins.
Functions§
- agent_
dir - The agent directory:
YAPI_CODING_AGENT_DIR, else~/.yapi/agent. - bin_dir
- Executables the agent installs for its tools, prepended to
PATHfor commands. - child_
env - Variables every child process gets, as pi sets them on its own process:
the agent markers
PI_CODING_AGENT=trueandAI_AGENT=yapi, the offline variables in offline mode,YAPI_PROJECT_ONLY=1in project-only mode, and the proxy from thehttpProxysetting where the environment has none. - default_
session_ dir - Where sessions for
cwdlive by default:<agent>/sessions/--<cwd with separators as dashes>--, both resolved against the process directory. - docs_
dir - The documentation the model reads: yapi’s pages, with pi’s README, docs
and examples under
pi/. The installer or yapi’s first run puts it here. - env_
flag - Whether environment variable
nameis set to1,trueoryes, as pi readsPI_OFFLINE. - env_set
- Whether environment variable
nameis set and not empty, as pi testsprocess.env.PI_OFFLINEandPI_SKIP_VERSION_CHECK. - env_var
- Environment variable
name, with the values offline mode sets. - project_
only - Whether project-only mode is on for the process.
- set_
offline - Turns on offline mode for the process, as pi does for
--offlineor a truePI_OFFLINE: from then onPI_OFFLINEandPI_SKIP_VERSION_CHECKread as1here and in every child’s environment. - set_
project_ only - Turns on project-only mode for the process: runs load the project’s
packages, skills and MCP servers, and of the user’s only those the
global
projectOnlysetting keeps. Every child’s environment getsYAPI_PROJECT_ONLY=1, so a yapi it starts runs in the mode too.