Repository navigation
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·990 lines (924 loc) · 45.7 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·990 lines (924 loc) · 45.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
#!/usr/bin/env bash
# ──────────────────────────────────────────────────────────────────────
# Kiro Crew from-source installer (contributor layout)
# Builds the git clone it sits in, on macOS and Linux. Public build — no Brazil
# workspace, no internal tooling required. Uses python3/pip (backend) +
# npm/vite (frontend).
#
# This is NOT the end-user install. The result follows the clone's checked-out
# branch, and `main` is the Nightly lane: dev builds (0.X.0.devYYYYMMDD) ahead of
# Stable, which the desktop app and the one-line install follow. For a Stable
# install on a laptop or a server, use the signed wheel instead:
# curl -fsSL https://download.crew.kiro.dev/cli.sh | sh
#
# Usage (from a local clone):
# git clone https://github.com/kirodotdev/KiroCrew.git
# cd kirocrew
# bash install.sh
#
# Options:
# --voice Install optional voice extras (pip install -e .[voice])
# --no-kas Use Kiro CLI only: saves agent.kas_bundle off and skips
# downloading the KAS engine this release pins. By default
# the installer runs `kirocrew kas install` after installing, so
# the built-in engine route can be turned on with no download; a
# failed download only warns and prints the command to retry.
# The switch (agent.kas_bundle) is NOT turned on: a source
# checkout defaults to kiro-cli until you choose the engine
# yourself. (--kas, the former opt-in, is still
# accepted and changes nothing.)
# --mise Use mise (https://mise.jdx.dev) for Python and Node.js
# instead of system package managers. Does not modify your
# global mise config.
#
# Env:
# KIROCREW_ALLOW_SOURCE_BUILDS=1
# Let pip compile a dependency that has no prebuilt wheel for this
# host (needs a C toolchain and -dev headers). By default the
# install uses prebuilt wheels only and refuses instead of building.
# ──────────────────────────────────────────────────────────────────────
set -euo pipefail
# Isolate the managed venv from any inherited PYTHONPATH/PYTHONHOME. If the
# caller's environment points these at foreign site-packages (e.g. another
# app's interpreter on a different Python version), pip treats those packages
# as already satisfied and silently skips installing our dependencies into the
# venv -- producing a broken install (ImportError: No module named 'aiohttp').
unset PYTHONPATH PYTHONHOME
# ── Parse arguments ──
USE_MISE=0
WITH_VOICE=0
KAS_DOWNLOAD_FAILED=0
KAS_HOST_UNSUPPORTED=0
WITH_KAS=1
for _arg in "$@"; do
case "$_arg" in
--mise) USE_MISE=1 ;;
--voice) WITH_VOICE=1 ;;
--kas) WITH_KAS=1 ;;
--no-kas) WITH_KAS=0 ;;
*) echo "Error: unknown argument '$_arg'" >&2; exit 1 ;;
esac
done
# ── Constants ──
# Repo root = directory containing this script (run from a local clone).
KIROCREW_APP_DIR="$(cd "$(dirname "$0")" && pwd)"
# Data home: honor KIROCREW_HOME, else the current default ~/.kiro/crew (NOT the
# pre-move ~/.kirocrew, which is not the data home).
# The app expands a leading ~ in KIROCREW_HOME, and a quoted value reaches this
# script unexpanded, so expand it once here for every read and child below.
case "${KIROCREW_HOME:-}" in "~" | "~/"*) KIROCREW_HOME="$HOME${KIROCREW_HOME#?}" ;; esac
KIROCREW_DATA_DIR="${KIROCREW_HOME:-$HOME/.kiro/crew}"
NODE_VERSION="24"
# Minimum Node version (major.minor.patch) Kiro Crew supports -- the same
# floor as MIN_NODE_VERSION in src/kiro_crew/constants.py and ensure-node.sh.
# A full version, not a major: an early 22.x lacks APIs the code needs
# (worker_threads.markAsUncloneable landed in 22.10.0) and is below the
# bundler's declared ">=22.12.0". Defined here (not just at the post-install
# check) because DETECTION consults it: a pre-existing but too-old node must
# not short-circuit the install ladder.
NODE_MIN_VERSION="22.12.0"
PYTHON_VERSION="3.12"
KIROCREW_PORT="${KIROCREW_PORT:-5476}"
# ACP_NPM_PKG and acp_adapter_spec (the exact pinned version).
# shellcheck source=scripts/lib/acp-adapter-pin.sh
. "$KIROCREW_APP_DIR/scripts/lib/acp-adapter-pin.sh"
# ── Colors & Formatting ──
if [ -t 1 ] && command -v tput >/dev/null 2>&1; then
BOLD=$(tput bold)
DIM=$(tput dim)
RESET=$(tput sgr0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
else
BOLD="" DIM="" RESET=""
RED="" GREEN="" YELLOW="" BLUE="" MAGENTA="" CYAN=""
fi
# ── UI Helpers ──
_STEP=0
_TOTAL_STEPS=5
banner() {
echo ""
echo "${MAGENTA}${BOLD}"
cat << 'BANNER'
_ ___ ___
| |/ (_)_ _ ___ / __|_ _ _____ __ __
| ' <| | '_/ _ \ | (__| '_/ -_) V V /
|_|\_\_|_| \___/ \___|_| \___|\_/\_/
BANNER
echo "${RESET}"
echo " ${DIM}Your personal AI agent${RESET}"
echo " ${DIM}────────────────────────────────────────${RESET}"
echo ""
}
step() {
_STEP=$((_STEP + 1))
echo ""
echo " ${BLUE}${BOLD}[$_STEP/$_TOTAL_STEPS]${RESET} ${BOLD}$1${RESET}"
echo " ${DIM}$(printf '%.0s─' $(seq 1 50))${RESET}"
}
info() { echo " ${DIM}→${RESET} $1"; }
ok() { echo " ${GREEN}✓${RESET} $1"; }
warn() { echo " ${YELLOW}⚠${RESET} $1"; }
fail() { echo " ${RED}✗${RESET} $1"; }
detail() { echo " ${DIM}$1${RESET}"; }
die() {
echo ""
fail "$1"
echo ""
echo " ${DIM}Need help? See the README or open an issue on GitHub.${RESET}"
echo ""
exit 1
}
spinner() {
local pid=$1 msg=$2
local frames='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
local i=0
while kill -0 "$pid" 2>/dev/null; do
printf "\r ${DIM}%s${RESET} %s" "${frames:i%${#frames}:1}" "$msg"
i=$((i + 1))
sleep 0.1
done
printf "\r"
}
has() { command -v "$1" >/dev/null 2>&1; }
# What the clone is checked out at, as `branch:<name>`, `detached:<tag or sha>`,
# or `unknown` (no git, or not a work tree). A from-source install follows
# exactly this, so it decides which lane the box ends up on.
source_checkout_ref() {
_ref="$(git -C "$KIROCREW_APP_DIR" symbolic-ref --short -q HEAD 2>/dev/null)" \
&& [ -n "$_ref" ] && { printf 'branch:%s\n' "$_ref"; return 0; }
_ref="$(git -C "$KIROCREW_APP_DIR" describe --tags --exact-match HEAD 2>/dev/null \
|| git -C "$KIROCREW_APP_DIR" rev-parse --short HEAD 2>/dev/null)" \
&& [ -n "$_ref" ] && { printf 'detached:%s\n' "$_ref"; return 0; }
printf 'unknown\n'
}
# Say which lane this install follows and where the Stable install lives, so a
# box set up from a clone does not land on Nightly by surprise.
source_lane_notice() {
_lane_ref="$(source_checkout_ref)"
case "$_lane_ref" in
branch:main)
warn "This clone is on ${BOLD}main${RESET}: the install follows the ${BOLD}Nightly${RESET} lane"
detail "(dev builds ahead of Stable). This installer is for contributors." ;;
branch:*)
warn "This clone is on branch ${BOLD}${_lane_ref#branch:}${RESET}: the install follows that branch, not a release lane." ;;
detached:*)
warn "This clone is pinned at ${BOLD}${_lane_ref#detached:}${RESET} (detached HEAD): git pull cannot update it; a release-tag clone updates with kirocrew update --release VERSION." ;;
*)
warn "This is a from-source install: it follows the clone, not a release lane." ;;
esac
# Named by URL and guide, not as a `curl … | sh` line: this script never
# prints or runs a pipe-to-shell (test_installer_tool_pins.py).
detail "For Stable on a laptop or server, use the one-line install of the signed"
detail "wheel instead: https://download.crew.kiro.dev/cli.sh (docs/guides/install.md)."
}
# True only when a usable node is on PATH: present AND at or above the build's
# supported floor. `has node` alone was not enough -- Amazon Linux 2023 ships
# node 18, so the "already installed" branch matched, every install branch
# (including nvm) was skipped, and the frontend build then ran under an
# unsupported node and produced no usable dist. A broken binary reports v0 and
# fails the comparison, which is the intended answer.
node_supported() {
has node || return 1
_nv="$( { node --version 2>/dev/null || echo v0; } | sed 's/^v//')"
_maj="$(printf '%s' "$_nv" | cut -d. -f1)"
_min="$(printf '%s.0' "$_nv" | cut -d. -f2)"
_pat="$(printf '%s.0.0' "$_nv" | cut -d. -f3)"
_fmaj="$(printf '%s' "$NODE_MIN_VERSION" | cut -d. -f1)"
_fmin="$(printf '%s' "$NODE_MIN_VERSION" | cut -d. -f2)"
_fpat="$(printf '%s' "$NODE_MIN_VERSION" | cut -d. -f3)"
[ "$_maj" -gt "$_fmaj" ] 2>/dev/null && return 0
[ "$_maj" -eq "$_fmaj" ] 2>/dev/null || return 1
[ "$_min" -gt "$_fmin" ] 2>/dev/null && return 0
[ "$_min" -eq "$_fmin" ] 2>/dev/null || return 1
[ "$_pat" -ge "$_fpat" ] 2>/dev/null
}
# Install a supported Node through ensure-node.sh (pinned, checksum-verified
# mise or glibc-217 build; an existing nvm is reused), then put the node it
# recorded on this shell's PATH. Never pipes a remote installer into a shell.
install_node_via_ensure() {
bash "$KIROCREW_APP_DIR/ensure-node.sh" || true
if [ -s "$KIROCREW_DATA_DIR/node-bin-dir" ]; then
PATH="$(cat "$KIROCREW_DATA_DIR/node-bin-dir"):$PATH"
export PATH
fi
}
# After a distro package install ($1 names the package manager): keep its Node
# only when it meets the floor. A distro Node below it (node 18 on Amazon Linux
# 2023, Debian's archive) cannot build the dashboard, so install a supported one
# through ensure-node.sh instead of building against it.
node_to_floor() {
if node_supported; then
ok "Node.js $(node --version) installed via $1"
return 0
fi
info "The $1 Node.js is missing or below v$NODE_MIN_VERSION — installing Node.js $NODE_VERSION via ensure-node.sh…"
install_node_via_ensure
if node_supported; then
ok "Node.js $(node --version) now active"
else
warn "Node.js is still below v$NODE_MIN_VERSION — the frontend build will fail"
fi
}
# ── Pre-flight ──
banner
echo " ${DIM}Repo directory:${RESET} $KIROCREW_APP_DIR"
echo " ${DIM}Data directory:${RESET} $KIROCREW_DATA_DIR"
echo " ${DIM}Platform:${RESET} $(uname -s) $(uname -m)"
echo ""
if [ ! -f "$KIROCREW_APP_DIR/pyproject.toml" ]; then
die "Run this from inside a KiroCrew clone (pyproject.toml not found in $KIROCREW_APP_DIR).
git clone https://github.com/kirodotdev/KiroCrew.git && cd kirocrew && bash install.sh"
fi
source_lane_notice
echo ""
# ══════════════════════════════════════════════════════════════════════
# Step 1: Dependencies
# ══════════════════════════════════════════════════════════════════════
step "Dependencies"
# ── mise runtimes (opt-in via --mise) ──
if [ "$USE_MISE" -eq 1 ]; then
if ! has mise; then
info "Installing mise…"
# A pinned release checked against a recorded sha256, never a piped script.
# shellcheck source=scripts/lib/pinned-mise.sh
. "$KIROCREW_APP_DIR/scripts/lib/pinned-mise.sh"
MISE_INSTALL_PATH="$HOME/.local/bin/mise" install_pinned_mise || true
export PATH="$HOME/.local/bin:$PATH"
has mise || die "mise installation failed. Install manually: https://mise.jdx.dev/installing-mise.html"
fi
ok "mise $("$HOME/.local/bin/mise" version 2>/dev/null || mise version)"
_mise_log=$(mktemp)
info "Installing Python $PYTHON_VERSION via mise…"
mise install "python@$PYTHON_VERSION" -y 2>"$_mise_log" \
|| { cat "$_mise_log" >&2; die "Failed to install Python $PYTHON_VERSION via mise"; }
_py_prefix="$(mise where "python@$PYTHON_VERSION")" \
|| die "mise installed Python but 'mise where' failed — check mise status"
[ -n "$_py_prefix" ] || die "mise where returned an empty path for Python"
[ -x "$_py_prefix/bin/python3" ] \
|| die "Python binary not found at $_py_prefix/bin/python3"
_py="$_py_prefix/bin/python3"
_py_ver=$("$_py" -c "import sys; v=sys.version_info; print(f'{v.major}.{v.minor}')")
ok "Python $_py_ver ($_py) [mise]"
info "Installing Node.js $NODE_VERSION via mise…"
mise install "node@$NODE_VERSION" -y 2>"$_mise_log" \
|| { cat "$_mise_log" >&2; die "Failed to install Node.js $NODE_VERSION via mise"; }
_node_prefix="$(mise where "node@$NODE_VERSION")" \
|| die "mise installed Node.js but 'mise where' failed — check mise status"
[ -n "$_node_prefix" ] || die "mise where returned an empty path for Node.js"
[ -x "$_node_prefix/bin/node" ] \
|| die "Node binary not found at $_node_prefix/bin/node"
export PATH="$_node_prefix/bin:$_py_prefix/bin:$PATH"
ok "Node.js $(node --version) [mise]"
rm -f "$_mise_log"
fi
# ── Python ──
if [ "$USE_MISE" -eq 0 ]; then
info "Checking Python…"
_py=""
_find_python() {
for _candidate in python3.12 python3.13 python3 python; do
if has "$_candidate"; then
_ok=$("$_candidate" -c "import sys; print(int(sys.version_info >= (3, 12)))" 2>/dev/null || echo "0")
if [ "$_ok" = "1" ]; then
_ver=$("$_candidate" -c "import sys; v=sys.version_info; print(f'{v.major}.{v.minor}')" 2>/dev/null)
_py="$_candidate"
ok "Python $_ver ($( which "$_candidate" ))"
return 0
fi
fi
done
return 1
}
# Provision Python $PYTHON_VERSION without a package manager, for hosts whose
# archive carries no python3.12 (Ubuntu 22.04, Debian 12, RHEL/CentOS 7). mise
# ships python-build-standalone builds, which run on old glibc. Every probe
# below tries this before giving up: without it the >= 3.12 floor turns a host
# the package manager cannot satisfy into a hard abort, where the >= 3.10 floor
# had simply accepted the distro's own python3.
_bootstrap_python() {
# Deliberately does NOT install mise itself. Fetching an installer script over
# the network and piping it to a shell executes unverified remote content as
# the user, and unlike the `--mise` block below this path runs WITHOUT the user
# asking for it -- so an automatic fallback must not introduce that. Use mise
# only when the host already has it; otherwise the caller stops with guidance.
if [ -x "$HOME/.local/bin/mise" ]; then
export PATH="$HOME/.local/bin:$PATH"
fi
has mise || return 1
info "Provisioning Python $PYTHON_VERSION via the installed mise…"
mise install "python@$PYTHON_VERSION" -y >/dev/null 2>&1 || return 1
_bootstrap_prefix="$(mise where "python@$PYTHON_VERSION" 2>/dev/null)" || return 1
[ -n "$_bootstrap_prefix" ] || return 1
[ -x "$_bootstrap_prefix/bin/python3" ] || return 1
# Prepend rather than assigning _py directly, so _find_python stays the one
# place that decides which candidate name is used and records its version.
export PATH="$_bootstrap_prefix/bin:$PATH"
_find_python
}
if ! _find_python; then
# Try to install automatically
if [ "$(uname)" = "Darwin" ]; then
info "Installing Python via Xcode Command Line Tools…"
xcode-select --install 2>/dev/null || true
sleep 2
if ! _find_python && ! _bootstrap_python; then
warn "Xcode CLT install may be in progress (check the popup)"
detail "After it finishes, re-run this installer"
die "Python 3.12+ required. Waiting for Xcode CLT to finish installing."
fi
elif has apt-get; then
# python3.12 explicitly where the archive carries it (Ubuntu 24.04+,
# Debian 13+). On Ubuntu 22.04 the bare `python3` is 3.10 — below the
# >= 3.12 floor — so the fallback package cannot satisfy the probe and
# _bootstrap_python provisions 3.12 instead of the install aborting.
info "Installing Python 3.12 via apt…"
sudo apt-get update -qq >/dev/null 2>&1
sudo apt-get install -y python3.12 python3.12-venv >/dev/null 2>&1 \
|| sudo apt-get install -y python3 python3-pip python3-venv >/dev/null 2>&1
_find_python || _bootstrap_python \
|| die "Python 3.12+ is required and this host's apt archive has none.
Either: sudo apt-get install -y python3.12 python3.12-venv
or install mise (https://mise.jdx.dev/installing-mise.html) and re-run — this
installer will then provision Python $PYTHON_VERSION through it."
elif has dnf; then
# python3.12 explicitly: on Amazon Linux 2023 and RHEL 9 the bare
# `python3` is 3.9, which no longer satisfies the >= 3.12 floor.
info "Installing Python 3.12 via dnf…"
sudo dnf install -y python3.12 python3.12-pip >/dev/null 2>&1 \
|| sudo dnf install -y python3 python3-pip >/dev/null 2>&1
_find_python || _bootstrap_python \
|| die "Python 3.12+ is required and this host's dnf repos have none.
Either: sudo dnf install -y python3.12
or install mise (https://mise.jdx.dev/installing-mise.html) and re-run."
elif has yum; then
# CentOS/RHEL 7 base repos top out at 3.6, so the bootstrap is the
# normal path here rather than the exception.
info "Installing Python 3 via yum…"
sudo yum install -y python3 python3-pip >/dev/null 2>&1
_find_python || _bootstrap_python \
|| die "Python 3.12+ is required and yum's base repos cannot supply it.
Install mise (https://mise.jdx.dev/installing-mise.html) and re-run, or install
Python 3.12+ yourself."
elif has brew; then
info "Installing Python 3 via Homebrew…"
brew install python@3.12 >/dev/null 2>&1 || true
_find_python || _bootstrap_python \
|| die "Python install failed. Run: brew install python@3.12"
else
_bootstrap_python \
|| die "Python 3.12+ required but not found and no package manager detected.
Install Python 3.12+ manually (https://www.python.org/downloads/), or install
mise (https://mise.jdx.dev/installing-mise.html) and re-run."
fi
fi
fi # USE_MISE -eq 0 (Python)
# ── Git ──
if has git; then
ok "git ($( git --version | head -1 ))"
else
die "git not found. Install it first."
fi
# ── Node.js ──
if [ "$USE_MISE" -eq 0 ]; then
info "Checking Node.js…"
if node_supported; then
_node_ver=$(node --version 2>/dev/null || echo "v0")
ok "Node.js $_node_ver ($( which node ))"
elif has node; then
# Present but below the floor: say so, then fall through to the install
# ladder below rather than building against it.
info "Node.js $(node --version 2>/dev/null || echo v0) is below the supported floor (>= v$NODE_MIN_VERSION) — installing a supported Node…"
if has apt-get; then
sudo apt-get install -y nodejs npm >/dev/null 2>&1 || true
elif has dnf; then
sudo dnf install -y nodejs >/dev/null 2>&1 || true
elif has brew; then
brew install node >/dev/null 2>&1 || true
fi
if ! node_supported; then
# Distro package still too old (the common case on AL2023/Debian).
info "Installing Node.js $NODE_VERSION via ensure-node.sh…"
install_node_via_ensure
fi
node_supported \
&& ok "Node.js $(node --version) now active" \
|| warn "Node.js is still below v$NODE_MIN_VERSION — the frontend build will fail"
elif has apt-get; then
info "Installing nodejs via apt…"
sudo apt-get install -y nodejs npm >/dev/null 2>&1 || true
node_to_floor apt
elif has dnf; then
info "Installing nodejs via dnf…"
sudo dnf install -y nodejs >/dev/null 2>&1 || true
node_to_floor dnf
elif has brew; then
info "Installing Node.js via Homebrew…"
brew install node >/dev/null 2>&1 || true
node_to_floor brew
else
info "Installing Node.js via ensure-node.sh…"
install_node_via_ensure
if has node; then
ok "Node.js $(node --version) installed"
else
warn "Node.js install failed — frontend build will be skipped"
detail "Install Node.js $NODE_VERSION (LTS): https://nodejs.org"
fi
fi
fi # USE_MISE -eq 0 (Node.js)
# The apt/dnf/brew branches above accept whatever Node the distro ships, which
# can be older than the supported floor (Debian/Ubuntu in particular). Catch
# that here rather than as a confusing frontend-build failure later.
if has node; then
# `|| echo v0` keeps a broken node binary (loader error) from killing the
# installer under `set -e`; v0 then trips the floor warning below.
if ! node_supported; then
warn "Node.js $( { node --version 2>/dev/null || echo v0; } ) is below the supported floor (>= v$NODE_MIN_VERSION) — the frontend build will fail"
detail "Install Node.js $NODE_VERSION (LTS): https://nodejs.org or 'nvm install $NODE_VERSION'"
fi
fi
# ══════════════════════════════════════════════════════════════════════
# Step 2: Optional alternate agent backend (claude-agent-acp)
# ══════════════════════════════════════════════════════════════════════
step "Optional Agent Backend"
# A fresh configuration defaults to Kiro CLI. Keep installing the public ACP
# adapter as an available alternative, but do not misrepresent it as selected.
if has claude-agent-acp; then
ok "claude-agent-acp ($( which claude-agent-acp ))"
elif has npm; then
if ! ACP_NPM_SPEC="$(acp_adapter_spec "$KIROCREW_APP_DIR")"; then
warn "Could not read the pinned $ACP_NPM_PKG version (packaging/acp-adapters/package.json) — skipping"
detail "npm i -g $ACP_NPM_PKG@<version>"
else
info "Installing $ACP_NPM_SPEC via npm…"
if npm install -g "$ACP_NPM_SPEC" >/dev/null 2>&1; then
ok "claude-agent-acp installed"
else
warn "Global npm install failed — install it manually before first run:"
detail "npm i -g $ACP_NPM_SPEC"
fi
fi
else
warn "npm not available — install the agent backend later:"
detail "npm i -g $ACP_NPM_PKG"
fi
if [ "$WITH_KAS" -eq 1 ]; then
info "The built-in KAS engine will be downloaded after install (skip with --no-kas); the switch stays off until you turn it on."
else
warn "The default Kiro agent requires Kiro CLI; this installer does not install or sign in to it."
detail "Install it separately from https://kiro.dev/cli/ and run: kiro-cli login"
detail "Or run kirocrew kas install after install to download the built-in engine instead (no kiro-cli)."
fi
# ══════════════════════════════════════════════════════════════════════
# Step 3: Build
# ══════════════════════════════════════════════════════════════════════
step "Build"
cd "$KIROCREW_APP_DIR"
# ── Frontend (npm + vite) ──
# Vite emits to website/dist; we stage it into src/kiro_crew/static/dist
# where setup.py copies it into the package at install time.
if has node && [ -d "$KIROCREW_APP_DIR/website" ]; then
info "Building frontend (website/)…"
_fe_log="$(mktemp)"
(
cd "$KIROCREW_APP_DIR/website" &&
# Raise V8's heap ceiling for the bundle build. The default (~2 GB on
# 64-bit) is not enough for this app's 6k+ module graph, and the OOM
# surfaces as a build that dies without a clear cause -- leaving no
# dist/ and a "Dashboard HTML not found" page at first launch.
_fe_build() { NODE_OPTIONS="${NODE_OPTIONS:---max-old-space-size=8192}" npm run build 2>>"$_fe_log"; }
# Install the exact platform-specific rolldown native binding the
# bundler needs, keyed off the resolved rolldown version. Last-resort
# repair for npm/cli#4828 when even a clean reinstall omits it.
_fe_install_binding() {
_rd_ver="$(node -p "require('./node_modules/rolldown/package.json').version" 2>/dev/null)" || return 1
[ -n "$_rd_ver" ] || return 1
case "$(uname -s)" in
Linux) _rd_os="linux" ;;
Darwin) _rd_os="darwin" ;;
*) return 1 ;;
esac
case "$(uname -m)" in
x86_64|amd64) _rd_arch="x64" ;;
aarch64|arm64) _rd_arch="arm64" ;;
*) return 1 ;;
esac
_rd_abi=""
if [ "$_rd_os" = "linux" ]; then
if ldd --version 2>&1 | grep -qi musl; then _rd_abi="-musl"; else _rd_abi="-gnu"; fi
fi
echo "installing @rolldown/binding-${_rd_os}-${_rd_arch}${_rd_abi}@${_rd_ver} explicitly (npm/cli#4828)" >>"$_fe_log"
npm install --no-audit --no-fund --no-save --loglevel=error \
"@rolldown/binding-${_rd_os}-${_rd_arch}${_rd_abi}@${_rd_ver}" 2>>"$_fe_log"
}
if [ -f package-lock.json ]; then
npm ci --no-audit --no-fund --loglevel=error 2>"$_fe_log"
else
npm install --no-audit --no-fund --loglevel=error 2>"$_fe_log"
fi &&
# npm's optional-dependencies bug (npm/cli#4828) can leave `npm ci`
# without the platform-specific native binding the bundler needs
# (e.g. @rolldown/binding-<os>-<arch>), so the build aborts with
# "Cannot find native binding". `npm ci` replays a lockfile resolved
# on another OS/arch and drops the entry for THIS platform. Recover in
# two escalating steps: drop node_modules and let `npm install`
# re-evaluate optional deps for the current platform (the tracked
# package-lock.json is left in place), then, if that still omits it,
# install the exact binding explicitly. Each step rebuilds; the first
# that produces a bundle wins.
if ! _fe_build; then
echo "npm run build failed; re-resolving optional native deps (npm/cli#4828) and retrying" >>"$_fe_log"
rm -rf node_modules
npm install --no-audit --no-fund --loglevel=error 2>>"$_fe_log"
if ! _fe_build; then
_fe_install_binding && _fe_build
fi
fi
) &
spinner $! "Installing npm packages & building React app…"
_fe_ok=0
if wait $!; then
_dist_src="$KIROCREW_APP_DIR/website/dist"
_dist_dst="$KIROCREW_APP_DIR/src/kiro_crew/static/dist"
if [ -d "$_dist_src" ]; then
rm -rf "$_dist_dst"
mkdir -p "$(dirname "$_dist_dst")"
cp -R "$_dist_src" "$_dist_dst"
ok "Frontend built and staged → src/kiro_crew/static/dist"
_fe_ok=1
fi
fi
if [ "$_fe_ok" != "1" ]; then
# The build did not produce a usable bundle. For a local CLI install this is
# non-fatal — the dashboard falls back to a legacy page and the CLI still
# works. For a cloud crew the dashboard IS the product, so
# KIROCREW_REQUIRE_FRONTEND=1 makes it FATAL: dump the build log and exit
# non-zero. That lets the cloud bootstrap RETRY the whole install on the warm
# box (first-boot contention — the common cause — self-heals), and if it still
# fails the real npm/vite error reaches the failure reason instead of being
# swallowed behind a "legacy fallback" warning.
if [ -s "$_fe_log" ]; then
echo "----- frontend build log (tail) -----"
tail -n 20 "$_fe_log"
echo "-------------------------------------"
fi
rm -f "$_fe_log"
if [ "${KIROCREW_REQUIRE_FRONTEND:-0}" = "1" ]; then
die "Frontend build failed and KIROCREW_REQUIRE_FRONTEND=1 — no static/dist produced (see the build log above)"
fi
warn "Frontend build failed — dashboard will use legacy fallback"
else
rm -f "$_fe_log"
fi
else
warn "Skipping frontend build (Node.js or website/ not available)"
detail "Install Node.js 22.12+ (24 LTS recommended) for the full React dashboard experience"
fi
# ── Python virtual environment & package ──
info "Creating virtual environment…"
_venv="$KIROCREW_APP_DIR/.venv"
# Build the venv under a umask that masks group/other WRITE so bin/kirocrew
# and its dirs are born non-group-writable -- `kirocrew service install`
# refuses to attach its AppArmor profile to a group/world-writable launcher
# (see the matching block in cli.sh for the full rationale). OR-ing with 022
# only ADDS write-mask bits, so a stricter caller umask is preserved.
_KC_PREV_UMASK="$(umask)"
umask "$(printf '%03o' "$(( $(umask) | 022 ))")"
# A reused venv keeps the perms it was born with: one built by an older installer
# under a permissive umask still has a group/world-writable root or bin/, so the
# AppArmor profile would keep refusing. Rebuild it under the tightened umask.
if [ -d "$_venv" ] && [ -n "$(find "$_venv" "$_venv/bin" -prune \( -perm -g+w -o -perm -o+w \) -print 2>/dev/null)" ]; then
warn "Existing venv is group/world-writable — recreating it"
rm -rf "$_venv"
fi
# An existing venv is reusable only while its interpreter still satisfies the
# package's requires-python. On an upgrade from a pre-3.12 install, reusing a
# 3.10/3.11 venv makes the `pip install -e .` below refuse the package outright
# ("Requires-Python >=3.12") and the upgrade dead-ends, so rebuild it instead.
if [ -d "$_venv" ] && [ -x "$_venv/bin/python" ] \
&& "$_venv/bin/python" -c "import sys; sys.exit(0 if sys.version_info >= (3, 12) else 1)" 2>/dev/null; then
ok "Existing venv found"
else
if [ -d "$_venv" ]; then
warn "Existing venv predates the Python 3.12 floor — recreating it"
rm -rf "$_venv"
fi
"$_py" -m venv "$_venv" || die "Failed to create venv. You may need: $_py -m pip install virtualenv"
ok "venv created at $_venv"
fi
info "Installing Python package…"
_pip_target="."
if [ "$WITH_VOICE" -eq 1 ]; then
_pip_target=".[voice]"
detail "Including voice extras (.[voice])"
fi
# Dependencies come from prebuilt wheels only, as in cli.sh: without this pip
# builds any dependency that lacks a wheel for this host from its sdist, and a
# native one (numpy, Pillow) then needs a compiler and -dev headers the host
# was never required to have. The editable kirocrew install itself is a local
# source tree, which pip builds regardless of the flag; only the dependency
# resolution is restricted. KIROCREW_ALLOW_SOURCE_BUILDS=1 opts back in for a
# host that has the toolchain.
_pip_binary_only="--only-binary=:all:"
if [ "${KIROCREW_ALLOW_SOURCE_BUILDS:-0}" = "1" ]; then
_pip_binary_only=""
fi
_pip_log="$(mktemp)"
(
"$_venv/bin/pip" install --upgrade pip setuptools wheel 2>&1 | tail -5 > "$_pip_log"
cd "$KIROCREW_APP_DIR"
# Frontend already built and staged above; skip rebuild in setup.py.
# shellcheck disable=SC2086
KIROCREW_SKIP_FRONTEND=1 "$_venv/bin/pip" install $_pip_binary_only -e "$_pip_target" 2>&1 | tail -20 >> "$_pip_log"
) &
spinner $! "Installing kirocrew and dependencies…"
if wait $!; then
if "$_venv/bin/python" -c "import aiohttp" 2>/dev/null; then
ok "Python package installed (isolated venv)"
else
die "Package installed but dependencies missing (aiohttp not importable).
Try manually: $_venv/bin/pip install -e $KIROCREW_APP_DIR"
fi
if [ ! -x "$_venv/bin/kirocrew" ]; then
die "Install incomplete: entry point $_venv/bin/kirocrew missing or not executable."
fi
if ! "$_venv/bin/python" -I -c "import kiro_crew" 2>/dev/null; then
die "Install incomplete: kiro_crew not importable."
fi
else
if [ -s "$_pip_log" ]; then
echo ""
tail -10 "$_pip_log" | while IFS= read -r _line; do detail "$_line"; done
echo ""
fi
# Under binary-only resolution this pip error means no release pip may
# install has a wheel this host can run. Its "(from versions: ...)" list
# cannot separate the causes (wheels for a newer libc or another arch are
# dropped before the list is built, so they read "none" exactly like a
# missing or unreachable index), so name the platform, the usual cause and
# the way out, and say the index is the other possibility.
if [ -n "$_pip_binary_only" ] && grep -q 'No matching distribution found for' "$_pip_log" 2>/dev/null; then
_missing="$(grep 'No matching distribution found for' "$_pip_log" \
| sed 's/.*No matching distribution found for //' | head -n 5 | tr '\n' ' ')"
_libc="$(getconf GNU_LIBC_VERSION 2>/dev/null || true)"
die "pip found no prebuilt wheel it may install on this platform ($(uname -s) $(uname -m)${_libc:+, $_libc}) for: ${_missing}
Kiro Crew installs prebuilt wheels only and never compiles a dependency. Usually this
means the host is older than the wheels' floor: use a newer Linux (Amazon Linux 2023,
RHEL/Rocky 8+, Ubuntu 22.04+, Debian 12+) or macOS. It can also mean the package index
could not be reached or does not carry these releases (see pip's output above). To
compile on this host instead, install a C/C++ toolchain plus the -dev headers those
packages need and re-run with KIROCREW_ALLOW_SOURCE_BUILDS=1."
fi
die "pip install failed. Check: $_venv/bin/pip --version"
fi
rm -f "$_pip_log"
# Venv fully built and born non-group-writable; restore the caller's umask.
umask "$_KC_PREV_UMASK"
# Record install method so `kirocrew update` uses the right rebuild strategy
echo "pip" > "$KIROCREW_APP_DIR/.install-method"
ok "Install method recorded (.install-method=pip)"
# Symlink the kirocrew entry point to ~/.local/bin for PATH access
mkdir -p "$HOME/.local/bin"
ln -sf "$_venv/bin/kirocrew" "$HOME/.local/bin/kirocrew"
ok "Symlinked kirocrew → ~/.local/bin/kirocrew"
# ── Desktop App (macOS only) ──
if [ "$(uname)" = "Darwin" ] && has node && [ -d "$KIROCREW_APP_DIR/electron" ]; then
printf "\n Install KiroCrew desktop app to ~/Applications? [Y/n] "
read -r _install_app < /dev/tty
case "${_install_app:-Y}" in
[Yy]*)
info "Building desktop app…"
(
cd "$KIROCREW_APP_DIR/electron"
npm install --no-audit --no-fund --loglevel=error 2>/dev/null
npx electron-builder --mac --dir 2>/dev/null
) &
spinner $! "Building Electron app…"
if wait $!; then
_app_src="$KIROCREW_APP_DIR/electron/dist/mac-arm64/KiroCrew.app"
[ ! -d "$_app_src" ] && _app_src="$KIROCREW_APP_DIR/electron/dist/mac/KiroCrew.app"
if [ -d "$_app_src" ]; then
mkdir -p "$HOME/Applications"
rm -rf "$HOME/Applications/KiroCrew.app" 2>/dev/null
cp -R "$_app_src" "$HOME/Applications/KiroCrew.app"
ok "KiroCrew.app installed to ~/Applications"
detail "Launch via Spotlight (⌘+Space → KiroCrew) or Finder → ~/Applications"
else
warn "Electron build succeeded but .app not found"
fi
else
warn "Desktop app build failed — you can still use the web dashboard"
fi
;;
*)
info "Skipping desktop app"
detail "Install later: cd $KIROCREW_APP_DIR/electron && npm install && npm run dist"
;;
esac
fi
# ══════════════════════════════════════════════════════════════════════
# Step 4: PATH & Shell Config
# ══════════════════════════════════════════════════════════════════════
step "PATH Configuration"
# The kirocrew entry point is symlinked to ~/.local/bin/kirocrew.
export PATH="$HOME/.local/bin:$KIROCREW_APP_DIR/bin:$PATH"
# Persist to shell rc files
_path_line="export PATH=\"\$HOME/.local/bin:\$PATH\""
_marker="# KiroCrew"
_add_to_rc() {
local rc="$1"
[ ! -f "$rc" ] && return
if grep -qF "$_marker" "$rc" 2>/dev/null; then
local _tmp
_tmp="$(mktemp)"
awk "/$_marker/{skip=2} skip>0{skip--; next} 1" "$rc" > "$_tmp" && mv "$_tmp" "$rc"
fi
echo "" >> "$rc"
echo "$_marker" >> "$rc"
echo "$_path_line" >> "$rc"
ok "Added to $(basename "$rc")"
}
# Also persist KIROCREW_PROJECT_DIR so kirocrew works from any directory
_proj_line="export KIROCREW_PROJECT_DIR=\"$KIROCREW_APP_DIR\""
_add_proj_to_rc() {
local rc="$1"
[ ! -f "$rc" ] && return
if grep -qF "KIROCREW_PROJECT_DIR" "$rc" 2>/dev/null; then
local _tmp
_tmp="$(mktemp)"
grep -v "KIROCREW_PROJECT_DIR" "$rc" > "$_tmp" && mv "$_tmp" "$rc"
fi
echo "$_proj_line" >> "$rc"
}
export KIROCREW_PROJECT_DIR="$KIROCREW_APP_DIR"
for _rc in "$HOME/.bashrc" "$HOME/.zshrc"; do
if [ -f "$_rc" ]; then
_add_to_rc "$_rc"
_add_proj_to_rc "$_rc"
fi
done
# ── Fish shell ──
_fish_config="$HOME/.config/fish/config.fish"
if [ -f "$_fish_config" ] || [ "$(basename "${SHELL:-}")" = "fish" ]; then
mkdir -p "$HOME/.config/fish"
if grep -qF "$_marker" "$_fish_config" 2>/dev/null; then
_tmp="$(mktemp)"
awk -v marker="$_marker" 'BEGIN{s=0} $0==marker{s=1;next} s&&/^(fish_add_path|set -gx KIROCREW)/{next} {s=0;print}' "$_fish_config" > "$_tmp" && mv "$_tmp" "$_fish_config"
fi
{
echo "$_marker"
echo "fish_add_path -g ~/.local/bin"
echo "set -gx KIROCREW_PROJECT_DIR $KIROCREW_APP_DIR"
} >> "$_fish_config"
ok "Added to config.fish"
fi
# Save project dir for kirocrew to find
mkdir -p "$KIROCREW_DATA_DIR"
echo "$KIROCREW_APP_DIR" > "$KIROCREW_DATA_DIR/project_dir"
# Verify kirocrew is accessible
if has kirocrew; then
ok "kirocrew command available"
elif [ -x "$HOME/.local/bin/kirocrew" ]; then
ok "kirocrew symlinked to ~/.local/bin/kirocrew"
detail "You may need to restart your shell for it to be in PATH"
else
warn "kirocrew not in PATH — restart your shell or run:"
detail "source ~/.$(basename "$SHELL")rc"
fi
# ══════════════════════════════════════════════════════════════════════
# Step 5: Agent Config
# ══════════════════════════════════════════════════════════════════════
step "Agent Config"
# Install agent config via kirocrew setup
if has kirocrew; then
_kirocrew=kirocrew
elif [ -x "$HOME/.local/bin/kirocrew" ]; then
_kirocrew="$HOME/.local/bin/kirocrew"
else
_kirocrew=""
fi
if [ -n "$_kirocrew" ]; then
info "Installing agent config…"
KIROCREW_PROJECT_DIR="$KIROCREW_APP_DIR" "$_kirocrew" setup --agent-only \
&& ok "Agent config installed" \
|| warn "kirocrew setup --agent-only failed (run manually after install)"
if [ "$WITH_KAS" -eq 1 ]; then
# The engine this release pins, fetched from the project's CDN and
# verified against the pin baked into this checkout. The switch is left
# alone on purpose: the route is in shadow testing, so turning it on is
# the user's own step (Settings → Agent Harness, or `kirocrew config set
# agent.kas_bundle true`), never the installer's. A failed download
# (offline host, CDN outage) leaves a working install, so it only warns.
info "Downloading the built-in KAS engine (kirocrew kas install)…"
# Exit 3 is `kas install`'s "this host cannot run the engine"
# (cli_kas.py HOST_UNSUPPORTED_EXIT): it already printed why, and a
# retry cannot help, so no retry advice follows it.
_kas_rc=0
"$_kirocrew" kas install || _kas_rc=$?
if [ "$_kas_rc" -eq 0 ]; then
ok "Built-in KAS engine installed (switch it on: kirocrew config set agent.kas_bundle true)"
elif [ "$_kas_rc" -eq 3 ]; then
KAS_HOST_UNSUPPORTED=1
warn "This host cannot run the built-in KAS engine (see above); Kiro Crew is installed without it."
else
KAS_DOWNLOAD_FAILED=1
warn "Could not download the built-in KAS engine; Kiro Crew is installed without it."
detail "Retry when online: kirocrew kas install"
fi
fi
elif [ "$WITH_KAS" -eq 1 ]; then
KAS_DOWNLOAD_FAILED=1
warn "kirocrew not in PATH — the built-in KAS engine was not downloaded."
detail "After reloading your shell, run: kirocrew kas install"
fi
# --no-kas means "Kiro CLI only", never "on with no engine": the choice is saved off.
if [ "$WITH_KAS" -eq 0 ] && [ -n "$_kirocrew" ]; then
if "$_kirocrew" config set agent.kas_bundle false >/dev/null 2>&1; then
ok "KAS will use Kiro CLI (--no-kas). Change it in Settings → Agent Harness."
else
warn "Could not save the Kiro CLI choice. Run: kirocrew config set agent.kas_bundle false"
fi
fi
ok "Run ${CYAN}kirocrew setup${RESET} to configure agent, workspace, and integrations"
# ── Embeddings (optional) ──
info "Optional: local vector memory via Ollama"
detail "Install ollama (https://ollama.com), then: ollama pull qwen3-embedding:0.6b"
# ══════════════════════════════════════════════════════════════════════
# Done!
# ══════════════════════════════════════════════════════════════════════
echo ""
echo ""
echo " ${GREEN}${BOLD}👻 KiroCrew installed successfully!${RESET}"
echo ""
echo " ${DIM}────────────────────────────────────────${RESET}"
echo ""
echo " ${BOLD}Next steps:${RESET}"
echo ""
echo " ${CYAN}1.${RESET} Reload your shell:"
if [ -n "${KIROCREW_HOME:-}" ]; then
# Absolute: a relative value would resolve against whatever directory a later command runs from.
# CDPATH is cleared because a hit through it makes `cd` echo the directory too.
KIROCREW_DATA_ABS="$(CDPATH=''; cd "$KIROCREW_DATA_DIR" && pwd -P)"
echo " This install used the data home ${CYAN}${KIROCREW_DATA_ABS}${RESET} (from KIROCREW_HOME)."
echo " Every kirocrew command needs it set too, or it uses ~/.kiro/crew; add this to your shell profile:"
echo " ${GREEN}export KIROCREW_HOME=\"${KIROCREW_DATA_ABS}\"${RESET}"
fi
case "$(basename "${SHELL:-}")" in
fish) echo " ${GREEN}source ~/.config/fish/config.fish${RESET}" ;;
bash|zsh) echo " ${GREEN}source ~/.$(basename "${SHELL}")rc${RESET}" ;;
*) echo " ${GREEN}Restart your terminal${RESET}" ;;
esac
echo ""
echo " ${CYAN}2.${RESET} Set up the default Kiro agent (skip if you selected another ACP backend):"
echo " ${GREEN}Install Kiro CLI from https://kiro.dev/cli/${RESET}"
echo " ${GREEN}kiro-cli login${RESET}"
if [ "$WITH_KAS" -eq 1 ] && [ "$KAS_HOST_UNSUPPORTED" -eq 0 ]; then
echo " To try the built-in KAS engine instead (shadow testing, off by default):"
if [ "$KAS_DOWNLOAD_FAILED" -eq 1 ]; then
echo " ${GREEN}kirocrew kas install${RESET} (the download failed during install; retry it first)"
fi
echo " ${GREEN}kirocrew config set agent.kas_bundle true${RESET} then sign in from the dashboard"
fi
echo ""
echo " ${CYAN}3.${RESET} Run the setup wizard:"
echo " ${GREEN}kirocrew setup${RESET}"
echo ""
echo " ${CYAN}4.${RESET} Start the dashboard:"
echo " ${GREEN}kirocrew gateway${RESET}"
echo " Stop it with ${GREEN}kirocrew stop${RESET}."
echo ""
echo " ${CYAN}5.${RESET} Open ${CYAN}http://localhost:${KIROCREW_PORT}${RESET} in your browser"
echo ""
# SSH tunnel tip for remote Linux users
if [ "$(uname)" != "Darwin" ]; then
_hostname=$(hostname -f 2>/dev/null || hostname)
echo " ${DIM}────────────────────────────────────────${RESET}"
echo ""
echo " ${BOLD}Remote access:${RESET}"
echo " Run this on your ${CYAN}local machine${RESET} to forward the dashboard:"
echo ""
echo " ${GREEN}ssh -N -L ${KIROCREW_PORT}:localhost:${KIROCREW_PORT} $_hostname${RESET}"
echo ""
echo " Then open ${CYAN}http://localhost:${KIROCREW_PORT}${RESET} in your local browser."
echo ""
fi
echo " ${DIM}────────────────────────────────────────${RESET}"
echo ""
source_lane_notice
echo ""
case "$(source_checkout_ref)" in
branch:*)
echo " ${DIM}Update anytime:${RESET} ${GREEN}git pull && bash install.sh${RESET}"
detail "The dashboard Update (kirocrew update) resets this clone to its origin branch"
detail "when it is only behind; a clone both ahead and behind is refused, and --force"
detail "discards its local commits." ;;
detached:*)
detail "A detached checkout has no branch to pull: switch to a branch"
detail "(git switch main) to follow one, or use the one-line install." ;;
esac
echo ""