---
title: "Global options"
description: "The options every abx command accepts, where they can appear, and how option values are parsed."
---

> Documentation Index
> Fetch the complete documentation index at: https://sandrinodm.github.io/agent-box/llms.txt
> Use this file to discover all available pages before exploring further.

# Global options

`-C` and `--no-git` apply to every command. They can sit before the command name, after it, or between a command and its subcommand, so `abx -C dir auth status`, `abx auth -C dir status` and `abx auth status -C dir` are equivalent. `-h` and `--help` also work after a command (`abx <command> --help`). `-V`, `--version` and `--agent-mode` are top-level options and belong directly after `abx`.

| Option | Short | Value | Description |
| --- | --- | --- | --- |
| `-C` | | `DIR` | Run as if `abx` was started in `DIR`, like `git -C`. Given once. `DIR` must be a directory, or the command fails with a usage error. |
| `--no-git` | | | Ignore Git and use the scratch boxes of the current directory, which start with an empty `/work`. |
| `--help` | `-h` | | Show help. |
| `--version` | `-V` | | Print `abx <version>` and exit. |
| `--agent-mode` | | | Deprecated and hidden. Use `abx help --json`. Prints the JSON command reference and exits. It does not change how other commands behave. |

## `-C DIR`

`-C DIR` selects the folder whose boxes a command works on, the way `git -C` selects a repository. Use it to reach the boxes of another checkout or scratch directory without changing directory, for example `abx -C ~/src/app stop fix-auth`. The value can be written `-C DIR` or `-C=DIR`. See [workspaces](https://sandrinodm.github.io/agent-box/concepts/workspaces/).

## `--no-git`

Boxes belong to a workspace: a Git repository, or the exact current directory for scratch boxes. Outside a Git checkout, `abx` already uses scratch boxes. Inside a checkout, `--no-git` selects the scratch boxes of the current directory instead. Scratch boxes start with an empty `/work`, and nothing from the host directory is copied in or out. `diff` and `land` need a Git box and fail with `not-git` on scratch boxes.

Inside a checkout, the scratch marker `.abx/workspace.json` is written to the working tree as an untracked file. `abx` does not edit `.gitignore`. Linking an existing scratch workspace to a folder with [`abx workspace link`](https://sandrinodm.github.io/agent-box/reference/cli/#workspace-link) also needs `--no-git`. `--no-git` cannot be combined with `--all` (on `ls` or `stop`) or `--workspace` (on `stop` or `rm`).

```sh
abx --no-git shell --agents claude -- sh -c 'echo hello > /work/note'
abx --no-git stop
```

## `--help` and `--version`

`abx --help` and `abx <command> --help` print help, like `abx help [command]`. `abx --version` prints `abx <version>`, for example `abx 0.3.0`, and exits. The installer runs `--version` on the downloaded binary to check it before installing.

## `--agent-mode`

`--agent-mode` is a deprecated spelling of `abx help --json`. It is hidden from the help text, still prints the reference and exits, and has `deprecated: true` in the reference. It takes no other arguments. New scripts should use `abx help --json`. See [JSON output](https://sandrinodm.github.io/agent-box/reference/json-output/#the-command-reference).

## How option values are parsed

- Values can be written `--flag value` or `--flag=value`, and `-s value` or `-s=value` for short names.
- A value that starts with `-` must use the `=` form.
- Single-valued options can be given once. Repeating one is a usage error. `--allow` and `--agents` are repeatable.
- `--` ends host option parsing. On `run` and `shell`, everything after it goes to the guest verbatim. Other commands reject it.
- An unknown option before the command name is a usage error that suggests the closest known option and reminds you to put command options after the command name.

Usage errors exit with status `2`, or `125` in a one-shot launch. See [exit codes](https://sandrinodm.github.io/agent-box/reference/exit-codes/) and the [`usage` error code](https://sandrinodm.github.io/agent-box/reference/error-codes/).

Source: https://sandrinodm.github.io/agent-box/reference/global-options/index.mdx
