Skip to content

fix: speed up installer script in interactive mode by using builtin curl progress functionality#23008

Open
karlicoss wants to merge 1 commit intoanomalyco:devfrom
karlicoss:patch-1
Open

fix: speed up installer script in interactive mode by using builtin curl progress functionality#23008
karlicoss wants to merge 1 commit intoanomalyco:devfrom
karlicoss:patch-1

Conversation

@karlicoss
Copy link
Copy Markdown

@karlicoss karlicoss commented Apr 17, 2026

Issue for this PR

Closes #22998

Type of change

  • Bug fix

What does this PR do?

Before the changes the installation was taking ~50 seconds for me.
The actual opencode binary is just 50MB, and manual curl download from github is instantaneous.
This is pretty annoying for ad-hoc setups, e.g. using opencode inside devcontaniers etc.

The reason is --trace-ascii flag is producing a lot of stderr output which is later parsed with sed to recover the progress. This is also eating a lot of CPU in process.

Running this bash install.sh --no-modify-path 2>/dev/null confirms it -- completes in a second since it's not doing --trace-ascii anymore.

Switching to builtin curl --progress-bar resolves the issue. Doesn't look as fancy, but it hardly matters when setup takes 1 second!

How did you verify your code works?

Tested on Ubuntu 24.04

  • bash install.sh 2>/dev/null -- works as before; no progress
  • bash install.sh: works and results in the output below

Screenshots / recordings

Difficult to record since it's so fast now 😅 This is how it looks:

Installing opencode version: 1.4.7
######################################################################################################### 100.0%
                                 ▄
█▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█
█░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀
▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀  ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀

OpenCode includes free models, to start:

cd <project>  # Open directory
opencode      # Run command

For more information visit https://opencode.ai/docs

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…url progress functionality

Fixes anomalyco#22998

Before the changes the installation was taking ~50 seconds for me. The actual opencode binary is just 50MB, and manual curl download from github is instantaneous.

The reason is  `--trace-ascii` flag is producing _a lot_ of stderr output which is later parsed with sed to recover the progress. This is also eating a lot of CPU in process.

Running this `bash install.sh --no-modify-path 2>/dev/null` confirms it -- completes in a second since it's not doing `--trace-ascii` anymore.

Switching to builtin curl `--progress-bar` resolves the issue.

Testing: tested on Ubuntu 24.04

- `bash install.sh 2>/dev/null` -- works as before; no progress
- `bash install.sh`: works and results in the following output

```
Installing opencode version: 1.4.7
 ######################################################################################################### 100.0%
                                 ▄
█▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█
█░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀
▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀  ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀

OpenCode includes free models, to start:

cd <project>  # Open directory
opencode      # Run command

For more information visit https://opencode.ai/docs
```

Not as fancy, but it hardly matters when setup takes 1 second!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Official curl installer is painfully slow

1 participant