Skip to content
Merged
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- **Qoder install/upgrade commands**
- Fixed exit status 127 error when running `agentpipe agents install qoder` or `agentpipe agents upgrade qoder`
- Changed from `bash --` to `bash -s --` in install/upgrade commands for proper stdin handling
- Updated commands: `curl -fsSL https://qoder.com/install | bash -s -- --force`
- Added test to verify bash command format in agent registry
- Fixes #26

## [0.5.5] - 2025-10-26

### Fixed
Expand Down
8 changes: 4 additions & 4 deletions internal/registry/agents.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@
"package_manager": "manifest",
"package_name": "https://qoder-ide.oss-ap-southeast-1.aliyuncs.com/qodercli/channels/manifest.json",
"install": {
"darwin": "curl -fsSL https://qoder.com/install | bash -- --force",
"linux": "curl -fsSL https://qoder.com/install | bash -- --force",
"darwin": "curl -fsSL https://qoder.com/install | bash -s -- --force",
"linux": "curl -fsSL https://qoder.com/install | bash -s -- --force",
"windows": "See https://qoder.com/cli"
},
"uninstall": {
Expand All @@ -258,8 +258,8 @@
"windows": "See https://qoder.com/cli for uninstall instructions"
},
"upgrade": {
"darwin": "curl -fsSL https://qoder.com/install | bash -- --force",
"linux": "curl -fsSL https://qoder.com/install | bash -- --force",
"darwin": "curl -fsSL https://qoder.com/install | bash -s -- --force",
"linux": "curl -fsSL https://qoder.com/install | bash -s -- --force",
"windows": "See https://qoder.com/cli for upgrade instructions"
},
"requires_auth": true
Expand Down
40 changes: 40 additions & 0 deletions internal/registry/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,43 @@ func verifyCommandMap(t *testing.T, commands map[string]string, cmdType, expecte
func shouldSkipCommand(cmd string) bool {
return cmd == "" || (len(cmd) >= 3 && cmd[:3] == "See")
}

func TestQoderBashCommandFormat(t *testing.T) {
agent, err := GetByName("Qoder")
if err != nil {
t.Fatalf("Failed to get Qoder agent: %v", err)
}

// Test install commands
for os, cmd := range agent.Install {
verifyBashCommandFormat(t, "Install", os, cmd)
}

// Test upgrade commands
for os, cmd := range agent.Upgrade {
verifyBashCommandFormat(t, "Upgrade", os, cmd)
}
}

func verifyBashCommandFormat(t *testing.T, cmdType, os, cmd string) {
t.Helper()
if shouldSkipCommand(cmd) {
return
}
// Only check piped bash commands
if !strings.Contains(cmd, "|") || !strings.Contains(cmd, "bash") {
return
}

// Extract what comes after "bash" in the command
bashIndex := strings.Index(cmd, "bash")
afterBash := cmd[bashIndex+4:] // Everything after "bash"
afterBash = strings.TrimSpace(afterBash)

// If there are arguments after bash (starts with -- or -), require -s flag
if len(afterBash) > 0 && (strings.HasPrefix(afterBash, "--") || strings.HasPrefix(afterBash, "-")) {
if !strings.Contains(cmd, "bash -s") {
t.Errorf("%s command for %s passes arguments to bash without '-s' flag: %s\nWhen passing arguments to a piped script, use 'bash -s -- <args>' instead of 'bash -- <args>'", cmdType, os, cmd)
}
}
}
Loading