# buildkite-agent workdir

The Buildkite agent's `workdir` subcommands provide the ability to interact with the working directory of the currently running job.

## Set

### Usage

`buildkite-agent workdir set <path>`

### Description

Sets the working directory for subsequent phases of the current job. The change
persists across later hooks and the command phase.

This is intended for binary and polyglot (non-shell) hooks, which run in a child
process whose own directory changes are otherwise lost. Wrapped POSIX shell
hooks can change the working directory simply by `cd`-ing.

Relative paths are resolved against the current working directory of this command
(i.e. the hook&#39;s actual working directory). The path must exist and be a
directory.

### Examples

Setting the working directory to a subdirectory of the checkout:

```shell
$ buildkite-agent workdir set ./subdir
```

Setting the working directory to an absolute path:

```shell
$ buildkite-agent workdir set /tmp/build-scratch
```

### Options



| `--no-color ` # | Don't show colors in logging (default: false) **Environment variable**: `$BUILDKITE_AGENT_NO_COLOR` |
| --- | --- |
| `--debug ` # | Enable debug mode. Synonym for `--log-level debug`. Takes precedence over `--log-level` (default: false) **Environment variable**: `$BUILDKITE_AGENT_DEBUG` |
| `--log-level value` # | Set the log level for the agent, making logging more or less verbose. Defaults to notice. Allowed values are: debug, info, error, warn, fatal (default: "notice") **Environment variable**: `$BUILDKITE_AGENT_LOG_LEVEL` |
| `--experiment value` # | Enable experimental features within the buildkite-agent **Environment variable**: `$BUILDKITE_AGENT_EXPERIMENT` |
| `--profile value` # | Enable a profiling mode, either cpu, memory, mutex or block **Environment variable**: `$BUILDKITE_AGENT_PROFILE` |
| `--output-format value` # | Output format: quiet (no output), plain, or json (default: "plain") **Environment variable**: `$BUILDKITE_AGENT_WORKDIR_SET_OUTPUT_FORMAT` |



