Weco LogoWeco Docs

Installation

How to install the Weco CLI

Prerequisites

The weco CLI currently supports Python version 3.8 and above.

Installation

Install the weco CLI using pip:

pip install weco

Install from source:

git clone https://github.com/wecoai/weco-cli.git
cd weco-cli
pip install -e .

Tip: We recommend using a virtual environment.

API Key Configuration

Weco requires API keys for the Large Language Models (LLMs) it uses internally. Set the following environment variables based on the LLM you want to use:

  • OpenAI:

    export OPENAI_API_KEY="your_key_here"
  • Anthropic:

    export ANTHROPIC_API_KEY="your_key_here"
  • Google DeepMind:

    export GEMINI_API_KEY="your_key_here"

    Google AI Studio has a free API usage quota. Create a key here to use weco for free.

Weco Account (Optional)

To associate your optimization runs with your Weco account and view them on the Weco dashboard, you can log in.

Login Process

Weco uses a device authentication flow:

  1. When you first run weco run, you'll be prompted if you want to log in or proceed anonymously.
  2. If you choose to log in (by pressing l), you'll be shown a URL and weco will attempt to open it in your default web browser.
  3. You then authenticate in the browser. Once authenticated, the CLI will detect this and complete the login.
  4. This saves a Weco-specific API key locally (typically at ~/.config/weco/credentials.json).

If you choose to skip login (by pressing Enter or s), weco will still function using the environment variable LLM keys, but the run history will not be linked to a Weco account.

Logging Out

To log out and remove your saved Weco API key, use the following command:

weco logout

Next Steps

Once you've installed Weco and configured your API keys, you're ready to start optimizing your code:

  • Check out the Getting Started guide to learn how to use the Weco CLI
  • Check out the CLI Reference to learn more about the commands and options available
  • Explore our Examples to see Weco in action

On this page