contree cd /appcontree run -- ls # runs in /appcontree cd /etccontree cat os-release # reads /etc/os-releasecontree cd # print current working directory
Change the working directory in the current session.
Sets the session’s cwd used by subsequent commands (run, ls, cat). Relative paths are resolved against the current cwd. Without an argument, prints the current working directory.
The path is validated against the image filesystem via the inspect API.
positional arguments: path Target directory
options: -h, —help show this help message and exit
for coding agents: mutates local session cwd pointer validates path exists in image via inspect API
agent note: Before using this command in an automated workflow, read: contree agent
cd stores the path in the session state. Subsequent run, ls, cat,
and cp commands resolve relative paths against it.cd without arguments prints the current working directory.
cd validates the target against the image filesystem via the
inspect API and reports an error when the directory does not exist.
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.