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
Replace the base installer's --shell flag with a COMPOSIO_INSTALL_SHELL environment variable, matching the COMPOSIO_INSTALL_VERSION precedent and reading more naturally in the curl-pipe form: curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=zsh sh The variable is validated before any network call. Shell variants set it explicitly when invoking the base installer, so the route stays authoritative over any inherited value. The composio install --shell CLI flag and the delegation/fallback behavior are unchanged.
jkomyno committed
Aug 3, 2026 at 14:11 UTC
0c768c32037bdb062a54d8512410059dca4f4f20
11 files changed
+53
-58
.github/workflows/build-cli-binaries.yml
+1
-1
@@ -341,7 +341,7 @@ jobs:
341
export PATH="$COMPOSIO_BIN_DIR:$PATH"
342
```
343
344
- 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.
344
+ 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.
345
346
## Usage
347
.github/workflows/cli.install-e2e.yml
+1
-1
@@ -193,7 +193,7 @@ jobs:
193
echo ""
194
echo '```sh'
195
echo "curl -fsSL \"$RAW_BASE/install.sh\" | sh"
196
- echo "curl -fsSL \"$RAW_BASE/install.sh\" | sh -s -- --shell zsh"
196
+ echo "curl -fsSL \"$RAW_BASE/install.sh\" | COMPOSIO_INSTALL_SHELL=zsh sh"
197
echo '```'
198
echo ""
199
echo "Shell-specific setup routes (the override points the variant at this PR's base installer):"
INSTALL.md
+4
-4
@@ -9,9 +9,9 @@ curl -fsSL https://composio.dev/install | sh
9
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:
10
11
```bash
12
-curl -fsSL https://composio.dev/install | sh -s -- --shell zsh
13
-curl -fsSL https://composio.dev/install | sh -s -- --shell bash
14
-curl -fsSL https://composio.dev/install | sh -s -- --shell fish
12
+curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=zsh sh
13
+curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=bash sh
14
+curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=fish sh
15
```
16
17
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`.
34
| `COMPOSIO_DEBUG` | Set to `1` or `true` to print installer traces. | Unset |
35
| `COMPOSIO_INSTALL_HELP` | Set to `0` to hide post-install guidance. | `1` |
36
| `COMPOSIO_INSTALL_PLUGINS` | Set to `1` to install plugins for detected agent hosts. | `0` |
37
+| `COMPOSIO_INSTALL_SHELL` | Configure the requested shell (`zsh`, `bash`, or `fish`) after installation. | Unset |
38
| `--agent` | Log in as a Composio agent after installation. | Off |
39
| `--no-plugins` | Skip plugin setup. Kept for compatibility. | Off |
39
-| `--shell` | Configure the requested shell (`zsh`, `bash`, or `fish`) after installation. | Off |
40
41
## Manual Installation
42
docs/content/changelog/07-31-26-installer.mdx
+1
-1
@@ -10,6 +10,6 @@ The Composio CLI installer now separates the release bundle from the command you
10
11
- `curl -fsSL https://composio.dev/install | sh` installs the verified release bundle in `~/.composio` and creates `~/.local/bin/composio`.
12
- The default flow does not edit shell files, install agent plugins, or log you in.
13
-- `--shell zsh|bash|fish` configures the requested shell explicitly, for example `curl -fsSL https://composio.dev/install | sh -s -- --shell zsh`.
13
+- `COMPOSIO_INSTALL_SHELL=zsh|bash|fish` configures the requested shell explicitly, for example `curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=zsh sh`.
14
- `COMPOSIO_INSTALL_VERSION`, `COMPOSIO_BIN_DIR`, `COMPOSIO_QUIET`, and `COMPOSIO_DEBUG` give you control over version, layout, and output.
15
- Existing `COMPOSIO_INSTALL_DIR` configurations keep their bundle-directory meaning.
docs/content/docs/cli.mdx
+5
-5
@@ -57,36 +57,36 @@ curl -fsSL https://composio.dev/install | sh -s -- @composio/cli@0.3.1
57
| `COMPOSIO_DEBUG` | Set to `1` or `true` to print download URLs and temporary paths. | Unset |
58
| `COMPOSIO_INSTALL_HELP` | Set to `0` to hide post-install guidance. | `1` |
59
| `COMPOSIO_INSTALL_PLUGINS` | Set to `1` to run `composio setup --target auto --yes --if-present` after installation. | `0` |
60
+| `COMPOSIO_INSTALL_SHELL` | Configure the requested shell (`zsh`, `bash`, or `fish`) after installation. See [Configure your shell](#configure-your-shell). | Unset |
61
| `COMPOSIO_GITHUB_OWNER` | GitHub owner used to resolve releases. | `ComposioHQ` |
62
| `COMPOSIO_GITHUB_REPO` | GitHub repository used to resolve releases. | `composio` |
63
| `COMPOSIO_GITHUB_URL` | GitHub web and release-download base URL. | `https://github.com` |
64
| `COMPOSIO_GITHUB_API_BASE_URL` | GitHub API base URL. | Derived from `COMPOSIO_GITHUB_URL` |
65
| `--agent` | Log in as a Composio agent after installation. | Off |
66
| `--no-plugins` | Skip agent plugin setup. Kept for compatibility and now matches the default. | Off |
66
-| `--shell` | Configure the requested shell (`zsh`, `bash`, or `fish`) after installation. See [Configure your shell](#configure-your-shell). | Off |
67
68
### Configure your shell
69
70
-Pass `--shell` when `~/.local/bin` is not already on `PATH`, or when you want the CLI to configure the requested shell explicitly.
70
+Set `COMPOSIO_INSTALL_SHELL` when `~/.local/bin` is not already on `PATH`, or when you want the CLI to configure the requested shell explicitly.
71
72
<Tabs groupId="shell" items={['zsh','bash','fish']} persist>
73
<Tab value="zsh">
74
```bash
75
-curl -fsSL https://composio.dev/install | sh -s -- --shell zsh
75
+curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=zsh sh
76
```
77
78
This configures `~/.zshrc` and delegates setup to `composio install --shell zsh`.
79
</Tab>
80
<Tab value="bash">
81
```bash
82
-curl -fsSL https://composio.dev/install | sh -s -- --shell bash
82
+curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=bash sh
83
```
84
85
This configures `~/.bashrc`. If `~/.bash_profile` or `~/.bash_login` exists, it also updates the first active login file so `bash -ilc` can find `composio`.
86
</Tab>
87
<Tab value="fish">
88
```bash
89
-curl -fsSL https://composio.dev/install | sh -s -- --shell fish
89
+curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=fish sh
90
```
91
92
This configures `~/.config/fish/config.fish` and delegates setup to `composio install --shell fish`.
install.sh
+12
-15
@@ -38,14 +38,14 @@ tildify() {
38
39
print_usage() {
40
printf '%s\n' \
41
- 'Usage: install.sh [--agent] [--no-plugins] [--shell zsh|bash|fish] [version-tag]' \
41
+ 'Usage: install.sh [--agent] [--no-plugins] [version-tag]' \
42
'' \
43
'Options:' \
44
- ' --agent Sign up or log in as a Composio agent after installation.' \
45
- ' --no-plugins Skip agent plugin installation (the default).' \
46
- ' --shell <shell> Configure zsh, bash, or fish so the composio command is on PATH.' \
47
- ' -h, --help Show this help.' \
44
+ ' --agent Sign up or log in as a Composio agent after installation.' \
45
+ ' --no-plugins Skip agent plugin installation (the default).' \
46
+ ' -h, --help Show this help.' \
47
'' \
48
+ 'Set COMPOSIO_INSTALL_SHELL=zsh|bash|fish to configure that shell after installation.' \
49
'Version tags may be stable or beta, for example 0.3.1 or @composio/cli@0.3.1-beta.329.'
50
}
51
@@ -384,7 +384,7 @@ print_post_install_help() {
384
else
385
printf 'Optional shell setup for future PATH changes:\n\n'
386
fi
387
- printf ' curl -fsSL https://composio.dev/install | sh -s -- --shell %s\n' "$shell_route"
387
+ printf ' curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=%s sh\n' "$shell_route"
388
printf '\nThis configures %s.\n' "$shell_config"
389
elif path_contains_bin_dir; then
390
printf 'The composio command is available on PATH.\n'
@@ -411,25 +411,22 @@ main() {
411
install_agent=0
412
install_plugins=${COMPOSIO_INSTALL_PLUGINS:-0}
413
version_arg=
414
- requested_shell=
414
+ requested_shell=${COMPOSIO_INSTALL_SHELL:-}
415
416
case $install_plugins in
417
0 | 1) ;;
418
*) error 'COMPOSIO_INSTALL_PLUGINS must be 1 or 0' ;;
419
esac
420
421
+ case $requested_shell in
422
+ '' | zsh | bash | fish) ;;
423
+ *) error "COMPOSIO_INSTALL_SHELL must be zsh, bash, or fish (got \"$requested_shell\")" ;;
424
+ esac
425
+
426
while [ "$#" -gt 0 ]; do
427
case $1 in
428
--agent) install_agent=1 ;;
429
--no-plugins) install_plugins=0 ;;
425
- --shell)
426
- [ "$#" -ge 2 ] || error '--shell requires a value: zsh, bash, or fish'
427
- case $2 in
428
- zsh | bash | fish) requested_shell=$2 ;;
429
- *) error "Invalid --shell value \"$2\". Expected zsh, bash, or fish." ;;
430
- esac
431
- shift
432
- ;;
430
-h | --help)
431
print_usage
432
return 0
install/bash.sh
+2
-2
@@ -71,8 +71,8 @@ main() {
71
download_installer "$variant_script_url" "$variant_tmpdir/install.sh" || error 'Failed to download the base installer'
72
[ -s "$variant_tmpdir/install.sh" ] || error 'Downloaded base installer is empty'
73
74
- # The trailing --shell wins over any forwarded one, so the route stays authoritative.
75
- sh "$variant_tmpdir/install.sh" "$@" --shell "$variant_shell"
74
+ # The explicit override wins over any inherited COMPOSIO_INSTALL_SHELL, so the route stays authoritative.
75
+ COMPOSIO_INSTALL_SHELL="$variant_shell" sh "$variant_tmpdir/install.sh" "$@"
76
}
77
78
main "$@"
install/fish.sh
+2
-2
@@ -71,8 +71,8 @@ main() {
71
download_installer "$variant_script_url" "$variant_tmpdir/install.sh" || error 'Failed to download the base installer'
72
[ -s "$variant_tmpdir/install.sh" ] || error 'Downloaded base installer is empty'
73
74
- # The trailing --shell wins over any forwarded one, so the route stays authoritative.
75
- sh "$variant_tmpdir/install.sh" "$@" --shell "$variant_shell"
74
+ # The explicit override wins over any inherited COMPOSIO_INSTALL_SHELL, so the route stays authoritative.
75
+ COMPOSIO_INSTALL_SHELL="$variant_shell" sh "$variant_tmpdir/install.sh" "$@"
76
}
77
78
main "$@"
install/zsh.sh
+2
-2
@@ -71,8 +71,8 @@ main() {
71
download_installer "$variant_script_url" "$variant_tmpdir/install.sh" || error 'Failed to download the base installer'
72
[ -s "$variant_tmpdir/install.sh" ] || error 'Downloaded base installer is empty'
73
74
- # The trailing --shell wins over any forwarded one, so the route stays authoritative.
75
- sh "$variant_tmpdir/install.sh" "$@" --shell "$variant_shell"
74
+ # The explicit override wins over any inherited COMPOSIO_INSTALL_SHELL, so the route stays authoritative.
75
+ COMPOSIO_INSTALL_SHELL="$variant_shell" sh "$variant_tmpdir/install.sh" "$@"
76
}
77
78
main "$@"
test/install-sh-release-resolution.test.sh
+20
-22
@@ -280,7 +280,7 @@ EOF
280
export TEST_COMPOSIO_LOG="$composio_log"
281
282
reset_case() {
283
- unset CASE_GITHUB_URL CASE_API_BASE CASE_INSTALL_VERSION CASE_PLUGINS CASE_QUIET CASE_DEBUG CASE_HELP
283
+ unset CASE_GITHUB_URL CASE_API_BASE CASE_INSTALL_VERSION CASE_INSTALL_SHELL CASE_PLUGINS CASE_QUIET CASE_DEBUG CASE_HELP
284
unset CASE_ALLOW_HTTP_HOST CASE_CHECKSUM_MODE CASE_API_ASSET_URL CASE_BASE_MODE CASE_REDIRECT_DOWNGRADE
285
unset CASE_SHELL_CAPABILITY CASE_INSTALL_EXIT CASE_SETUP_EXIT CASE_VERSION_EXIT CASE_PATH_PREFIX CASE_UNSET_SHELL
286
unset CASE_CURL_DELAY_URL CASE_CURL_DELAY_SECONDS
@@ -306,6 +306,7 @@ EOF
306
COMPOSIO_INSTALL_DIR="$install_dir" \
307
COMPOSIO_BIN_DIR="$bin_dir" \
308
COMPOSIO_INSTALL_VERSION="${CASE_INSTALL_VERSION:-}" \
309
+ COMPOSIO_INSTALL_SHELL="${CASE_INSTALL_SHELL:-}" \
310
COMPOSIO_INSTALL_PLUGINS="${CASE_PLUGINS:-0}" \
311
COMPOSIO_QUIET="${CASE_QUIET:-0}" \
312
COMPOSIO_DEBUG="${CASE_DEBUG:-0}" \
@@ -542,40 +543,37 @@ EOF
543
done
544
545
reset_case
546
+ CASE_INSTALL_SHELL=zsh
547
direct_home="$case_root/direct-shell-home"
548
direct_bin="$case_root/direct-shell-bin"
547
- direct_output=$(run_installer "$direct_home" "$case_root/direct-shell-install" "$direct_bin" "$stable_tag" --shell zsh 2>&1)
548
- grep -Fq "|installer|$direct_bin|install --shell zsh" "$composio_log" || fail "$interpreter_name --shell delegation"
549
- assert_contains "$direct_output" 'Configured zsh shell setup (cli).' "$interpreter_name --shell confirmation"
550
- assert_not_contains "$direct_output" 'Required next step' "$interpreter_name --shell must not print setup guidance"
551
- [[ ! -e "$direct_home/.zshrc" ]] || fail "$interpreter_name --shell CLI path must not write rc files"
549
+ direct_output=$(run_installer "$direct_home" "$case_root/direct-shell-install" "$direct_bin" "$stable_tag" 2>&1)
550
+ grep -Fq "|installer|$direct_bin|install --shell zsh" "$composio_log" || fail "$interpreter_name COMPOSIO_INSTALL_SHELL delegation"
551
+ assert_contains "$direct_output" 'Configured zsh shell setup (cli).' "$interpreter_name COMPOSIO_INSTALL_SHELL confirmation"
552
+ assert_not_contains "$direct_output" 'Required next step' "$interpreter_name COMPOSIO_INSTALL_SHELL must not print setup guidance"
553
+ [[ ! -e "$direct_home/.zshrc" ]] || fail "$interpreter_name COMPOSIO_INSTALL_SHELL CLI path must not write rc files"
554
555
reset_case
556
+ CASE_INSTALL_SHELL=zsh
557
CASE_SHELL_CAPABILITY=unsupported
558
direct_fallback_home="$case_root/direct-fallback-home"
556
- direct_fallback_output=$(run_installer "$direct_fallback_home" "$case_root/direct-fallback-install" "$case_root/direct-fallback-bin" "$stable_tag" --shell zsh 2>&1)
557
- grep -Fqx '# Composio CLI' "$direct_fallback_home/.zshrc" || fail "$interpreter_name --shell unsupported CLI fallback"
558
- assert_contains "$direct_fallback_output" 'Configured zsh shell setup (fallback).' "$interpreter_name --shell fallback confirmation"
559
+ direct_fallback_output=$(run_installer "$direct_fallback_home" "$case_root/direct-fallback-install" "$case_root/direct-fallback-bin" "$stable_tag" 2>&1)
560
+ grep -Fqx '# Composio CLI' "$direct_fallback_home/.zshrc" || fail "$interpreter_name COMPOSIO_INSTALL_SHELL unsupported CLI fallback"
561
+ assert_contains "$direct_fallback_output" 'Configured zsh shell setup (fallback).' "$interpreter_name COMPOSIO_INSTALL_SHELL fallback confirmation"
562
563
reset_case
564
+ CASE_INSTALL_SHELL=fish
565
CASE_INSTALL_EXIT=23
566
direct_failed_home="$case_root/direct-failed-home"
563
- run_installer "$direct_failed_home" "$case_root/direct-failed-install" "$case_root/direct-failed-bin" "$stable_tag" --shell fish >/dev/null 2>&1
564
- grep -Fqx '# Composio CLI' "$direct_failed_home/.config/fish/config.fish" || fail "$interpreter_name --shell failed delegation fallback"
567
+ run_installer "$direct_failed_home" "$case_root/direct-failed-install" "$case_root/direct-failed-bin" "$stable_tag" >/dev/null 2>&1
568
+ grep -Fqx '# Composio CLI' "$direct_failed_home/.config/fish/config.fish" || fail "$interpreter_name COMPOSIO_INSTALL_SHELL failed delegation fallback"
569
570
reset_case
567
- 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
568
- fail "$interpreter_name --shell without a value must fail"
571
+ CASE_INSTALL_SHELL=tcsh
572
+ if invalid_shell_output=$(run_installer "$case_root/invalid-shell-home" "$case_root/invalid-shell-install" "$case_root/invalid-shell-bin" 2>&1); then
573
+ fail "$interpreter_name invalid COMPOSIO_INSTALL_SHELL must fail"
574
fi
570
- assert_contains "$missing_shell_output" '--shell requires a value' "$interpreter_name --shell missing value"
571
- [[ ! -s "$curl_log" ]] || fail "$interpreter_name --shell missing value must fail before network"
572
-
573
- reset_case
574
- 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
575
- fail "$interpreter_name invalid --shell value must fail"
576
- fi
577
- assert_contains "$invalid_shell_output" 'Invalid --shell value' "$interpreter_name invalid --shell message"
578
- [[ ! -s "$curl_log" ]] || fail "$interpreter_name invalid --shell must fail before network"
575
+ assert_contains "$invalid_shell_output" 'COMPOSIO_INSTALL_SHELL must be zsh, bash, or fish' "$interpreter_name invalid COMPOSIO_INSTALL_SHELL message"
576
+ [[ ! -s "$curl_log" ]] || fail "$interpreter_name invalid COMPOSIO_INSTALL_SHELL must fail before network"
577
578
reset_case
579
CASE_SHELL_CAPABILITY=unsupported
ts/e2e-tests/cli/install/e2e.test.ts
+3
-3
@@ -127,12 +127,12 @@ test "$(grep -Fc '# Composio CLI' "$HOME/.bashrc")" = 1
127
);
128
129
it(
130
- 'configures bash through the base installer --shell flag idempotently',
130
+ 'configures bash through COMPOSIO_INSTALL_SHELL idempotently',
131
async () => {
132
const result = await run(`
133
set -eu
134
-curl -fsSL "$INSTALL_BASE_URL/install" | sh -s -- --shell bash
135
-curl -fsSL "$INSTALL_BASE_URL/install" | sh -s -- --shell bash
134
+curl -fsSL "$INSTALL_BASE_URL/install" | COMPOSIO_INSTALL_SHELL=bash sh
135
+curl -fsSL "$INSTALL_BASE_URL/install" | COMPOSIO_INSTALL_SHELL=bash sh
136
test "$(bash -ilc 'command -v composio')" = "$HOME/.local/bin/composio"
137
test "$(bash -ilc 'composio --version')" = 98.0.0
138
test "$(grep -Fc '# Composio CLI' "$HOME/.bashrc")" = 1