Skip to content

Commit a767799

Browse files
committed
docs: document gtr.ui.color config option
Add color configuration to README Quick Setup and docs/configuration.md with new UI Settings section, precedence rules, and env vars.
1 parent 02c8aee commit a767799

2 files changed

Lines changed: 37 additions & 9 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@ git gtr config add gtr.hook.postCreate "npm install"
337337

338338
# Re-source environment after gtr cd (runs in current shell)
339339
git gtr config add gtr.hook.postCd "source ./vars.sh"
340+
341+
# Disable color output (or use "always" to force it)
342+
git gtr config set gtr.ui.color never
340343
```
341344

342345
### Team Configuration (.gtrconfig)

docs/configuration.md

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- [File Copying](#file-copying)
1818
- [Directory Copying](#directory-copying)
1919
- [Hooks](#hooks)
20+
- [UI Settings](#ui-settings)
2021
- [Shell Completions](#shell-completions)
2122
- [Configuration Examples](#configuration-examples)
2223
- [Environment Variables](#environment-variables)
@@ -337,6 +338,28 @@ git gtr config add gtr.hook.postCreate "cargo build"
337338

338339
---
339340

341+
## UI Settings
342+
343+
Control color output behavior.
344+
345+
| Git Config Key | `.gtrconfig` Key | Description | Values |
346+
| -------------- | ---------------- | ----------------- | ----------------------------------- |
347+
| `gtr.ui.color` | `ui.color` | Color output mode | `auto` (default), `always`, `never` |
348+
349+
```bash
350+
# Disable color output
351+
git gtr config set gtr.ui.color never
352+
353+
# Force color output (e.g., when piping to a pager)
354+
git gtr config set gtr.ui.color always
355+
```
356+
357+
**Precedence**: `NO_COLOR` env (highest) > `GTR_COLOR` env > `gtr.ui.color` config > auto-detect (TTY).
358+
359+
The `NO_COLOR` environment variable ([no-color.org](https://no-color.org)) always wins regardless of other settings.
360+
361+
---
362+
340363
## Shell Completions
341364

342365
Enable tab completion using the built-in `completion` command.
@@ -420,15 +443,17 @@ git gtr config set gtr.ai.default claude --global
420443

421444
## Environment Variables
422445

423-
| Variable | Description | Default |
424-
| --------------------- | ------------------------------------------------------ | -------------------------- |
425-
| `GTR_DIR` | Override script directory location | Auto-detected |
426-
| `GTR_WORKTREES_DIR` | Override base worktrees directory | `gtr.worktrees.dir` config |
427-
| `GTR_EDITOR_CMD` | Custom editor command (e.g., `emacs`) | None |
428-
| `GTR_EDITOR_CMD_NAME` | First word of `GTR_EDITOR_CMD` for availability checks | None |
429-
| `GTR_AI_CMD` | Custom AI tool command (e.g., `copilot`) | None |
430-
| `GTR_AI_CMD_NAME` | First word of `GTR_AI_CMD` for availability checks | None |
431-
| `GTR_PROVIDER` | Override hosting provider (`github` or `gitlab`) | Auto-detected from URL |
446+
| Variable | Description | Default |
447+
| --------------------- | -------------------------------------------------------------------- | -------------------------- |
448+
| `GTR_DIR` | Override script directory location | Auto-detected |
449+
| `GTR_WORKTREES_DIR` | Override base worktrees directory | `gtr.worktrees.dir` config |
450+
| `GTR_EDITOR_CMD` | Custom editor command (e.g., `emacs`) | None |
451+
| `GTR_EDITOR_CMD_NAME` | First word of `GTR_EDITOR_CMD` for availability checks | None |
452+
| `GTR_AI_CMD` | Custom AI tool command (e.g., `copilot`) | None |
453+
| `GTR_AI_CMD_NAME` | First word of `GTR_AI_CMD` for availability checks | None |
454+
| `GTR_COLOR` | Override color output (`always`, `never`, `auto`) | `auto` |
455+
| `GTR_PROVIDER` | Override hosting provider (`github` or `gitlab`) | Auto-detected from URL |
456+
| `NO_COLOR` | Disable color output when set ([no-color.org](https://no-color.org)) | Unset |
432457

433458
**Hook environment variables** (available in hook scripts):
434459

0 commit comments

Comments
 (0)