@youtyan/code-viewer 0.6.2 → 0.6.4
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 +28 -9
- package/dist/code-viewer.js +3317 -490
- package/package.json +1 -1
- package/skills/code-viewer-journal/SKILL.md +131 -0
- package/web/app.js +2552 -263
- package/web/index.html +1 -0
- package/web/style.css +1654 -169
package/README.md
CHANGED
|
@@ -100,6 +100,10 @@ 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`, `docker`, or `gh`). The same values can be supplied through
|
|
105
|
+
`CODE_VIEWER_BIN_GIT`, `CODE_VIEWER_BIN_RG`, `CODE_VIEWER_BIN_DOCKER`, and
|
|
106
|
+
`CODE_VIEWER_BIN_GH`.
|
|
103
107
|
- `--scope-omit-dir <name>` — skip a directory under the worktree (repeatable;
|
|
104
108
|
overrides the Viewer Settings list for this session).
|
|
105
109
|
- `--version`, `-v` — print the installed version.
|
|
@@ -115,6 +119,10 @@ code-viewer HEAD~1 HEAD
|
|
|
115
119
|
code-viewer --cwd /path/to/repo --staged
|
|
116
120
|
```
|
|
117
121
|
|
|
122
|
+
`--bin` is useful when several command installations exist or a login shell
|
|
123
|
+
PATH differs from the environment that starts code-viewer. Override paths must
|
|
124
|
+
be absolute executable files outside the opened repository.
|
|
125
|
+
|
|
118
126
|
Open **Viewer Settings** in the header to change display options such as
|
|
119
127
|
theme, layout, sidebar mode, font sizes, and UI language. The language setting
|
|
120
128
|
translates the viewer chrome itself, including the Help page, settings labels,
|
|
@@ -505,8 +513,8 @@ stdout and adds `text truncated` to stderr when the server flagged
|
|
|
505
513
|
truncation. `--json` always emits the full server response envelope.
|
|
506
514
|
|
|
507
515
|
AI agents who don't yet know which subcommand they need can run
|
|
508
|
-
`code-viewer agent-help` once. It prints a short index of the
|
|
509
|
-
AI-facing entry points (`status`, `query`, `annotate`, `search`,
|
|
516
|
+
`code-viewer agent-help` once. It prints a short index of the eight
|
|
517
|
+
AI-facing entry points (`status`, `query`, `annotate`, `journal`, `search`,
|
|
510
518
|
`file`, `skill`, `doctor`) with the exact `code-viewer <name>
|
|
511
519
|
agent-help` command for each full guide. The index runs without any
|
|
512
520
|
preflight, so it works even before SQLite or a running server is set
|
|
@@ -531,6 +539,9 @@ code-viewer status --json
|
|
|
531
539
|
|
|
532
540
|
# Override the ref / depth used for "recent commits".
|
|
533
541
|
code-viewer status --ref main --limit 20 --json
|
|
542
|
+
|
|
543
|
+
# Use a specific git binary when PATH resolution is not the one you want.
|
|
544
|
+
code-viewer status --bin git=/opt/bin/git --json
|
|
534
545
|
```
|
|
535
546
|
|
|
536
547
|
The `nextCommands` field pins `--server '<url>'` automatically for
|
|
@@ -587,6 +598,9 @@ code-viewer search files --term "src/**/*.test.ts" --max 200 --json
|
|
|
587
598
|
|
|
588
599
|
# Look at a specific ref instead of the worktree.
|
|
589
600
|
code-viewer search files --term "config" --ref main --json
|
|
601
|
+
|
|
602
|
+
# Pin the git binary used for CLI-side repository discovery.
|
|
603
|
+
code-viewer search files --term "config" --bin git=/opt/bin/git --json
|
|
590
604
|
```
|
|
591
605
|
|
|
592
606
|
Default text output is one path per line, best first. An empty result
|
|
@@ -630,6 +644,9 @@ code-viewer file show --path src/sample.ts --ref main --json
|
|
|
630
644
|
code-viewer file diff --path src/sample.ts --json
|
|
631
645
|
code-viewer file diff --path src/sample.ts --from HEAD~1 --to HEAD --full --json
|
|
632
646
|
code-viewer file diff --path new_sample.ts --untracked --json
|
|
647
|
+
|
|
648
|
+
# Pin the git binary used by local file/blame/history/diff reads.
|
|
649
|
+
code-viewer file history --path src/sample.ts --bin git=/opt/bin/git --json
|
|
633
650
|
```
|
|
634
651
|
|
|
635
652
|
Default (non-`--json`) output is tab-separated and easy to grep:
|
|
@@ -650,8 +667,8 @@ including the JSON contract for each subcommand.
|
|
|
650
667
|
|
|
651
668
|
The same diagnostic report behind the Environment Doctor sheet (see
|
|
652
669
|
Features above) is available from the terminal without a browser, so AI
|
|
653
|
-
agents and CI can introspect the runtime, SQLite driver, Git,
|
|
654
|
-
discovery, and snapshot store status directly.
|
|
670
|
+
agents and CI can introspect the runtime, SQLite driver, Git, GitHub CLI,
|
|
671
|
+
Docker discovery, and snapshot store status directly.
|
|
655
672
|
|
|
656
673
|
```sh
|
|
657
674
|
# Human-readable status summary.
|
|
@@ -660,6 +677,7 @@ code-viewer doctor
|
|
|
660
677
|
# Full DoctorReport JSON (matches the /_doctor endpoint).
|
|
661
678
|
code-viewer doctor --json
|
|
662
679
|
code-viewer doctor --cwd /path/to/repo --port 64160 --json
|
|
680
|
+
code-viewer doctor --bin git=/opt/bin/git --bin docker=/opt/bin/docker --bin gh=/opt/bin/gh --json
|
|
663
681
|
```
|
|
664
682
|
|
|
665
683
|
The exit code is `1` iff the worst check status is `"error"` (never on
|
|
@@ -750,11 +768,12 @@ write concise Markdown explanations, and how to install the bundled agent skill.
|
|
|
750
768
|
|
|
751
769
|
### Agent Skill
|
|
752
770
|
|
|
753
|
-
The package bundles
|
|
754
|
-
(the SKILL.md open standard) — `code-viewer-annotate`,
|
|
755
|
-
and `code-viewer-snapshot` —
|
|
756
|
-
|
|
757
|
-
|
|
771
|
+
The package bundles four [Agent Skills](https://agentskills.io)
|
|
772
|
+
(the SKILL.md open standard) — `code-viewer-annotate`,
|
|
773
|
+
`code-viewer-journal`, `code-viewer-query`, and `code-viewer-snapshot` —
|
|
774
|
+
that teach AI coding agents when and how to use `annotate`, Work Log task
|
|
775
|
+
queues, read-only `query`, and snapshot / diff workflows. A single
|
|
776
|
+
`skill install` copies all four into the selected agent directories:
|
|
758
777
|
|
|
759
778
|
```sh
|
|
760
779
|
npx -y @youtyan/code-viewer skill install # Claude Code (.claude/skills/)
|