jj-octo 0.3.1 → 0.4.0
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 +27 -29
- package/dist/jj-octo.js +1969 -1839
- package/package.json +12 -10
package/README.md
CHANGED
|
@@ -11,58 +11,56 @@ Run `jj gh --help` to list the commands.
|
|
|
11
11
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
14
|
-
`jj-octo`
|
|
14
|
+
Each [GitHub release](https://github.com/kkom/jj-octo/releases) has a standalone `jj-octo` for macOS on Apple silicon and Linux on x64 and arm64. Alternatively, run the [npm package](https://www.npmjs.com/package/jj-octo) with [Bun](https://bun.sh). Either way, `jj` must be on `PATH`.
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
With [mise](https://mise.jdx.dev), in the repository's `mise.toml`, where `A.B.C` is a bun version and `X.Y.Z` a [released version](https://www.npmjs.com/package/jj-octo?activeTab=versions) of `jj-octo`:
|
|
16
|
+
With [mise](https://mise.jdx.dev), add it to one repository's `mise.toml`:
|
|
19
17
|
|
|
20
18
|
```toml
|
|
21
19
|
[tools]
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
[tools."npm:jj-octo"]
|
|
25
|
-
version = "X.Y.Z"
|
|
26
|
-
# mise holds back a package that is new or rarely downloaded, and this approves it.
|
|
27
|
-
allow_low_downloads = true
|
|
20
|
+
"github:kkom/jj-octo" = "X.Y.Z"
|
|
28
21
|
```
|
|
29
22
|
|
|
30
|
-
|
|
23
|
+
Or to every repository:
|
|
31
24
|
|
|
32
25
|
```
|
|
33
|
-
jj-octo
|
|
26
|
+
mise use --global github:kkom/jj-octo@X.Y.Z
|
|
34
27
|
```
|
|
35
28
|
|
|
36
|
-
It makes the checkout a jj repository colocated with git, makes GitHub's default branch `trunk()`, and sets the `jj gh` alias.
|
|
29
|
+
Then run `jj-octo init` once in each checkout. It makes the checkout a jj repository colocated with git, makes GitHub's default branch `trunk()`, and sets the `jj gh` alias.
|
|
37
30
|
|
|
38
|
-
|
|
31
|
+
## GitHub access
|
|
39
32
|
|
|
40
|
-
|
|
41
|
-
bun install --global jj-octo
|
|
42
|
-
jj config set --user aliases.gh '["util", "exec", "--", "jj-octo"]'
|
|
43
|
-
```
|
|
33
|
+
`jj-octo` reads the repository from the `origin` remote. It takes its token from `GH_TOKEN` or `GITHUB_TOKEN`, and otherwise from `gh auth token`. It sends requests through the proxy that `HTTPS_PROXY` names, and trusts the certificate authorities in `NODE_EXTRA_CA_CERTS` as well as Bun's own.
|
|
44
34
|
|
|
45
|
-
|
|
35
|
+
## In a Claude Code cloud session
|
|
46
36
|
|
|
47
|
-
|
|
37
|
+
In a [Claude Code](https://claude.com/claude-code) cloud session, a proxy carries all traffic to GitHub. It allows REST calls only for the session's repositories, and blocks GraphQL. That's why `jj-octo` uses only GitHub's REST API, while `gh pr` and other tools that depend on GraphQL fail there.
|
|
48
38
|
|
|
49
|
-
|
|
50
|
-
bun update --global --latest jj-octo
|
|
51
|
-
```
|
|
39
|
+
mise can't read this repository's releases there, since it reads them through the GitHub API. Install the npm package instead:
|
|
52
40
|
|
|
53
|
-
|
|
41
|
+
```toml
|
|
42
|
+
[tools]
|
|
43
|
+
bun = "A.B.C"
|
|
54
44
|
|
|
55
|
-
|
|
45
|
+
[tools."npm:jj-octo"]
|
|
46
|
+
version = "X.Y.Z"
|
|
47
|
+
# mise holds back a package that is new or rarely downloaded, and this approves it.
|
|
48
|
+
allow_low_downloads = true
|
|
49
|
+
```
|
|
56
50
|
|
|
57
|
-
|
|
51
|
+
The session sets `HTTPS_PROXY`, `NODE_EXTRA_CA_CERTS` and a placeholder `GH_TOKEN`. Its proxy replaces the placeholder with real credentials. So `jj-octo` works there with its default settings.
|
|
58
52
|
|
|
59
|
-
|
|
53
|
+
## In a Claude Code self-hosted environment
|
|
54
|
+
|
|
55
|
+
A self-hosted runner started with `--use-anthropic-git-proxy` sends git through Anthropic's git proxy, which adds the session user's credentials. The sandbox then holds no GitHub token, and only git's config names the proxy. There, have `jj-octo` use the same proxy:
|
|
60
56
|
|
|
61
57
|
```
|
|
62
58
|
jj config set --repo jj-octo.github-auth git-proxy
|
|
63
59
|
```
|
|
64
60
|
|
|
65
|
-
`jj-octo` then sends its requests through the `http.proxy` that git uses for `https://github.com`, trusts the certificate authorities in git's `http.sslCAInfo` for it
|
|
61
|
+
`jj-octo` then sends its requests through the `http.proxy` that git uses for `https://github.com`, and trusts the certificate authorities in git's `http.sslCAInfo` for it. It sends a placeholder token, which the proxy must replace with real credentials. It reads git's settings on each run, so it follows a proxy that moves to another port.
|
|
62
|
+
|
|
63
|
+
Don't use `git-proxy` with a proxy that only forwards requests. GitHub would get the placeholder token and reject every request. `token`, the default, sends your own token.
|
|
66
64
|
|
|
67
65
|
## Development
|
|
68
66
|
|
|
@@ -72,4 +70,4 @@ bun run check # format, lint, types, tests and build
|
|
|
72
70
|
bun run fix # format and lint fixes
|
|
73
71
|
```
|
|
74
72
|
|
|
75
|
-
To release, run `bun run release:patch`, `release:minor` or `release:major` in a pull request, which raises `version` in `package.json`. Once it is merged and the checks pass on `main`, the same workflow publishes that version to npm and
|
|
73
|
+
To release, run `bun run release:patch`, `release:minor` or `release:major` in a pull request, which raises `version` in `package.json`. Once it is merged and the checks pass on `main`, the same workflow publishes that version to npm, and as a GitHub release with the executables.
|