Skip to main content
Change the working directory for subsequent commands in the current session.

Examples

Help output

$ contree cd —help
usage: contree cd [-h] [path]

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

Behavior

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.