Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .agents/common-skills.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
repo=https://github.com/warpdotdev/common-skills/
ref=12d2e2b787d7af4ef1b4455949b864fc5637dcff
92 changes: 86 additions & 6 deletions script/bootstrap
Original file line number Diff line number Diff line change
@@ -1,24 +1,104 @@
#!/usr/bin/env bash
set -eo pipefail

# Bootstrap dispatches to the platform-specific install scripts. Each step
# that needs root sources `script/warp_sudo` and asks for confirmation
# before running. Pass -y / --yes (or set WARP_SKIP_SUDO_PROMPT=1) to skip
# the prompts in unattended environments.

OS_TYPE="$(uname -s)"
COMMON_SKILLS_REPO_URL="${WARP_COMMON_SKILLS_REPO_URL:-https://github.com/warpdotdev/common-skills/}"
INSTALL_COMMON_SKILLS=0
PLATFORM_ARGS=()

usage() {
cat <<EOF
Usage: ./script/bootstrap [options]

Prepare this checkout for Warp development by running the platform-specific bootstrap steps.

Options:
-h, --help Show this help message.
--install-common-skills Install or update common agent skills from warpdotdev/common-skills.

Environment:
WARP_SKIP_COMMON_SKILLS_INSTALL=1
Skip installing common agent skills, even when --install-common-skills is provided.
WARP_COMMON_SKILLS_DEST_DIR=/path/to/base-dir
Install common skills into /path/to/base-dir/.agents/skills without prompting.
WARP_COMMON_SKILLS_REPO_URL=/path/to/common-skills-or-git-url
Use a specific common-skills checkout or repository URL.
WARP_COMMON_SKILLS_REF=<git-ref>
Use a specific common-skills git ref.
EOF
}

print_bootstrap_preview() {
local platform="$1"

echo "Warp bootstrap is starting for ${platform}."
echo "It will:"

if [[ "${platform}" = "macOS" ]]; then
echo " - Configure Xcode as the active developer directory."
echo " - Install or update Cargo, Homebrew, PowerShell, Docker, gcloud, and related development tools."
echo " - Add the aarch64-apple-darwin Rust target."
elif [[ "${platform}" = "Linux" ]]; then
echo " - Update apt package metadata."
echo " - Install dependencies needed to build, run, and test Warp."
echo " - Install linuxdeploy and check gcloud authentication."
fi

if [[ "${INSTALL_COMMON_SKILLS}" -eq 0 ]]; then
echo " - Skip common agent skills unless --install-common-skills is provided."
elif [[ "${WARP_SKIP_COMMON_SKILLS_INSTALL:-}" = "1" ]]; then
echo " - Skip common agent skills because WARP_SKIP_COMMON_SKILLS_INSTALL=1."
else
echo " - Install or update common agent skills from ${COMMON_SKILLS_REPO_URL} if needed."
fi
echo "Run ./script/bootstrap --help to see options and environment overrides."
echo
}

for arg in "$@"; do
case "$arg" in
-y|--yes) export WARP_SKIP_SUDO_PROMPT=1 ;;
case "${arg}" in
-h|--help)
usage
exit 0
;;
-y|--yes)
export WARP_SKIP_SUDO_PROMPT=1
PLATFORM_ARGS+=("${arg}")
;;
--install-common-skills)
INSTALL_COMMON_SKILLS=1
;;
*)
PLATFORM_ARGS+=("${arg}")
;;
esac
done

OS_TYPE="$(uname -s)"
maybe_install_common_skills() {
if [[ "${INSTALL_COMMON_SKILLS}" -eq 1 ]]; then
./script/install_common_skills --if-needed
fi
}

if [[ "$OS_TYPE" = "Darwin" ]]; then
./script/macos/bootstrap "$@"
print_bootstrap_preview "macOS"
./script/macos/bootstrap "${PLATFORM_ARGS[@]}"
maybe_install_common_skills
elif [[ "$OS_TYPE" = "Linux" ]]; then
./script/linux/bootstrap "$@"
print_bootstrap_preview "Linux"
./script/linux/bootstrap "${PLATFORM_ARGS[@]}"
maybe_install_common_skills
elif [[ "$OS_TYPE" =~ ^[MINGW64_NT|MSYS_NT] ]]; then
./script/windows/bootstrap.ps1 "$@"
if [[ "${INSTALL_COMMON_SKILLS}" -eq 1 ]]; then
./script/windows/bootstrap.ps1 "${PLATFORM_ARGS[@]}" -InstallCommonSkills
else
./script/windows/bootstrap.ps1 "${PLATFORM_ARGS[@]}"
fi
else
echo "No bootstrap script defined for the current platform!"
exit 1
Expand Down
Loading
Loading