@youtyan/code-viewer 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -100,6 +100,9 @@ Common options:
100
100
  - `--cwd <dir>` — repository to view (default: current working directory).
101
101
  - `--open` — open the printed URL in the default browser.
102
102
  - `--port <port>` — bind to a specific port (default: pick a free port).
103
+ - `--bin <name>=<absolute-path>` — override an external command path
104
+ (`git`, `rg`, or `docker`). The same values can be supplied through
105
+ `CODE_VIEWER_BIN_GIT`, `CODE_VIEWER_BIN_RG`, and `CODE_VIEWER_BIN_DOCKER`.
103
106
  - `--scope-omit-dir <name>` — skip a directory under the worktree (repeatable;
104
107
  overrides the Viewer Settings list for this session).
105
108
  - `--version`, `-v` — print the installed version.
@@ -115,6 +118,10 @@ code-viewer HEAD~1 HEAD
115
118
  code-viewer --cwd /path/to/repo --staged
116
119
  ```
117
120
 
121
+ `--bin` is useful when several command installations exist or a login shell
122
+ PATH differs from the environment that starts code-viewer. Override paths must
123
+ be absolute executable files outside the opened repository.
124
+
118
125
  Open **Viewer Settings** in the header to change display options such as
119
126
  theme, layout, sidebar mode, font sizes, and UI language. The language setting
120
127
  translates the viewer chrome itself, including the Help page, settings labels,
@@ -531,6 +538,9 @@ code-viewer status --json
531
538
 
532
539
  # Override the ref / depth used for "recent commits".
533
540
  code-viewer status --ref main --limit 20 --json
541
+
542
+ # Use a specific git binary when PATH resolution is not the one you want.
543
+ code-viewer status --bin git=/opt/bin/git --json
534
544
  ```
535
545
 
536
546
  The `nextCommands` field pins `--server '<url>'` automatically for
@@ -587,6 +597,9 @@ code-viewer search files --term "src/**/*.test.ts" --max 200 --json
587
597
 
588
598
  # Look at a specific ref instead of the worktree.
589
599
  code-viewer search files --term "config" --ref main --json
600
+
601
+ # Pin the git binary used for CLI-side repository discovery.
602
+ code-viewer search files --term "config" --bin git=/opt/bin/git --json
590
603
  ```
591
604
 
592
605
  Default text output is one path per line, best first. An empty result
@@ -630,6 +643,9 @@ code-viewer file show --path src/sample.ts --ref main --json
630
643
  code-viewer file diff --path src/sample.ts --json
631
644
  code-viewer file diff --path src/sample.ts --from HEAD~1 --to HEAD --full --json
632
645
  code-viewer file diff --path new_sample.ts --untracked --json
646
+
647
+ # Pin the git binary used by local file/blame/history/diff reads.
648
+ code-viewer file history --path src/sample.ts --bin git=/opt/bin/git --json
633
649
  ```
634
650
 
635
651
  Default (non-`--json`) output is tab-separated and easy to grep:
@@ -660,6 +676,7 @@ code-viewer doctor
660
676
  # Full DoctorReport JSON (matches the /_doctor endpoint).
661
677
  code-viewer doctor --json
662
678
  code-viewer doctor --cwd /path/to/repo --port 64160 --json
679
+ code-viewer doctor --bin git=/opt/bin/git --bin docker=/opt/bin/docker --json
663
680
  ```
664
681
 
665
682
  The exit code is `1` iff the worst check status is `"error"` (never on