User GuideAPI ReferenceAI Applications

Factory Droid CLI

Factory Droid CLI (Droid CLI) is a terminal-based intelligent software engineering agent developed by Factory AI. It deeply understands large codebase contexts and engineering conventions, autonomously executing requirement planning, code implementation, test running, and refactoring directly from the command line to deliver an immersive local autonomous programming experience for developers.

✨ One-Click AI Setup

Copy the prompt below and send it to your AI assistant to automatically detect your environment and complete the setup:

AI 配置提示词 (Prompt)
点击卡片任意位置复制
Please refer to the OpenRely official documentation (https://openrely.ai/en/docs/apps/factory-droid-cli) to help me configure Factory Droid CLI on my current machine:
1. Obtain API Key:If I have not provided an API key yet, remind me to go to the OpenRely Console (https://api.openrely.ai/keys) to create and enter one.
2. Install Environment:Check if Factory Droid CLI (command: droid) is already installed on this machine. If not, execute the official installation script (macOS/Linux: curl -fsSL https://app.factory.ai/cli | sh; Windows: irm https://app.factory.ai/cli/windows | iex).
3. Configuration File:Create the ~/.factory directory and write the configuration file ~/.factory/config.json:
Point the custom model endpoint to OpenRely (base_url: https://api.openrely.ai/v1, api_key: <MY_API_KEY>). For model IDs, refer to OpenRely Model Marketplace (https://api.openrely.ai/pricing).
4. Verify Readiness:Run droid --version to verify the installation status, and prompt me to run droid directly to start a development session.

🔑 Prerequisites


🚀 Steps

Install CLI Globally

Select the official one-click installation command based on your operating system. Once installed, you can invoke the droid command in your terminal:

curl -fsSL https://app.factory.ai/cli | sh

After installation, follow the terminal prompts to ensure that the Droid path is appended to your shell configuration file (such as ~/.zshrc or ~/.bashrc).

Open PowerShell as Administrator and run:

irm https://app.factory.ai/cli/windows | iex

Configure Endpoints and Keys

Factory Droid CLI uses ~/.factory/config.json in the user's home directory to store third-party custom model endpoints:

In your terminal, run the following commands to create the configuration directory and write the configuration file:

# 1. Create configuration directory
mkdir -p ~/.factory

# 2. Write custom model configuration file (pointing to OpenRely)
cat > ~/.factory/config.json <<EOF
{
  "custom_models": [
    {
      "model_display_name": "OpenRely",
      "model": "<model_id_from_pricing_center>",
      "base_url": "https://api.openrely.ai/v1",
      "api_key": "sk-your-openrely-api-key",
      "provider": "openai",
      "max_tokens": 128000
    }
  ]
}
EOF

chmod 600 ~/.factory/config.json

In a PowerShell window, run the following commands to write the configuration:

# 1. Create configuration directory
New-Item -ItemType Directory -Force -Path "$HOME\.factory"

# 2. Write custom model configuration file (pointing to OpenRely)
@"
{
  "custom_models": [
    {
      "model_display_name": "OpenRely",
      "model": "<model_id_from_pricing_center>",
      "base_url": "https://api.openrely.ai/v1",
      "api_key": "sk-your-openrely-api-key",
      "provider": "openai",
      "max_tokens": 128000
    }
  ]
}
"@ | Out-File -Encoding utf8 "$HOME\.factory\config.json"

Launch and Verification

Navigate to the root directory of your codebase and run droid to launch an interactive session:

droid

After entering the session for the first time, send a test prompt to verify endpoint connectivity:

> Analyze the overall architecture of this project and list the key entry files

If the code analysis response streams back normally, OpenRely has been successfully integrated.


💡 Common Commands

Frequently used built-in shortcut commands in Factory Droid CLI interactive sessions:

CommandDescription
/helpView all built-in commands and configuration options
/modelInteractively view or switch the currently used model
/clearClear the current conversation context and start a new task
/exitExit the Droid CLI session

❓ FAQ

Encountering other API errors or billing questions? Please refer to the complete FAQ and Troubleshooting Guide.

Was this page helpful?

Factory Droid CLI | OpenRely Docs