Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Commit af6cd43

Browse files
committed
bunbunbunbunbunbun
1 parent 5bdbdb9 commit af6cd43

9 files changed

Lines changed: 63 additions & 12 deletions

File tree

‎.github/workflows/agent-release.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ jobs:
4646
- name: Install pnpm
4747
run: npm install -g pnpm
4848

49+
- name: Setup Bun
50+
uses: oven-sh/setup-bun@v2
51+
4952
- name: Install dependencies
5053
run: pnpm install --frozen-lockfile
5154

‎.github/workflows/build.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ jobs:
1818
persist-credentials: false
1919
- name: Setup pnpm
2020
uses: pnpm/action-setup@v4
21-
2221
- name: Setup Node.js
2322
uses: actions/setup-node@v4
2423
with:
2524
node-version: 22
2625
cache: 'pnpm'
26+
- name: Setup Bun
27+
uses: oven-sh/setup-bun@v2
2728
- name: Install dependencies
2829
run: pnpm install --frozen-lockfile
2930
- name: Build electron-trpc

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
node-version: 22
5151
cache: "pnpm"
5252

53+
- name: Setup Bun
54+
uses: oven-sh/setup-bun@v2
55+
5356
- name: Bump minor version
5457
id: version
5558
run: |

‎.github/workflows/typecheck.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
with:
2121
node-version: 22
2222
cache: "pnpm"
23+
- name: Setup Bun
24+
uses: oven-sh/setup-bun@v2
2325
- name: Install dependencies
2426
run: pnpm install --frozen-lockfile
2527
- name: Run type check

‎apps/cli/README.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,30 @@ Stacked PRs keep reviews small and manageable. Managing them with `git` is painf
2121

2222
`arr` makes it easy to create, manage and submit (stacked) PRs by using `jj` under the hood.
2323

24+
## Install
25+
26+
Requires [Bun](https://bun.sh).
27+
28+
```
29+
git clone https://github.com/posthog/array
30+
cd array
31+
pnpm install
32+
pnpm --filter @array/core build
33+
```
34+
35+
Then install the `arr` command (symlinked to `~/bin/arr`):
36+
37+
```
38+
./apps/cli/arr.sh install
39+
```
40+
2441
## Usage
2542

2643
```
2744
arr init # set up arr in a git repo
2845
arr create "message" # new change on stack
2946
arr submit # push stack, create PRs
47+
arr merge # merge PR via GitHub
3048
arr sync # fetch, rebase, cleanup merged
3149
arr up / arr down # navigate stack
3250
arr log # show stack

‎apps/cli/arr.sh‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
# Wrapper script to run arr CLI via bun.
3+
SOURCE="${BASH_SOURCE[0]}"
4+
while [ -L "$SOURCE" ]; do
5+
DIR="$(cd "$(dirname "$SOURCE")" && pwd)"
6+
SOURCE="$(readlink "$SOURCE")"
7+
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
8+
done
9+
SCRIPT_DIR="$(cd "$(dirname "$SOURCE")" && pwd)"
10+
11+
# Self-install: ./arr.sh install
12+
if [ "$1" = "install" ]; then
13+
mkdir -p ~/bin
14+
ln -sf "$SCRIPT_DIR/arr.sh" ~/bin/arr
15+
echo "Installed: ~/bin/arr -> $SCRIPT_DIR/arr.sh"
16+
echo "Make sure ~/bin is in your PATH"
17+
exit 0
18+
fi
19+
20+
exec bun run "$SCRIPT_DIR/src/bin.ts" "$@"

‎apps/cli/src/cli.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ ${bold("CORE WORKFLOW")}
103103
3. ${dim("(make more edits)")}\t\t\tStack more work
104104
4. ${cyan('arr create "add user api"')}\t\tSave as another change
105105
5. ${cyan("arr submit")}\t\t\t\tCreate PRs for the stack
106-
6. ${cyan("arr sync")}\t\t\t\tFetch & rebase after reviews
106+
6. ${cyan("arr merge")}\t\t\t\tMerge PRs from the CLI
107+
7. ${cyan("arr sync")}\t\t\t\tFetch & rebase after reviews
107108
108109
${bold("ESCAPE HATCH")}
109110
${cyan("arr exit")}\t\t\t\tSwitch back to plain git if you need it.

‎apps/cli/toggle.sh‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎packages/core/src/commands.ts‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface CommandInfo {
88
context: ContextLevel;
99
category: CommandCategory;
1010
core?: boolean;
11+
disabled?: boolean;
1112
}
1213

1314
export type CommandCategory =
@@ -49,7 +50,7 @@ export const COMMANDS: Record<string, CommandInfo> = {
4950
aliases: ["m"],
5051
context: "jj",
5152
category: "workflow",
52-
core: true,
53+
disabled: true,
5354
},
5455
submit: {
5556
name: "submit",
@@ -146,6 +147,7 @@ export const COMMANDS: Record<string, CommandInfo> = {
146147
aliases: ["cont"],
147148
context: "jj",
148149
category: "management",
150+
disabled: true,
149151
},
150152
delete: {
151153
name: "delete",
@@ -154,19 +156,21 @@ export const COMMANDS: Record<string, CommandInfo> = {
154156
aliases: ["dl"],
155157
context: "jj",
156158
category: "management",
159+
disabled: true,
157160
},
158161
merge: {
159162
name: "merge",
160-
description: "Merge the PR for the current change via GitHub",
163+
description: "Merge PRs from trunk to the current change via GitHub",
161164
context: "jj",
162165
category: "management",
166+
core: true,
163167
},
164168
restack: {
165169
name: "restack",
166170
description: "Rebase the current stack onto trunk",
167171
context: "jj",
168172
category: "management",
169-
core: true,
173+
disabled: true,
170174
},
171175
undo: {
172176
name: "undo",
@@ -240,15 +244,18 @@ export function resolveCommandAlias(alias: string): string {
240244
}
241245

242246
export function isKnownCommand(command: string): boolean {
243-
return command in COMMANDS;
247+
const cmd = COMMANDS[command];
248+
return cmd !== undefined && !cmd.disabled;
244249
}
245250

246251
export function getCommandsByCategory(
247252
category: CommandCategory,
248253
): CommandInfo[] {
249-
return Object.values(COMMANDS).filter((cmd) => cmd.category === category);
254+
return Object.values(COMMANDS).filter(
255+
(cmd) => cmd.category === category && !cmd.disabled,
256+
);
250257
}
251258

252259
export function getCoreCommands(): CommandInfo[] {
253-
return Object.values(COMMANDS).filter((cmd) => cmd.core);
260+
return Object.values(COMMANDS).filter((cmd) => cmd.core && !cmd.disabled);
254261
}

0 commit comments

Comments
 (0)