Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cline-CLI is a command line interface for Cline, a powerful AI assistant for developers.

License

Notifications You must be signed in to change notification settings

yaegaki/cline-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cline-CLI

Cline-CLI is a command line interface for Cline, a powerful AI assistant for developers.

⚠️ Development Status

Note: This project is currently under development and is not recommended for production use. Features may change, and stability is not guaranteed.

Currently, browser_action and execute_command tools are not supported in Cline-CLI.

Installation

You can install Cline-CLI using npm:

npm install -g @yaegaki/cline-cli

After installation, the cline-cli command will be available in your terminal.

Alternatively, you can use npx to run Cline-CLI without installing it globally:

# Create settings files
npx -y @yaegaki/cline-cli init

# Edit the Cline-CLI settings file to configure API providers and other options
vim ~/.cline_cli/cline_cli_settings.json

# Run a task with Cline-CLI by providing your task description
API_KEY=YOUR_API_KEY npx -y @yaegaki/cline-cli task "your task description"

Usage

Initialization

Before using Cline-CLI, you need to initialize it:

cline-cli init

This will create the necessary configuration files:

  • Cline-CLI Settings file
  • Cline MCP Settings file

Configuration Files

By default, Cline-CLI stores its settings in the following location:

~/.cline_cli/cline_cli_settings.json

You can specify a custom path for the settings file using the --settings option:

cline-cli init --settings /path/to/your/settings.json
cline-cli task "your task" --settings /path/to/your/settings.json

This allows you to maintain different configuration files for different projects or environments.

Configuration File Structure

The settings file is a JSON file with the following main sections:

{
  "globalState": {
    // API provider settings
    "apiProvider": "",
    "apiModelId": "",
    
    // AWS related settings
    "awsRegion": "",
    "awsBedrockEndpoint": "",
    
    // Google Vertex AI related settings
    "vertexProjectId": "",
    "vertexRegion": "",
    
    // OpenAI related settings
    "openAiBaseUrl": "",
    "openAiModelId": "",
    
    // Other AI provider settings
    "ollamaModelId": "",
    "ollamaBaseUrl": "",
    "anthropicBaseUrl": "",
    
    // Auto approval settings
    "autoApprovalSettings": {
      "enabled": true,
      "actions": {
        "readFiles": false,
        "editFiles": false,
        "executeSafeCommands": false,
        "useMcp": false
      },
      "maxRequests": 20
    }
  },
  "settings": {
    "cline.enableCheckpoints": false
  }
}

You can configure various AI providers, set auto-approval preferences, and adjust other Cline-specific settings through this file.

Example Configurations

Here are some example configurations for different API providers:

Anthropic Configuration
{
  "globalState": {
    "apiProvider": "anthropic",
    "apiModelId": "claude-3-7-sonnet-20250219",
    "autoApprovalSettings": {
      "enabled": true,
      "actions": {
        "readFiles": true,
        "editFiles": false,
        "executeSafeCommands": true,
        "useMcp": false
      },
      "maxRequests": 20
    }
  },
  "settings": {
    "cline.enableCheckpoints": false
  }
}
Google Vertex AI Configuration
{
  "globalState": {
    "apiProvider": "vertex",
    "apiModelId": "claude-3-7-sonnet@20250219",
    "vertexProjectId": "your-gcp-project-id",
    "vertexRegion": "us-central1",
    "autoApprovalSettings": {
      "enabled": true,
      "actions": {
        "readFiles": true,
        "editFiles": false,
        "executeSafeCommands": true,
        "useMcp": false
      },
      "maxRequests": 20
    }
  },
  "settings": {
    "cline.enableCheckpoints": false
  }
}

API Keys

Cline-CLI supports passing API keys via environment variables. This is a secure way to provide authentication credentials without storing them in configuration files.

The following environment variables are supported:

API_KEY                 # Anthropic API key
OPEN_ROUTER_API_KEY     # OpenRouter API key
CLINE_API_KEY           # Cline API key
AWS_ACCESS_KEY          # AWS access key
AWS_SECRET_KEY          # AWS secret key
AWS_SESSION_TOKEN       # AWS session token
OPEN_AI_API_KEY         # OpenAI API key
GEMINI_API_KEY          # Gemini API key
OPEN_AI_NATIVE_API_KEY  # OpenAI Native API key
DEEP_SEEK_API_KEY       # DeepSeek API key
REQUESTY_API_KEY        # Requesty API key
TOGETHER_API_KEY        # Together API key
QWEN_API_KEY            # Qwen API key
DOUBAO_API_KEY          # Doubao API key
MISTRAL_API_KEY         # Mistral API key
LITE_LLM_API_KEY        # LiteLLM API key
ASKSAGE_API_KEY         # AskSage API key
XAI_API_KEY             # XAI API key
SAMBANOVA_API_KEY       # Sambanova API key

Example usage:

# Set API key in your environment
export API_KEY="your-api-key-here"

# Run Cline-CLI with the API key from the environment
cline-cli task "your task description"

For Windows Command Prompt:

set API_KEY=your-api-key-here
cline-cli task "your task description"

For Windows PowerShell:

$env:API_KEY="your-api-key-here"
cline-cli task "your task description"

Working with Tasks

Cline-CLI operates with the concept of tasks. Here are the main commands:

Start a new task

cline-cli task "your task description"

Resume an existing task

cline-cli task "your task description" --resume

Resume if exists, otherwise start new

cline-cli task "your task description" --resume-or-new

Start in interactive mode

cline-cli task

This will wait for you to input a task description.

Additional Options

  • --full-auto: Run in fully automated mode
  • --auto-approve-mcp: Automatically approve all MCP tool usage requests, including those that normally require explicit confirmation
  • --custom-instructions: Provide custom instructions for the task
  • --workspace: Specify a custom workspace directory path

By default, Cline-CLI uses the current directory as the workspace. You can specify a different directory using the --workspace option:

cline-cli task "your task description" --workspace /path/to/your/project

This is useful when you want to run Cline-CLI on a specific project directory that is different from your current working directory.

License

Apache-2.0

About

Cline-CLI is a command line interface for Cline, a powerful AI assistant for developers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published