Skip to content

[Bug]: install --completions writes fish completions into ~/.config/fish/config.fish and generates invalid fish syntax #3147

@xizha127

Description

@xizha127

SDK Language

Not sure

SDK Version

0.2.20

Runtime Environment

Python 3.14.3, CachyOS, fish shell

Environment

Production Deployment

Describe the Bug

Describe the Bug

When installing Composio on fish, the completion setup is written into ~/.config/fish/config.fish instead of a dedicated fish completion file such as ~/.config/fish/completions/composio.fish.

In addition, the generated completion content is not valid fish syntax. The completion block contains very long complete -c composio ... -d '...' descriptions with nested single quotes and multiline examples, which leaves quotes unbalanced and causes fish to fail while sourcing the file.

Actual behavior

  • Composio completion content is appended directly to ~/.config/fish/config.fish
  • fish startup fails with parse errors such as:
~/.config/fish/config.fish (line 734): Unexpected end of string, quotes are not balanced
complete -c composio -n "__fish_seen_subcommand_from orgs; and __fish_seen_subcommand_from switch" -l limit -r -f -d 'Max orgs to fetch from API (default: 50)'
                                                                                                                                                              ^
from sourcing file ~/.config/fish/config.fish
source: Error while reading file “/home/xizha/.config/fish/config.fish”

and later, when moved into a completion file, similar errors remain:

~/.config/fish/completions/composio.fish (line 276): Unexpected end of string, quotes are not balanced
complete -c composio -n "__fish_seen_subcommand_from dev; and __fish_seen_subcommand_from connected-accounts; and not __fish_seen_subcommand_from link; and not __fish_seen_subcommand_from list; a
                        ^

Expected behavior

  • fish completions should be written to ~/.config/fish/completions/composio.fish
  • the generated completion file should pass fish -n
  • ~/.config/fish/config.fish should only contain minimal PATH/init setup, not a huge inline completion dump
  • installing completions should not break shell startup

Steps to Reproduce

curl -fsSL https://raw.githubusercontent.com/ComposioHQ/composio/next/install.sh | bash
exec fish

Minimal Reproducible Example

## Minimal Reproducible Example


curl -fsSL https://raw.githubusercontent.com/ComposioHQ/composio/next/install.sh | bash
exec fish


Then verify:


fish --no-config -c 'source ~/.config/fish/config.fish; echo OK'


Optional extra check:


grep -n "Composio CLI" ~/.config/fish/config.fish

Error Output / Stack Trace

## Error Output / Stack Trace


~/.config/fish/config.fish (line 734): Unexpected end of string, quotes are not balanced
complete -c composio -n "__fish_seen_subcommand_from orgs; and __fish_seen_subcommand_from switch" -l limit -r -f -d 'Max orgs to fetch from API (default: 50)'
                                                                                                                                                              ^
from sourcing file ~/.config/fish/config.fish
source: Error while reading file “/home/xizha/.config/fish/config.fish”


Also observed after moving the generated content into a proper completion file:


~/.config/fish/completions/composio.fish (line 276): Unexpected end of string, quotes are not balanced
complete -c composio -n "__fish_seen_subcommand_from dev; and __fish_seen_subcommand_from connected-accounts; and not __fish_seen_subcommand_from link; and not __fish_seen_subcommand_from list; a
                        ^
warning: Error while reading file /home/xizha/.config/fish/completions/composio.fish

Reproducibility

  • Always reproducible
  • Intermittent / Sometimes
  • Happened once, can’t reproduce

Additional Context or Screenshots

Note, I don't have time to double check anything here, so I apologize in advance that this is all written by AI, but the ChatGPT patched install script worked for me, so it should point to the problem, i attached the install script which is probably trash, but at least it works.

Additional Context or Screenshots

A few related implementation issues I found while debugging:

  • fish completions appear to be handled like shell config instead of fish-native completion files
  • the generated complete lines include long description payloads with nested quotes / multiline examples, which seem to break fish parsing
  • the installer also appears to add the Composio install root directly to PATH rather than the bin directory, which may be a separate issue but showed up in the same flow

Suggested fix:

  • write fish completions only to ~/.config/fish/completions/composio.fish
  • validate generated fish completions with fish -n before installing them
  • avoid embedding long example text in -d descriptions, or properly escape/sanitize it
  • keep config.fish limited to PATH/init logic only

install (1).sh

Metadata

Metadata

Labels

bugSomething isn't workingcliabout the composio universal cli

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions