gearbox-code 0.1.5 → 0.1.7

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
@@ -46,14 +46,21 @@ bun run scripts/preview.tsx
46
46
 
47
47
  ## Install
48
48
 
49
- One command, no sudo, no npm global permissions:
49
+ macOS, Linux, WSL:
50
50
 
51
51
  ```bash
52
- curl -fsSL https://raw.githubusercontent.com/AnayGarodia/gearbox/main/install.sh | bash
52
+ curl -fsSL https://unpkg.com/gearbox-code@latest/install.sh | bash
53
53
  ```
54
54
 
55
- The installer downloads the published `gearbox-code` package and creates a
56
- user-owned `gearbox` command in `~/.local/bin`.
55
+ Windows PowerShell:
56
+
57
+ ```powershell
58
+ irm https://unpkg.com/gearbox-code@latest/install.ps1 | iex
59
+ ```
60
+
61
+ The installers are served from the published npm package, download the latest
62
+ `gearbox-code` tarball, and create a user-owned `gearbox` command. They avoid
63
+ `sudo`, admin privileges, and `npm install -g`.
57
64
 
58
65
  Then:
59
66
 
package/dist/cli.mjs CHANGED
@@ -133686,6 +133686,235 @@ function ActivityRail({ items, width }) {
133686
133686
  ]
133687
133687
  }, undefined, true, undefined, this);
133688
133688
  }
133689
+ function SetupSplash({ state, width, skin, splashSize }) {
133690
+ const providers = featuredApiKeyProviders().slice(0, width >= 92 ? 12 : 8);
133691
+ const left = providers.filter((_, i2) => i2 % 2 === 0);
133692
+ const right = providers.filter((_, i2) => i2 % 2 === 1);
133693
+ const detected = state.importable.length + state.cloudImportable.length;
133694
+ const panelWidth = Math.min(Math.max(width - 4, 12), 104);
133695
+ const showTwoCols = panelWidth >= 82;
133696
+ const firstColumn = showTwoCols ? left : providers;
133697
+ const secondColumn = showTwoCols ? right : [];
133698
+ const providerLine = (id, label) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133699
+ color: color.dim,
133700
+ children: [
133701
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133702
+ color: color.accent,
133703
+ children: [
133704
+ "/account add ",
133705
+ id
133706
+ ]
133707
+ }, undefined, true, undefined, this),
133708
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133709
+ color: color.faint,
133710
+ children: [
133711
+ " ",
133712
+ label
133713
+ ]
133714
+ }, undefined, true, undefined, this)
133715
+ ]
133716
+ }, id, true, undefined, this);
133717
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
133718
+ flexDirection: "column",
133719
+ alignItems: "center",
133720
+ children: [
133721
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(MascotSplash, {
133722
+ skin,
133723
+ size: splashSize
133724
+ }, undefined, false, undefined, this),
133725
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
133726
+ marginTop: 1,
133727
+ flexDirection: "column",
133728
+ alignItems: "center",
133729
+ children: [
133730
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133731
+ color: color.accent,
133732
+ bold: true,
133733
+ children: "GEARBOX"
133734
+ }, undefined, false, undefined, this),
133735
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133736
+ color: color.text,
133737
+ children: "one terminal, every model account you already pay for"
133738
+ }, undefined, false, undefined, this),
133739
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133740
+ color: color.faint,
133741
+ children: "Set up one provider. Gearbox routes from there."
133742
+ }, undefined, false, undefined, this)
133743
+ ]
133744
+ }, undefined, true, undefined, this),
133745
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
133746
+ marginTop: 1,
133747
+ width: panelWidth,
133748
+ borderStyle: "round",
133749
+ borderColor: color.accentDim,
133750
+ paddingX: 2,
133751
+ paddingY: 1,
133752
+ flexDirection: "column",
133753
+ children: [
133754
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
133755
+ justifyContent: "space-between",
133756
+ children: [
133757
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133758
+ color: color.text,
133759
+ bold: true,
133760
+ children: "start here"
133761
+ }, undefined, false, undefined, this),
133762
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133763
+ color: detected ? color.ok : color.faint,
133764
+ children: detected ? `${detected} detected` : "no account yet"
133765
+ }, undefined, false, undefined, this)
133766
+ ]
133767
+ }, undefined, true, undefined, this),
133768
+ detected ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
133769
+ marginTop: 1,
133770
+ children: [
133771
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133772
+ color: color.ok,
133773
+ children: [
133774
+ glyph.on,
133775
+ " "
133776
+ ]
133777
+ }, undefined, true, undefined, this),
133778
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133779
+ color: color.text,
133780
+ children: "Credentials found on this machine: "
133781
+ }, undefined, false, undefined, this),
133782
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133783
+ color: color.accent,
133784
+ children: "/account import"
133785
+ }, undefined, false, undefined, this)
133786
+ ]
133787
+ }, undefined, true, undefined, this) : null,
133788
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
133789
+ marginTop: 1,
133790
+ flexDirection: showTwoCols ? "row" : "column",
133791
+ children: [
133792
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
133793
+ flexDirection: "column",
133794
+ width: showTwoCols ? Math.floor((panelWidth - 6) / 2) : undefined,
133795
+ children: [
133796
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133797
+ color: color.faint,
133798
+ children: "API key"
133799
+ }, undefined, false, undefined, this),
133800
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133801
+ color: color.text,
133802
+ children: [
133803
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133804
+ color: color.accent,
133805
+ children: "/account add <api-key>"
133806
+ }, undefined, false, undefined, this),
133807
+ " auto-detect when possible"
133808
+ ]
133809
+ }, undefined, true, undefined, this),
133810
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133811
+ color: color.text,
133812
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133813
+ color: color.accent,
133814
+ children: "/account add <provider> <api-key>"
133815
+ }, undefined, false, undefined, this)
133816
+ }, undefined, false, undefined, this)
133817
+ ]
133818
+ }, undefined, true, undefined, this),
133819
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
133820
+ flexDirection: "column",
133821
+ marginLeft: showTwoCols ? 4 : 0,
133822
+ marginTop: showTwoCols ? 0 : 1,
133823
+ children: [
133824
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133825
+ color: color.faint,
133826
+ children: "Subscriptions and cloud"
133827
+ }, undefined, false, undefined, this),
133828
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133829
+ color: color.text,
133830
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133831
+ color: color.accent,
133832
+ children: "/account add azure <endpoint> <api-key>"
133833
+ }, undefined, false, undefined, this)
133834
+ }, undefined, false, undefined, this),
133835
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133836
+ color: color.text,
133837
+ children: [
133838
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133839
+ color: color.accent,
133840
+ children: "/account add claude"
133841
+ }, undefined, false, undefined, this),
133842
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133843
+ color: color.faint,
133844
+ children: " "
133845
+ }, undefined, false, undefined, this),
133846
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133847
+ color: color.accent,
133848
+ children: "/account add codex"
133849
+ }, undefined, false, undefined, this)
133850
+ ]
133851
+ }, undefined, true, undefined, this)
133852
+ ]
133853
+ }, undefined, true, undefined, this)
133854
+ ]
133855
+ }, undefined, true, undefined, this),
133856
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
133857
+ marginTop: 1,
133858
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133859
+ color: color.faint,
133860
+ children: glyph.rule.repeat(Math.max(panelWidth - 6, 20))
133861
+ }, undefined, false, undefined, this)
133862
+ }, undefined, false, undefined, this),
133863
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
133864
+ marginTop: 1,
133865
+ flexDirection: showTwoCols ? "row" : "column",
133866
+ children: [
133867
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
133868
+ flexDirection: "column",
133869
+ width: showTwoCols ? Math.floor((panelWidth - 6) / 2) : undefined,
133870
+ children: [
133871
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133872
+ color: color.faint,
133873
+ children: "Common providers"
133874
+ }, undefined, false, undefined, this),
133875
+ firstColumn.map((p) => providerLine(p.id, p.label))
133876
+ ]
133877
+ }, undefined, true, undefined, this),
133878
+ secondColumn.length ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
133879
+ flexDirection: "column",
133880
+ marginLeft: 4,
133881
+ children: [
133882
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133883
+ color: color.faint,
133884
+ children: " "
133885
+ }, undefined, false, undefined, this),
133886
+ secondColumn.map((p) => providerLine(p.id, p.label))
133887
+ ]
133888
+ }, undefined, true, undefined, this) : null
133889
+ ]
133890
+ }, undefined, true, undefined, this),
133891
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
133892
+ marginTop: 1,
133893
+ justifyContent: "space-between",
133894
+ children: [
133895
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133896
+ color: color.faint,
133897
+ children: "Full catalog: "
133898
+ }, undefined, false, undefined, this),
133899
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133900
+ color: color.accent,
133901
+ children: "/onboard providers"
133902
+ }, undefined, false, undefined, this),
133903
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133904
+ color: color.faint,
133905
+ children: " Help: "
133906
+ }, undefined, false, undefined, this),
133907
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
133908
+ color: color.accent,
133909
+ children: "/account"
133910
+ }, undefined, false, undefined, this)
133911
+ ]
133912
+ }, undefined, true, undefined, this)
133913
+ ]
133914
+ }, undefined, true, undefined, this)
133915
+ ]
133916
+ }, undefined, true, undefined, this);
133917
+ }
133689
133918
  function App2({ selector: initialSelector, runner, fullscreen = false, resumeId }) {
133690
133919
  const { exit } = use_app_default();
133691
133920
  const { stdin, isRawModeSupported, setRawMode } = use_stdin_default();
@@ -135727,176 +135956,92 @@ function App2({ selector: initialSelector, runner, fullscreen = false, resumeId
135727
135956
  const hero = /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
135728
135957
  flexDirection: "column",
135729
135958
  alignItems: "center",
135730
- children: [
135731
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(MascotSplash, {
135732
- skin: ghostSkin,
135733
- size: splashSize
135734
- }, undefined, false, undefined, this),
135735
- setupRequired ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
135736
- marginTop: 1,
135737
- flexDirection: "column",
135738
- alignItems: "center",
135739
- children: [
135740
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135741
- color: color.text,
135742
- children: "setup required"
135743
- }, undefined, false, undefined, this),
135744
- onboardingState.importable.length || onboardingState.cloudImportable.length ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135745
- color: color.faint,
135746
- children: [
135747
- "detected credentials: ",
135748
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135749
- color: color.accent,
135750
- children: "/account import"
135751
- }, undefined, false, undefined, this)
135752
- ]
135753
- }, undefined, true, undefined, this) : null,
135754
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135755
- color: color.faint,
135756
- children: [
135757
- "add any provider key: ",
135758
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135759
- color: color.accent,
135760
- children: "/account add <provider> <api-key>"
135761
- }, undefined, false, undefined, this)
135762
- ]
135763
- }, undefined, true, undefined, this),
135764
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135765
- color: color.faint,
135766
- children: [
135767
- "paste-detect: ",
135768
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135769
- color: color.accent,
135770
- children: "/account add <api-key>"
135771
- }, undefined, false, undefined, this),
135772
- " · list: ",
135773
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135774
- color: color.accent,
135775
- children: "/onboard providers"
135776
- }, undefined, false, undefined, this)
135777
- ]
135778
- }, undefined, true, undefined, this),
135779
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
135780
- marginTop: 1,
135781
- flexDirection: "column",
135782
- alignItems: "flex-start",
135783
- children: [
135784
- featuredApiKeyProviders().slice(0, 6).map((p) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135785
- color: color.dim,
135786
- children: [
135787
- " ",
135788
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135789
- color: color.accent,
135790
- children: [
135791
- "/account add ",
135792
- p.id,
135793
- " <api-key>"
135794
- ]
135795
- }, undefined, true, undefined, this),
135796
- " ",
135797
- p.label
135798
- ]
135799
- }, p.id, true, undefined, this)),
135800
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135801
- color: color.dim,
135802
- children: [
135803
- " ",
135804
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135805
- color: color.accent,
135806
- children: "/account add azure <endpoint> <api-key>"
135807
- }, undefined, false, undefined, this),
135808
- " Azure OpenAI / Foundry"
135809
- ]
135810
- }, undefined, true, undefined, this)
135811
- ]
135812
- }, undefined, true, undefined, this),
135813
- onboardingState.hasClaudeCli || onboardingState.hasCodexCli ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135814
- color: color.faint,
135815
- children: [
135816
- onboardingState.hasClaudeCli ? "/account add claude" : "",
135817
- onboardingState.hasClaudeCli && onboardingState.hasCodexCli ? " · " : "",
135818
- onboardingState.hasCodexCli ? "/account add codex" : ""
135819
- ]
135820
- }, undefined, true, undefined, this) : null
135821
- ]
135822
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
135823
- children: [
135824
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
135825
- marginTop: 1,
135826
- children: [
135827
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135828
- color: color.dim,
135829
- children: "talk or type "
135830
- }, undefined, false, undefined, this),
135831
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135832
- color: color.faint,
135833
- children: [
135834
- glyph.bullet,
135835
- " "
135836
- ]
135837
- }, undefined, true, undefined, this),
135838
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135839
- color: color.accentDim,
135840
- children: "/"
135841
- }, undefined, false, undefined, this),
135842
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135843
- color: color.dim,
135844
- children: "commands "
135845
- }, undefined, false, undefined, this),
135846
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135847
- color: color.accentDim,
135848
- children: "@"
135849
- }, undefined, false, undefined, this),
135850
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135851
- color: color.dim,
135852
- children: "files "
135853
- }, undefined, false, undefined, this),
135854
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135855
- color: color.accentDim,
135856
- children: "!"
135857
- }, undefined, false, undefined, this),
135858
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135859
- color: color.dim,
135860
- children: "shell"
135861
- }, undefined, false, undefined, this)
135862
- ]
135863
- }, undefined, true, undefined, this),
135864
- firstRunRef.current ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
135865
- marginTop: 1,
135866
- flexDirection: "column",
135867
- alignItems: "center",
135868
- children: [
135869
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135870
- color: color.faint,
135871
- children: [
135872
- "new here? press ",
135873
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135874
- color: color.accent,
135875
- children: "?"
135876
- }, undefined, false, undefined, this),
135877
- " for shortcuts · ",
135878
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135879
- color: color.accent,
135880
- children: "shift+tab"
135881
- }, undefined, false, undefined, this),
135882
- " cycles modes · ",
135883
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135884
- color: color.accent,
135885
- children: "⌃Y"
135886
- }, undefined, false, undefined, this),
135887
- " copies the last reply"
135888
- ]
135889
- }, undefined, true, undefined, this),
135890
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135891
- color: color.faint,
135892
- children: "/config inline on for terminal scrollback · /keys for shortcuts"
135893
- }, undefined, false, undefined, this)
135894
- ]
135895
- }, undefined, true, undefined, this) : null
135896
- ]
135897
- }, undefined, true, undefined, this)
135898
- ]
135899
- }, undefined, true, undefined, this);
135959
+ children: setupRequired ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(SetupSplash, {
135960
+ state: onboardingState,
135961
+ width,
135962
+ skin: ghostSkin,
135963
+ splashSize
135964
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
135965
+ children: [
135966
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(MascotSplash, {
135967
+ skin: ghostSkin,
135968
+ size: splashSize
135969
+ }, undefined, false, undefined, this),
135970
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
135971
+ marginTop: 1,
135972
+ children: [
135973
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135974
+ color: color.dim,
135975
+ children: "talk or type "
135976
+ }, undefined, false, undefined, this),
135977
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135978
+ color: color.faint,
135979
+ children: [
135980
+ glyph.bullet,
135981
+ " "
135982
+ ]
135983
+ }, undefined, true, undefined, this),
135984
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135985
+ color: color.accentDim,
135986
+ children: "/"
135987
+ }, undefined, false, undefined, this),
135988
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135989
+ color: color.dim,
135990
+ children: "commands "
135991
+ }, undefined, false, undefined, this),
135992
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135993
+ color: color.accentDim,
135994
+ children: "@"
135995
+ }, undefined, false, undefined, this),
135996
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
135997
+ color: color.dim,
135998
+ children: "files "
135999
+ }, undefined, false, undefined, this),
136000
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
136001
+ color: color.accentDim,
136002
+ children: "!"
136003
+ }, undefined, false, undefined, this),
136004
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
136005
+ color: color.dim,
136006
+ children: "shell"
136007
+ }, undefined, false, undefined, this)
136008
+ ]
136009
+ }, undefined, true, undefined, this),
136010
+ firstRunRef.current ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
136011
+ marginTop: 1,
136012
+ flexDirection: "column",
136013
+ alignItems: "center",
136014
+ children: [
136015
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
136016
+ color: color.faint,
136017
+ children: [
136018
+ "new here? press ",
136019
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
136020
+ color: color.accent,
136021
+ children: "?"
136022
+ }, undefined, false, undefined, this),
136023
+ " for shortcuts · ",
136024
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
136025
+ color: color.accent,
136026
+ children: "shift+tab"
136027
+ }, undefined, false, undefined, this),
136028
+ " cycles modes · ",
136029
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
136030
+ color: color.accent,
136031
+ children: "⌃Y"
136032
+ }, undefined, false, undefined, this),
136033
+ " copies the last reply"
136034
+ ]
136035
+ }, undefined, true, undefined, this),
136036
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
136037
+ color: color.faint,
136038
+ children: "/config inline on for terminal scrollback · /keys for shortcuts"
136039
+ }, undefined, false, undefined, this)
136040
+ ]
136041
+ }, undefined, true, undefined, this) : null
136042
+ ]
136043
+ }, undefined, true, undefined, this)
136044
+ }, undefined, false, undefined, this);
135900
136045
  const paletteJsx = pickerRows.length || cmdMatches.length || fileMatches.length ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
135901
136046
  flexDirection: "column",
135902
136047
  children: [
@@ -136099,7 +136244,7 @@ function App2({ selector: initialSelector, runner, fullscreen = false, resumeId
136099
136244
  var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
136100
136245
  process.env.LANG = process.env.LANG || "en_US.UTF-8";
136101
136246
  process.env.LC_ALL = process.env.LC_ALL || "en_US.UTF-8";
136102
- var VERSION16 = "0.1.5";
136247
+ var VERSION16 = "0.1.7";
136103
136248
  var args = process.argv.slice(2);
136104
136249
  if (args[0] === "upgrade" || args[0] === "update") {
136105
136250
  const root2 = resolve11(import.meta.dir, "..");
package/install.ps1 ADDED
@@ -0,0 +1,87 @@
1
+ $ErrorActionPreference = "Stop"
2
+
3
+ # Public Gearbox installer for Windows PowerShell.
4
+ #
5
+ # Installs the published npm package into user-owned directories:
6
+ # %LOCALAPPDATA%\Gearbox\versions\<version>\cli.mjs
7
+ # %LOCALAPPDATA%\Gearbox\bin\gearbox.cmd
8
+ #
9
+ # It avoids npm global installs, admin privileges, Program Files, and system PATH
10
+ # writes. The user PATH is updated when needed.
11
+
12
+ $PackageName = if ($env:GEARBOX_PACKAGE) { $env:GEARBOX_PACKAGE } else { "gearbox-code" }
13
+ $Version = if ($env:GEARBOX_VERSION) { $env:GEARBOX_VERSION } else { "latest" }
14
+ $InstallRoot = if ($env:GEARBOX_INSTALL_DIR) { $env:GEARBOX_INSTALL_DIR } else { Join-Path $env:LOCALAPPDATA "Gearbox" }
15
+ $BinDir = if ($env:GEARBOX_BIN_DIR) { $env:GEARBOX_BIN_DIR } else { Join-Path $InstallRoot "bin" }
16
+
17
+ function Require-Command($Name, $InstallHint) {
18
+ if (-not (Get-Command $Name -ErrorAction SilentlyContinue)) {
19
+ Write-Error "Gearbox installer needs '$Name'. $InstallHint"
20
+ }
21
+ }
22
+
23
+ Require-Command "node" "Install Node.js, then rerun this installer."
24
+ Require-Command "tar" "Install a current Windows build or Git for Windows, then rerun this installer."
25
+
26
+ $Temp = Join-Path ([System.IO.Path]::GetTempPath()) ("gearbox-install-" + [System.Guid]::NewGuid().ToString("N"))
27
+ New-Item -ItemType Directory -Path $Temp | Out-Null
28
+
29
+ try {
30
+ $MetaUrl = "https://registry.npmjs.org/$PackageName/$Version"
31
+ $MetaFile = Join-Path $Temp "meta.json"
32
+ Write-Host "-> Fetching $PackageName@$Version"
33
+ Invoke-WebRequest -Uri $MetaUrl -OutFile $MetaFile -UseBasicParsing
34
+
35
+ $Meta = Get-Content $MetaFile -Raw | ConvertFrom-Json
36
+ $ResolvedVersion = $Meta.version
37
+ $TarballUrl = $Meta.dist.tarball
38
+ if (-not $ResolvedVersion -or -not $TarballUrl) {
39
+ Write-Error "Could not resolve $PackageName@$Version from npm."
40
+ }
41
+
42
+ $TargetDir = Join-Path (Join-Path $InstallRoot "versions") $ResolvedVersion
43
+ $Archive = Join-Path $Temp "package.tgz"
44
+ $ExtractDir = Join-Path $Temp "extract"
45
+
46
+ Write-Host "-> Downloading $PackageName@$ResolvedVersion"
47
+ Invoke-WebRequest -Uri $TarballUrl -OutFile $Archive -UseBasicParsing
48
+ New-Item -ItemType Directory -Force -Path $ExtractDir, $TargetDir, $BinDir | Out-Null
49
+ tar -xzf $Archive -C $ExtractDir
50
+
51
+ $Cli = Join-Path $ExtractDir "package\dist\cli.mjs"
52
+ if (-not (Test-Path $Cli)) {
53
+ Write-Error "Package did not contain dist/cli.mjs."
54
+ }
55
+
56
+ $TargetCli = Join-Path $TargetDir "cli.mjs"
57
+ Copy-Item $Cli $TargetCli -Force
58
+
59
+ $CmdPath = Join-Path $BinDir "gearbox.cmd"
60
+ $Cmd = @"
61
+ @echo off
62
+ node "$TargetCli" %*
63
+ "@
64
+ Set-Content -Path $CmdPath -Value $Cmd -Encoding ASCII
65
+
66
+ $UserPath = [Environment]::GetEnvironmentVariable("Path", "User")
67
+ $PathParts = @()
68
+ if ($UserPath) { $PathParts = $UserPath -split ";" }
69
+ $AlreadyOnPath = $PathParts | Where-Object { $_ -ieq $BinDir }
70
+ if (-not $AlreadyOnPath) {
71
+ $NextPath = if ($UserPath) { "$UserPath;$BinDir" } else { $BinDir }
72
+ [Environment]::SetEnvironmentVariable("Path", $NextPath, "User")
73
+ $env:Path = "$env:Path;$BinDir"
74
+ }
75
+
76
+ Write-Host ""
77
+ Write-Host "Installed Gearbox $ResolvedVersion"
78
+ Write-Host " $CmdPath"
79
+ Write-Host ""
80
+ Write-Host "Run it with: gearbox"
81
+ if (-not $AlreadyOnPath) {
82
+ Write-Host "Open a new terminal if this shell does not pick up the PATH change."
83
+ }
84
+ }
85
+ finally {
86
+ Remove-Item -Recurse -Force $Temp -ErrorAction SilentlyContinue
87
+ }
package/install.sh ADDED
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env bash
2
+ # Public Gearbox installer.
3
+ #
4
+ # Installs the published npm package into user-owned directories:
5
+ # ~/.local/share/gearbox/<version>/cli.mjs
6
+ # ~/.local/bin/gearbox
7
+ #
8
+ # This intentionally avoids `npm install -g`, sudo, /usr/local, and any system
9
+ # prefix. It follows the same practical model as modern CLI installers: place a
10
+ # small executable shim in a user bin directory and tell the user if that
11
+ # directory is not on PATH.
12
+ set -euo pipefail
13
+
14
+ PACKAGE_NAME="${GEARBOX_PACKAGE:-gearbox-code}"
15
+ VERSION="${GEARBOX_VERSION:-latest}"
16
+ BIN_DIR="${GEARBOX_BIN_DIR:-${HOME}/.local/bin}"
17
+ INSTALL_ROOT="${GEARBOX_INSTALL_DIR:-${HOME}/.local/share/gearbox}"
18
+
19
+ need() {
20
+ if ! command -v "$1" >/dev/null 2>&1; then
21
+ echo "Gearbox installer needs '$1'." >&2
22
+ echo "Install Node.js first, then rerun this installer." >&2
23
+ exit 1
24
+ fi
25
+ }
26
+
27
+ need node
28
+ need curl
29
+ need tar
30
+
31
+ tmp="$(mktemp -d)"
32
+ cleanup() {
33
+ rm -rf "$tmp"
34
+ }
35
+ trap cleanup EXIT
36
+
37
+ meta_url="https://registry.npmjs.org/${PACKAGE_NAME}/${VERSION}"
38
+ meta_file="${tmp}/meta.json"
39
+
40
+ echo "-> Fetching ${PACKAGE_NAME}@${VERSION}"
41
+ curl -fsSL "$meta_url" -o "$meta_file"
42
+
43
+ resolved_version="$(node -e 'const fs=require("fs"); const j=JSON.parse(fs.readFileSync(process.argv[1],"utf8")); console.log(j.version || "")' "$meta_file")"
44
+ tarball_url="$(node -e 'const fs=require("fs"); const j=JSON.parse(fs.readFileSync(process.argv[1],"utf8")); console.log(j.dist && j.dist.tarball || "")' "$meta_file")"
45
+
46
+ if [[ -z "$resolved_version" || -z "$tarball_url" ]]; then
47
+ echo "Could not resolve ${PACKAGE_NAME}@${VERSION} from npm." >&2
48
+ exit 1
49
+ fi
50
+
51
+ target_dir="${INSTALL_ROOT}/${resolved_version}"
52
+ archive="${tmp}/package.tgz"
53
+ extract_dir="${tmp}/extract"
54
+
55
+ echo "-> Downloading ${PACKAGE_NAME}@${resolved_version}"
56
+ curl -fsSL "$tarball_url" -o "$archive"
57
+ mkdir -p "$extract_dir" "$target_dir" "$BIN_DIR"
58
+ tar -xzf "$archive" -C "$extract_dir"
59
+
60
+ if [[ ! -f "${extract_dir}/package/dist/cli.mjs" ]]; then
61
+ echo "Package did not contain dist/cli.mjs." >&2
62
+ exit 1
63
+ fi
64
+
65
+ cp "${extract_dir}/package/dist/cli.mjs" "${target_dir}/cli.mjs"
66
+ chmod 0755 "${target_dir}/cli.mjs"
67
+
68
+ cat > "${BIN_DIR}/gearbox" <<EOF
69
+ #!/usr/bin/env sh
70
+ exec node "${target_dir}/cli.mjs" "\$@"
71
+ EOF
72
+ chmod 0755 "${BIN_DIR}/gearbox"
73
+
74
+ echo ""
75
+ echo "Installed Gearbox ${resolved_version}"
76
+ echo " ${BIN_DIR}/gearbox"
77
+ echo ""
78
+
79
+ case ":${PATH}:" in
80
+ *":${BIN_DIR}:"*)
81
+ echo "Run it with: gearbox"
82
+ ;;
83
+ *)
84
+ shell_name="$(basename "${SHELL:-sh}")"
85
+ rc_file="${HOME}/.profile"
86
+ if [[ "$shell_name" == "zsh" ]]; then rc_file="${HOME}/.zshrc"; fi
87
+ if [[ "$shell_name" == "bash" ]]; then rc_file="${HOME}/.bashrc"; fi
88
+ echo "${BIN_DIR} is not on PATH yet."
89
+ echo "Add it with:"
90
+ echo " echo 'export PATH=\"${BIN_DIR}:\$PATH\"' >> ${rc_file}"
91
+ echo " source ${rc_file}"
92
+ echo ""
93
+ echo "Then run: gearbox"
94
+ ;;
95
+ esac
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gearbox-code",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "A beautiful multi-provider coding harness for the terminal. (Intelligent model routing lands on top of this soon.)",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -8,7 +8,9 @@
8
8
  "gearbox": "dist/cli.mjs"
9
9
  },
10
10
  "files": [
11
- "dist/cli.mjs"
11
+ "dist/cli.mjs",
12
+ "install.sh",
13
+ "install.ps1"
12
14
  ],
13
15
  "scripts": {
14
16
  "start": "bun run src/cli.tsx",