Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

refactor(cli): select installer shell via COMPOSIO_INSTALL_SHELL

jkomyno0c768c32037b
diff --git a/.github/workflows/build-cli-binaries.yml b/.github/workflows/build-cli-binaries.yml
index fb0028106..c529ff491 100644
--- a/.github/workflows/build-cli-binaries.yml
+++ b/.github/workflows/build-cli-binaries.yml
@@ -341,7 +341,7 @@ jobs:
export PATH="$COMPOSIO_BIN_DIR:$PATH"
```
- Run `curl -fsSL https://composio.dev/install | sh -s -- --shell zsh`, replacing `zsh` with `bash` or `fish`, when you want the CLI to configure your shell.
+ Run `curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=zsh sh`, replacing `zsh` with `bash` or `fish`, when you want the CLI to configure your shell.
## Usage
diff --git a/.github/workflows/cli.install-e2e.yml b/.github/workflows/cli.install-e2e.yml
index 3e954767b..0ae35d231 100644
--- a/.github/workflows/cli.install-e2e.yml
+++ b/.github/workflows/cli.install-e2e.yml
@@ -193,7 +193,7 @@ jobs:
echo ""
echo '```sh'
echo "curl -fsSL \"$RAW_BASE/install.sh\" | sh"
- echo "curl -fsSL \"$RAW_BASE/install.sh\" | sh -s -- --shell zsh"
+ echo "curl -fsSL \"$RAW_BASE/install.sh\" | COMPOSIO_INSTALL_SHELL=zsh sh"
echo '```'
echo ""
echo "Shell-specific setup routes (the override points the variant at this PR's base installer):"
diff --git a/INSTALL.md b/INSTALL.md
index 302bc2342..9a5b2a96d 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -9,9 +9,9 @@ curl -fsSL https://composio.dev/install | sh
The default installer changes no shell files and installs no agent plugins. If it reports that `~/.local/bin` is not available on `PATH`, run the shell-specific command it prints:
```bash
-curl -fsSL https://composio.dev/install | sh -s -- --shell zsh
-curl -fsSL https://composio.dev/install | sh -s -- --shell bash
-curl -fsSL https://composio.dev/install | sh -s -- --shell fish
+curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=zsh sh
+curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=bash sh
+curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=fish sh
```
Shell setup delegates to `composio install --shell <shell>` and falls back to writing the same `# Composio CLI` PATH block inline when the installed CLI release predates that flag.
@@ -34,9 +34,9 @@ The positional argument takes precedence over `COMPOSIO_INSTALL_VERSION`.
| `COMPOSIO_DEBUG` | Set to `1` or `true` to print installer traces. | Unset |
| `COMPOSIO_INSTALL_HELP` | Set to `0` to hide post-install guidance. | `1` |
| `COMPOSIO_INSTALL_PLUGINS` | Set to `1` to install plugins for detected agent hosts. | `0` |
+| `COMPOSIO_INSTALL_SHELL` | Configure the requested shell (`zsh`, `bash`, or `fish`) after installation. | Unset |
| `--agent` | Log in as a Composio agent after installation. | Off |
| `--no-plugins` | Skip plugin setup. Kept for compatibility. | Off |
-| `--shell` | Configure the requested shell (`zsh`, `bash`, or `fish`) after installation. | Off |
## Manual Installation
diff --git a/docs/content/changelog/07-31-26-installer.mdx b/docs/content/changelog/07-31-26-installer.mdx
index bd70457c7..5835dd444 100644
--- a/docs/content/changelog/07-31-26-installer.mdx
+++ b/docs/content/changelog/07-31-26-installer.mdx
@@ -10,6 +10,6 @@ The Composio CLI installer now separates the release bundle from the command you
- `curl -fsSL https://composio.dev/install | sh` installs the verified release bundle in `~/.composio` and creates `~/.local/bin/composio`.
- The default flow does not edit shell files, install agent plugins, or log you in.
-- `--shell zsh|bash|fish` configures the requested shell explicitly, for example `curl -fsSL https://composio.dev/install | sh -s -- --shell zsh`.
+- `COMPOSIO_INSTALL_SHELL=zsh|bash|fish` configures the requested shell explicitly, for example `curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=zsh sh`.
- `COMPOSIO_INSTALL_VERSION`, `COMPOSIO_BIN_DIR`, `COMPOSIO_QUIET`, and `COMPOSIO_DEBUG` give you control over version, layout, and output.
- Existing `COMPOSIO_INSTALL_DIR` configurations keep their bundle-directory meaning.
diff --git a/docs/content/docs/cli.mdx b/docs/content/docs/cli.mdx
index 70e227c1c..947fc03cc 100644
--- a/docs/content/docs/cli.mdx
+++ b/docs/content/docs/cli.mdx
@@ -57,36 +57,36 @@ curl -fsSL https://composio.dev/install | sh -s -- @composio/[email protected]
| `COMPOSIO_DEBUG` | Set to `1` or `true` to print download URLs and temporary paths. | Unset |
| `COMPOSIO_INSTALL_HELP` | Set to `0` to hide post-install guidance. | `1` |
| `COMPOSIO_INSTALL_PLUGINS` | Set to `1` to run `composio setup --target auto --yes --if-present` after installation. | `0` |
+| `COMPOSIO_INSTALL_SHELL` | Configure the requested shell (`zsh`, `bash`, or `fish`) after installation. See [Configure your shell](#configure-your-shell). | Unset |
| `COMPOSIO_GITHUB_OWNER` | GitHub owner used to resolve releases. | `ComposioHQ` |
| `COMPOSIO_GITHUB_REPO` | GitHub repository used to resolve releases. | `composio` |
| `COMPOSIO_GITHUB_URL` | GitHub web and release-download base URL. | `https://github.com` |
| `COMPOSIO_GITHUB_API_BASE_URL` | GitHub API base URL. | Derived from `COMPOSIO_GITHUB_URL` |
| `--agent` | Log in as a Composio agent after installation. | Off |
| `--no-plugins` | Skip agent plugin setup. Kept for compatibility and now matches the default. | Off |
-| `--shell` | Configure the requested shell (`zsh`, `bash`, or `fish`) after installation. See [Configure your shell](#configure-your-shell). | Off |
### Configure your shell
-Pass `--shell` when `~/.local/bin` is not already on `PATH`, or when you want the CLI to configure the requested shell explicitly.
+Set `COMPOSIO_INSTALL_SHELL` when `~/.local/bin` is not already on `PATH`, or when you want the CLI to configure the requested shell explicitly.
<Tabs groupId="shell" items={['zsh','bash','fish']} persist>
<Tab value="zsh">
```bash
-curl -fsSL https://composio.dev/install | sh -s -- --shell zsh
+curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=zsh sh
```
This configures `~/.zshrc` and delegates setup to `composio install --shell zsh`.
</Tab>
<Tab value="bash">
```bash
-curl -fsSL https://composio.dev/install | sh -s -- --shell bash
+curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=bash sh
```
This configures `~/.bashrc`. If `~/.bash_profile` or `~/.bash_login` exists, it also updates the first active login file so `bash -ilc` can find `composio`.
</Tab>
<Tab value="fish">
```bash
-curl -fsSL https://composio.dev/install | sh -s -- --shell fish
+curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=fish sh
```
This configures `~/.config/fish/config.fish` and delegates setup to `composio install --shell fish`.
diff --git a/install.sh b/install.sh
index 1cac29b41..a6ea15cab 100755
--- a/install.sh
+++ b/install.sh
@@ -38,14 +38,14 @@ tildify() {
print_usage() {
printf '%s\n' \
- 'Usage: install.sh [--agent] [--no-plugins] [--shell zsh|bash|fish] [version-tag]' \
+ 'Usage: install.sh [--agent] [--no-plugins] [version-tag]' \
'' \
'Options:' \
- ' --agent Sign up or log in as a Composio agent after installation.' \
- ' --no-plugins Skip agent plugin installation (the default).' \
- ' --shell <shell> Configure zsh, bash, or fish so the composio command is on PATH.' \
- ' -h, --help Show this help.' \
+ ' --agent Sign up or log in as a Composio agent after installation.' \
+ ' --no-plugins Skip agent plugin installation (the default).' \
+ ' -h, --help Show this help.' \
'' \
+ 'Set COMPOSIO_INSTALL_SHELL=zsh|bash|fish to configure that shell after installation.' \
'Version tags may be stable or beta, for example 0.3.1 or @composio/[email protected].'
}
@@ -384,7 +384,7 @@ print_post_install_help() {
else
printf 'Optional shell setup for future PATH changes:\n\n'
fi
- printf ' curl -fsSL https://composio.dev/install | sh -s -- --shell %s\n' "$shell_route"
+ printf ' curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=%s sh\n' "$shell_route"
printf '\nThis configures %s.\n' "$shell_config"
elif path_contains_bin_dir; then
printf 'The composio command is available on PATH.\n'
@@ -411,25 +411,22 @@ main() {
install_agent=0
install_plugins=${COMPOSIO_INSTALL_PLUGINS:-0}
version_arg=
- requested_shell=
+ requested_shell=${COMPOSIO_INSTALL_SHELL:-}
case $install_plugins in
0 | 1) ;;
*) error 'COMPOSIO_INSTALL_PLUGINS must be 1 or 0' ;;
esac
+ case $requested_shell in
+ '' | zsh | bash | fish) ;;
+ *) error "COMPOSIO_INSTALL_SHELL must be zsh, bash, or fish (got \"$requested_shell\")" ;;
+ esac
+
while [ "$#" -gt 0 ]; do
case $1 in
--agent) install_agent=1 ;;
--no-plugins) install_plugins=0 ;;
- --shell)
- [ "$#" -ge 2 ] || error '--shell requires a value: zsh, bash, or fish'
- case $2 in
- zsh | bash | fish) requested_shell=$2 ;;
- *) error "Invalid --shell value \"$2\". Expected zsh, bash, or fish." ;;
- esac
- shift
- ;;
-h | --help)
print_usage
return 0
diff --git a/install/bash.sh b/install/bash.sh
index 1f9d1a91e..8bd014470 100755
--- a/install/bash.sh
+++ b/install/bash.sh
@@ -71,8 +71,8 @@ main() {
download_installer "$variant_script_url" "$variant_tmpdir/install.sh" || error 'Failed to download the base installer'
[ -s "$variant_tmpdir/install.sh" ] || error 'Downloaded base installer is empty'
- # The trailing --shell wins over any forwarded one, so the route stays authoritative.
- sh "$variant_tmpdir/install.sh" "$@" --shell "$variant_shell"
+ # The explicit override wins over any inherited COMPOSIO_INSTALL_SHELL, so the route stays authoritative.
+ COMPOSIO_INSTALL_SHELL="$variant_shell" sh "$variant_tmpdir/install.sh" "$@"
}
main "$@"
diff --git a/install/fish.sh b/install/fish.sh
index d77d0f894..c1d5f26f7 100755
--- a/install/fish.sh
+++ b/install/fish.sh
@@ -71,8 +71,8 @@ main() {
download_installer "$variant_script_url" "$variant_tmpdir/install.sh" || error 'Failed to download the base installer'
[ -s "$variant_tmpdir/install.sh" ] || error 'Downloaded base installer is empty'
- # The trailing --shell wins over any forwarded one, so the route stays authoritative.
- sh "$variant_tmpdir/install.sh" "$@" --shell "$variant_shell"
+ # The explicit override wins over any inherited COMPOSIO_INSTALL_SHELL, so the route stays authoritative.
+ COMPOSIO_INSTALL_SHELL="$variant_shell" sh "$variant_tmpdir/install.sh" "$@"
}
main "$@"
diff --git a/install/zsh.sh b/install/zsh.sh
index 0e2d941fb..4ad28f709 100755
--- a/install/zsh.sh
+++ b/install/zsh.sh
@@ -71,8 +71,8 @@ main() {
download_installer "$variant_script_url" "$variant_tmpdir/install.sh" || error 'Failed to download the base installer'
[ -s "$variant_tmpdir/install.sh" ] || error 'Downloaded base installer is empty'
- # The trailing --shell wins over any forwarded one, so the route stays authoritative.
- sh "$variant_tmpdir/install.sh" "$@" --shell "$variant_shell"
+ # The explicit override wins over any inherited COMPOSIO_INSTALL_SHELL, so the route stays authoritative.
+ COMPOSIO_INSTALL_SHELL="$variant_shell" sh "$variant_tmpdir/install.sh" "$@"
}
main "$@"
diff --git a/test/install-sh-release-resolution.test.sh b/test/install-sh-release-resolution.test.sh
index 440f2dabf..f03e82519 100755
--- a/test/install-sh-release-resolution.test.sh
+++ b/test/install-sh-release-resolution.test.sh
@@ -280,7 +280,7 @@ EOF
export TEST_COMPOSIO_LOG="$composio_log"
reset_case() {
- unset CASE_GITHUB_URL CASE_API_BASE CASE_INSTALL_VERSION CASE_PLUGINS CASE_QUIET CASE_DEBUG CASE_HELP
+ unset CASE_GITHUB_URL CASE_API_BASE CASE_INSTALL_VERSION CASE_INSTALL_SHELL CASE_PLUGINS CASE_QUIET CASE_DEBUG CASE_HELP
unset CASE_ALLOW_HTTP_HOST CASE_CHECKSUM_MODE CASE_API_ASSET_URL CASE_BASE_MODE CASE_REDIRECT_DOWNGRADE
unset CASE_SHELL_CAPABILITY CASE_INSTALL_EXIT CASE_SETUP_EXIT CASE_VERSION_EXIT CASE_PATH_PREFIX CASE_UNSET_SHELL
unset CASE_CURL_DELAY_URL CASE_CURL_DELAY_SECONDS
@@ -306,6 +306,7 @@ EOF
COMPOSIO_INSTALL_DIR="$install_dir" \
COMPOSIO_BIN_DIR="$bin_dir" \
COMPOSIO_INSTALL_VERSION="${CASE_INSTALL_VERSION:-}" \
+ COMPOSIO_INSTALL_SHELL="${CASE_INSTALL_SHELL:-}" \
COMPOSIO_INSTALL_PLUGINS="${CASE_PLUGINS:-0}" \
COMPOSIO_QUIET="${CASE_QUIET:-0}" \
COMPOSIO_DEBUG="${CASE_DEBUG:-0}" \
@@ -542,40 +543,37 @@ EOF
done
reset_case
+ CASE_INSTALL_SHELL=zsh
direct_home="$case_root/direct-shell-home"
direct_bin="$case_root/direct-shell-bin"
- direct_output=$(run_installer "$direct_home" "$case_root/direct-shell-install" "$direct_bin" "$stable_tag" --shell zsh 2>&1)
- grep -Fq "|installer|$direct_bin|install --shell zsh" "$composio_log" || fail "$interpreter_name --shell delegation"
- assert_contains "$direct_output" 'Configured zsh shell setup (cli).' "$interpreter_name --shell confirmation"
- assert_not_contains "$direct_output" 'Required next step' "$interpreter_name --shell must not print setup guidance"
- [[ ! -e "$direct_home/.zshrc" ]] || fail "$interpreter_name --shell CLI path must not write rc files"
+ direct_output=$(run_installer "$direct_home" "$case_root/direct-shell-install" "$direct_bin" "$stable_tag" 2>&1)
+ grep -Fq "|installer|$direct_bin|install --shell zsh" "$composio_log" || fail "$interpreter_name COMPOSIO_INSTALL_SHELL delegation"
+ assert_contains "$direct_output" 'Configured zsh shell setup (cli).' "$interpreter_name COMPOSIO_INSTALL_SHELL confirmation"
+ assert_not_contains "$direct_output" 'Required next step' "$interpreter_name COMPOSIO_INSTALL_SHELL must not print setup guidance"
+ [[ ! -e "$direct_home/.zshrc" ]] || fail "$interpreter_name COMPOSIO_INSTALL_SHELL CLI path must not write rc files"
reset_case
+ CASE_INSTALL_SHELL=zsh
CASE_SHELL_CAPABILITY=unsupported
direct_fallback_home="$case_root/direct-fallback-home"
- direct_fallback_output=$(run_installer "$direct_fallback_home" "$case_root/direct-fallback-install" "$case_root/direct-fallback-bin" "$stable_tag" --shell zsh 2>&1)
- grep -Fqx '# Composio CLI' "$direct_fallback_home/.zshrc" || fail "$interpreter_name --shell unsupported CLI fallback"
- assert_contains "$direct_fallback_output" 'Configured zsh shell setup (fallback).' "$interpreter_name --shell fallback confirmation"
+ direct_fallback_output=$(run_installer "$direct_fallback_home" "$case_root/direct-fallback-install" "$case_root/direct-fallback-bin" "$stable_tag" 2>&1)
+ grep -Fqx '# Composio CLI' "$direct_fallback_home/.zshrc" || fail "$interpreter_name COMPOSIO_INSTALL_SHELL unsupported CLI fallback"
+ assert_contains "$direct_fallback_output" 'Configured zsh shell setup (fallback).' "$interpreter_name COMPOSIO_INSTALL_SHELL fallback confirmation"
reset_case
+ CASE_INSTALL_SHELL=fish
CASE_INSTALL_EXIT=23
direct_failed_home="$case_root/direct-failed-home"
- run_installer "$direct_failed_home" "$case_root/direct-failed-install" "$case_root/direct-failed-bin" "$stable_tag" --shell fish >/dev/null 2>&1
- grep -Fqx '# Composio CLI' "$direct_failed_home/.config/fish/config.fish" || fail "$interpreter_name --shell failed delegation fallback"
+ run_installer "$direct_failed_home" "$case_root/direct-failed-install" "$case_root/direct-failed-bin" "$stable_tag" >/dev/null 2>&1
+ grep -Fqx '# Composio CLI' "$direct_failed_home/.config/fish/config.fish" || fail "$interpreter_name COMPOSIO_INSTALL_SHELL failed delegation fallback"
reset_case
- if missing_shell_output=$(run_installer "$case_root/missing-shell-home" "$case_root/missing-shell-install" "$case_root/missing-shell-bin" --shell 2>&1); then
- fail "$interpreter_name --shell without a value must fail"
+ CASE_INSTALL_SHELL=tcsh
+ if invalid_shell_output=$(run_installer "$case_root/invalid-shell-home" "$case_root/invalid-shell-install" "$case_root/invalid-shell-bin" 2>&1); then
+ fail "$interpreter_name invalid COMPOSIO_INSTALL_SHELL must fail"
fi
- assert_contains "$missing_shell_output" '--shell requires a value' "$interpreter_name --shell missing value"
- [[ ! -s "$curl_log" ]] || fail "$interpreter_name --shell missing value must fail before network"
-
- reset_case
- if invalid_shell_output=$(run_installer "$case_root/invalid-shell-home" "$case_root/invalid-shell-install" "$case_root/invalid-shell-bin" --shell tcsh 2>&1); then
- fail "$interpreter_name invalid --shell value must fail"
- fi
- assert_contains "$invalid_shell_output" 'Invalid --shell value' "$interpreter_name invalid --shell message"
- [[ ! -s "$curl_log" ]] || fail "$interpreter_name invalid --shell must fail before network"
+ assert_contains "$invalid_shell_output" 'COMPOSIO_INSTALL_SHELL must be zsh, bash, or fish' "$interpreter_name invalid COMPOSIO_INSTALL_SHELL message"
+ [[ ! -s "$curl_log" ]] || fail "$interpreter_name invalid COMPOSIO_INSTALL_SHELL must fail before network"
reset_case
CASE_SHELL_CAPABILITY=unsupported
diff --git a/ts/e2e-tests/cli/install/e2e.test.ts b/ts/e2e-tests/cli/install/e2e.test.ts
index 69f4c4390..33c02b136 100644
--- a/ts/e2e-tests/cli/install/e2e.test.ts
+++ b/ts/e2e-tests/cli/install/e2e.test.ts
@@ -127,12 +127,12 @@ test "$(grep -Fc '# Composio CLI' "$HOME/.bashrc")" = 1
);
it(
- 'configures bash through the base installer --shell flag idempotently',
+ 'configures bash through COMPOSIO_INSTALL_SHELL idempotently',
async () => {
const result = await run(`
set -eu
-curl -fsSL "$INSTALL_BASE_URL/install" | sh -s -- --shell bash
-curl -fsSL "$INSTALL_BASE_URL/install" | sh -s -- --shell bash
+curl -fsSL "$INSTALL_BASE_URL/install" | COMPOSIO_INSTALL_SHELL=bash sh
+curl -fsSL "$INSTALL_BASE_URL/install" | COMPOSIO_INSTALL_SHELL=bash sh
test "$(bash -ilc 'command -v composio')" = "$HOME/.local/bin/composio"
test "$(bash -ilc 'composio --version')" = 98.0.0
test "$(grep -Fc '# Composio CLI' "$HOME/.bashrc")" = 1