Skip to main content

Command-line interface for executing tasks using large language models, minimal version of Cline

Project description

minicline

Command-line and Python interface for performing software engineering tasks using large language models. It is based on Cline, but is simpler, uses fewer input tokens, has fewer capabilities, and does not depend on VSCode. It borrows prompts, logic, conventions, and formatting from Cline.

This package was created during the Pre-COSYNE Brainhack, March 2025, Montreal.

The primary focus is automatic generation of scientific notebooks, targeting projects like dandi-notebook-gen.

Installation

pip install minicline

Setup

The application requires the OPENROUTER_API_KEY environment variable to be set. You can set this variable by creating a .env file in the working directory with the following content:

OPENROUTER_API_KEY=your_api_key

Usage

From command line:

# Provide instructions directly
minicline perform-task "your instructions here"

# Specify a model
minicline perform-task --model google/gemini-2.0-flash-001 "your instructions here"

# Use a file containing instructions
minicline perform-task -f /path/to/instructions.txt

# Run in automatic mode (no user input required except for executing commands that are deemed to require user approval)
minicline perform-task --auto "your instructions here"

# Automatically approve all commands that are deemed require user approval
minicline perform-task --auto --approve-all-commands "your instructions here"

From Python:

from minicline import perform_task

instructions = '...'

# Default model (google/gemini-2.0-flash-001)
perform_task(instructions, cwd="/path/to/working/directory")

# Specify a different OpenRouter model
perform_task(instructions, cwd="/path/to/working/directory", model="...")

# Run in automatic mode (see above)
perform_task(instructions, cwd="/path/to/working/directory", auto=True)

# Automatically approve all commands (see above)
perform_task(instructions, cwd="/path/to/working/directory", auto=True, approve_all_commands=True)

Working Directory

MiniCline performs all operations within a specified working directory. File paths and commands are interpreted relative to this directory. When using the CLI, the working directory defaults to the current directory. When using the Python API, specify the working directory using the cwd parameter.

Automation and Security Options

The CLI supports various flags and environment variables that control task execution and security:

Command Execution Modes

  • --auto: Enables automatic mode where no user input is required. The AI will proceed with all actions without asking for confirmation, except for commands that require approval (unless --approve-all-commands is also set).

  • --approve-all-commands: Automatically approves all commands that would normally require manual approval. This includes potentially impactful operations like installing packages, modifying system files, or running network operations.

Container Security

By default, minicline executes commands within a container for security. This prevents unauthorized access to the host system while maintaining a controlled environment:

  • Commands run inside the container can only access files in the current working directory, as this is the only directory mounted from the host system
  • minicline itself can read and write files outside the container, but only within the current working directory
  • File system isolation prevents commands from accessing sensitive host system files
  • The --no-container flag disables container usage and runs commands directly on the host system. This option is dangerous and should be used with extreme caution, especially when combined with --auto or --approve-all-commands

Environment Variables

  • MINICLINE_DOCKER_IMAGE: Specifies the Docker image to use for command execution. Defaults to jupyter/scipy-notebook:latest.

  • MINICLINE_USE_APPTAINER: Set to "true" to use Apptainer (formerly Singularity) instead of Docker for containerization.

Use these options with caution, especially in production environments, as they can affect system security and bypass normal safety prompts and confirmations.

Some notes about changes to the system prompt relative to Cline

In auto mode, don't provide instructions for ask_followup_question as it will be ignored.

Updated the "Tool Use Formatting" to be explicit about using the tags because I found that some models didn't make use of that.

Removed all MCP functionality.

Support read_image in addition to read_file.

License

This project is licensed under the Apache 2.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minicline-0.1.14.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minicline-0.1.14-py3-none-any.whl (38.3 kB view details)

Uploaded Python 3

File details

Details for the file minicline-0.1.14.tar.gz.

File metadata

  • Download URL: minicline-0.1.14.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for minicline-0.1.14.tar.gz
Algorithm Hash digest
SHA256 b95013475802edbf531d12331dedcca7274f31aac6070e476e5d932bccf40dbc
MD5 79ad69b4ed330d03cd1131f0670f5814
BLAKE2b-256 8c3248a52af53be4e0240e363def41cb36dc9b6fda057537ee71e6132d8fa20f

See more details on using hashes here.

File details

Details for the file minicline-0.1.14-py3-none-any.whl.

File metadata

  • Download URL: minicline-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 38.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for minicline-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 aa28df458da2b1dae080985d1ab1c2004284180297d0c5e24ce71acbca953a99
MD5 b665b3324eb97e43726e511e0adc8e77
BLAKE2b-256 d8000e56b9a558c9de0f894963c8345461a24b372c7e649d6c3bb7f7cea6670f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page