@devries-cameron20 / composio-1 / commits / 5a3c66176
Fork 0

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

Fix install logging for skipped completions (#3052)

## Summary - Make `composio install --no-completions` consistently log that completions were skipped. - Keep the existing completion-install and unavailable-shell messages unchanged. - Add a changeset for the `@composio/cli` patch release. ## Testing - Not run (not requested). - Confirmed the install command now logs `Completions: skipped (--no-completions)` when `--no-completions` is set, even if completion setup would otherwise be available.

Rahul Tarak committed Mar 27, 2026 at 06:42 UTC 5a3c66176410512a6a9a307afbe6c66e629b7de7
3 files changed +57 -19
.changeset/calm-dingos-divide.md new
+5
@@ -0,0 +1,5 @@
1 +---
2 +'@composio/cli': patch
3 +---
4 +
5 +Change `composio install` to skip shell completions by default and require `--completions` to install them explicitly. Also keep the skipped-completions logging consistent.
ts/packages/cli/src/commands/install.cmd.ts
+15 -8
@@ -12,8 +12,13 @@ import { getCompletionScript } from 'src/effects/shell-completions';
12 // Options
13 // ---------------------------------------------------------------------------
14
15 +const completionsOpt = Options.boolean('completions').pipe(
16 + Options.withDescription('Install shell completions.'),
17 + Options.withDefault(false)
18 +);
19 +
20 const noCompletionsOpt = Options.boolean('no-completions').pipe(
16 - Options.withDescription('Skip shell completions setup.'),
21 + Options.withDescription('Deprecated: shell completions are skipped by default.'),
22 Options.withDefault(false)
23 );
24
@@ -122,7 +127,7 @@ const tildify = (p: string, homedir: string): string =>
127 // ---------------------------------------------------------------------------
128
129 export const installShellIntegration = (params: {
125 - readonly noCompletions: boolean;
130 + readonly completions: boolean;
131 }): Effect.Effect<void, PlatformError, TerminalUI | NodeOs | FileSystem.FileSystem> =>
132 Effect.gen(function* () {
133 const ui = yield* TerminalUI;
@@ -162,7 +167,7 @@ export const installShellIntegration = (params: {
167 // Lazy-import the root command to avoid a circular dependency
168 // (index.ts → install.cmd.ts → index.ts).
169 let completionScript: string | undefined;
165 - if (!params.noCompletions && shell !== 'zsh') {
170 + if (params.completions && shell !== 'zsh') {
171 const mod = yield* Effect.promise(() => import('src/commands'));
172 const lines = yield* getCompletionScript(mod.rootCommand, shell);
173 completionScript = lines.length > 0 ? Arr.join(lines, '\n') : undefined;
@@ -191,10 +196,10 @@ export const installShellIntegration = (params: {
196 yield* ui.log.step('PATH: already configured');
197 }
198
194 - if (params.noCompletions) {
195 - yield* ui.log.step('Completions: skipped (--no-completions)');
196 - } else if (shell === 'zsh') {
199 + if (shell === 'zsh') {
200 yield* ui.log.step('Completions: skipped for zsh');
201 + } else if (!params.completions) {
202 + yield* ui.log.step('Completions: skipped by default (pass --completions to enable)');
203 } else if (config.completionBlock && !fileContains(existing, COMPLETIONS_MARKER)) {
204 blocks.push(config.completionBlock);
205 yield* ui.log.step('Completions: will install shell completions');
@@ -246,11 +251,13 @@ export const installShellIntegration = (params: {
251 * @example
252 * ```bash
253 * composio install
254 + * composio install --completions
255 * composio install --no-completions
256 * ```
257 */
258 export const installCmd = Command.make(
259 'install',
254 - { noCompletions: noCompletionsOpt },
255 - ({ noCompletions }) => installShellIntegration({ noCompletions })
260 + { completions: completionsOpt, noCompletions: noCompletionsOpt },
261 + ({ completions, noCompletions }) =>
262 + installShellIntegration({ completions: completions && !noCompletions })
263 ).pipe(Command.withDescription('Set up shell integration (PATH and completions).'));
ts/packages/cli/test/src/commands/install.cmd.test.ts
+37 -11
@@ -31,7 +31,7 @@ describe('CLI: composio install', () => {
31
32 describe('[When] shell is zsh', () => {
33 layer(TestLive())(it => {
34 - it.scoped('[Then] creates .zshrc with PATH only', () =>
34 + it.scoped('[Then] creates .zshrc with PATH only by default', () =>
35 Effect.gen(function* () {
36 const os = yield* NodeOs;
37 process.env.SHELL = '/bin/zsh';
@@ -62,7 +62,7 @@ describe('CLI: composio install', () => {
62
63 describe('[When] shell is bash', () => {
64 layer(TestLive())(it => {
65 - it.scoped('[Then] creates .bashrc with PATH and completions', () =>
65 + it.scoped('[Then] creates .bashrc with PATH only by default', () =>
66 Effect.gen(function* () {
67 const os = yield* NodeOs;
68 process.env.SHELL = '/bin/bash';
@@ -77,7 +77,7 @@ describe('CLI: composio install', () => {
77 expect(contents).toContain('# Composio CLI');
78 expect(contents).toContain('export COMPOSIO_INSTALL_DIR=');
79 expect(contents).toContain('export PATH="$COMPOSIO_INSTALL_DIR:$PATH"');
80 - expect(contents).toContain('# Composio CLI completions');
80 + expect(contents).not.toContain('# Composio CLI completions');
81 })
82 );
83 });
@@ -85,7 +85,7 @@ describe('CLI: composio install', () => {
85
86 describe('[When] shell is fish', () => {
87 layer(TestLive())(it => {
88 - it.scoped('[Then] creates config.fish with PATH and completions', () =>
88 + it.scoped('[Then] creates config.fish with PATH only by default', () =>
89 Effect.gen(function* () {
90 const os = yield* NodeOs;
91 process.env.SHELL = '/usr/bin/fish';
@@ -100,7 +100,33 @@ describe('CLI: composio install', () => {
100 expect(contents).toContain('# Composio CLI');
101 expect(contents).toContain('set --export COMPOSIO_INSTALL_DIR');
102 expect(contents).toContain('set --export PATH $COMPOSIO_INSTALL_DIR $PATH');
103 + expect(contents).not.toContain('# Composio CLI completions');
104 + })
105 + );
106 + });
107 + });
108 +
109 + describe('[When] --completions is passed', () => {
110 + layer(TestLive())(it => {
111 + it.scoped('[Then] writes PATH block and installs completions', () =>
112 + Effect.gen(function* () {
113 + const os = yield* NodeOs;
114 + process.env.SHELL = '/bin/bash';
115 + process.env.COMPOSIO_INSTALL_DIR = path.join(os.homedir, '.composio');
116 +
117 + yield* cli(['install', '--completions']);
118 +
119 + const fs = yield* FileSystem.FileSystem;
120 + const rcPath = path.join(os.homedir, '.bashrc');
121 + const contents = yield* fs.readFileString(rcPath);
122 +
123 + expect(contents).toContain('# Composio CLI');
124 + expect(contents).toContain('export COMPOSIO_INSTALL_DIR=');
125 expect(contents).toContain('# Composio CLI completions');
126 +
127 + const lines = yield* MockConsole.getLines();
128 + const output = lines.join('\n');
129 + expect(output).toContain('Completions: will install shell completions');
130 })
131 );
132 });
@@ -126,7 +152,7 @@ describe('CLI: composio install', () => {
152
153 const lines = yield* MockConsole.getLines();
154 const output = lines.join('\n');
129 - expect(output).toContain('Completions: skipped (--no-completions)');
155 + expect(output).toContain('Completions: skipped for zsh');
156 })
157 );
158 });
@@ -137,15 +163,15 @@ describe('CLI: composio install', () => {
163 it.scoped('[Then] does not duplicate entries', () =>
164 Effect.gen(function* () {
165 const os = yield* NodeOs;
140 - process.env.SHELL = '/bin/zsh';
166 + process.env.SHELL = '/bin/bash';
167 process.env.COMPOSIO_INSTALL_DIR = path.join(os.homedir, '.composio');
168
169 // Run install twice
144 - yield* cli(['install']);
145 - yield* cli(['install']);
170 + yield* cli(['install', '--completions']);
171 + yield* cli(['install', '--completions']);
172
173 const fs = yield* FileSystem.FileSystem;
148 - const rcPath = path.join(os.homedir, '.zshrc');
174 + const rcPath = path.join(os.homedir, '.bashrc');
175 const contents = yield* fs.readFileString(rcPath);
176
177 // Count occurrences of each marker — should be exactly 1
@@ -154,7 +180,7 @@ describe('CLI: composio install', () => {
180 expect(pathMarkerCount).toBe(1);
181
182 const completionsCount = contents.match(/^# Composio CLI completions$/gm)?.length ?? 0;
157 - expect(completionsCount).toBe(0);
183 + expect(completionsCount).toBe(1);
184 })
185 );
186 });
@@ -176,7 +202,7 @@ describe('CLI: composio install', () => {
202 '# existing config\n# Composio CLI\nexport COMPOSIO_INSTALL_DIR=/old\n# Composio CLI completions\n_composio() {}\n'
203 );
204
179 - yield* cli(['install']);
205 + yield* cli(['install', '--completions']);
206
207 const lines = yield* MockConsole.getLines();
208 const output = lines.join('\n');