Created
June 6, 2025 13:14
-
-
Save jambelnet/b184684cd71d5a83705c3d246a9a0995 to your computer and use it in GitHub Desktop.
A Bash script to automate the installation and configuration of OpenManus.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Install uv | |
| echo "Installing uv..." | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| # Clone the repository | |
| echo "Cloning OpenManus repository..." | |
| git clone https://github.com/mannaandpoem/OpenManus.git | |
| cd OpenManus || exit | |
| # Create virtual environment | |
| echo "Creating virtual environment with Python 3.12..." | |
| uv venv --python 3.12 | |
| # Activate virtual environment and install requirements | |
| echo "Activating virtual environment and installing requirements..." | |
| source .venv/bin/activate | |
| uv pip install -r requirements.txt | |
| # Configuration setup | |
| echo "Setting up configuration..." | |
| mkdir -p config | |
| # Check if config file already exists | |
| if [ -f "config/config.toml" ]; then | |
| echo "config.toml already exists. Would you like to overwrite it? (y/n)" | |
| read -r overwrite | |
| if [[ "$overwrite" != "y" && "$overwrite" != "Y" ]]; then | |
| echo "Skipping configuration setup." | |
| exit 0 | |
| fi | |
| fi | |
| # Copy example config | |
| cp config/config.example.toml config/config.toml | |
| # Prompt for configuration values | |
| echo "OpenManus Configuration Setup" | |
| echo "Please enter your OpenAI API key (starting with 'sk-'):" | |
| read -r api_key | |
| echo "Please enter the model you want to use (default: gpt-4o):" | |
| read -r model | |
| model=${model:-gpt-4o} | |
| echo "Please enter the base URL (default: https://api.openai.com/v1):" | |
| read -r base_url | |
| base_url=${base_url:-https://api.openai.com/v1} | |
| echo "Please enter max tokens (default: 4096):" | |
| read -r max_tokens | |
| max_tokens=${max_tokens:-4096} | |
| echo "Please enter temperature (default: 0.0):" | |
| read -r temperature | |
| temperature=${temperature:-0.0} | |
| # Update config file | |
| sed -i.bak "s|model = \".*\"|model = \"$model\"|" config/config.toml | |
| sed -i.bak "s|base_url = \".*\"|base_url = \"$base_url\"|" config/config.toml | |
| sed -i.bak "s|api_key = \".*\"|api_key = \"$api_key\"|" config/config.toml | |
| sed -i.bak "s|max_tokens = .*|max_tokens = $max_tokens|" config/config.toml | |
| sed -i.bak "s|temperature = .*|temperature = $temperature|" config/config.toml | |
| # Also update the vision section | |
| sed -i.bak "s|\[llm.vision\]\nmodel = \".*\"|\[llm.vision\]\nmodel = \"$model\"|" config/config.toml | |
| sed -i.bak "s|\[llm.vision\]\nbase_url = \".*\"|\[llm.vision\]\nbase_url = \"$base_url\"|" config/config.toml | |
| sed -i.bak "s|\[llm.vision\]\napi_key = \".*\"|\[llm.vision\]\napi_key = \"$api_key\"|" config/config.toml | |
| # Clean up backup file | |
| rm config/config.toml.bak | |
| echo "Configuration complete!" | |
| echo "You can now start using OpenManus. Don't forget to activate the virtual environment with:" | |
| echo "source .venv/bin/activate" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/mannaandpoem/OpenManus