Skip to main content

A lightweight terminal agent framework for long-running modular agents

Project description

Pegasus

Pegasus Logo

Pegasus is a terminal-first agent runtime for long-running tasks. It combines a streaming CLI, tool calling, browser control, camera capture, MCP execution, subagents, and automatic context compression in one package.

It is designed for workflows that need more than simple code generation. Pegasus can keep working across multiple turns, use tools to interact with the local machine and external systems, and continue operating even as context grows.

Features

  • terminal agent workflow with streaming responses and tool execution
  • built-in file, shell, edit, web search, memory, and todo tools
  • browser automation with annotated screenshots for grounded actions
  • camera capture with image handoff into the next model turn
  • MCP executor for listing and composing MCP tools as Python-style functions
  • subagents for delegated task execution
  • automatic context compression when conversation history approaches the model limit

Installation

Install from PyPI:

pip install pegasus-ai

Install from source:

git clone https://github.com/asuzukosi/pegasus.git
cd pegasus
pip install -e .

Requirements

  • python 3.9 or newer
  • an API key exposed as API_KEY
  • optional local dependencies for advanced tools, such as a working browser environment for Playwright-based automation and a camera device for vision capture

Get an API key from OpenRouter.

Set your API key:

export API_KEY="sk-xxx"

Quick Start

Run the CLI:

pegasus-cli

Run a single prompt:

pegasus-cli --message "summarize the repository structure"

Run Pegasus from source without installing the console script:

python main.py

Basic Usage

Interactive session:

$ pegasus-cli
[user]> inspect this project and explain the main runtime flow

Single-shot invocation:

pegasus-cli --message "list the builtin tools and explain what each one is for"

Switch models from inside the CLI:

/model gpt-5.4

Useful built-in commands:

  • /help
  • /config
  • /model <name>
  • /clear
  • /exit

Configuration

Pegasus loads project configuration from .pegasus/config.toml in the current working directory.

Example MCP configuration:

[mcp_servers.hackathon_manager]
enabled = true
startup_timeout_sec = 10.0
command = "node"
args = [".pegasus/mcp_servers/hackathon_manager_server.js"]
cwd = "."

[mcp_servers.event_booking]
enabled = true
startup_timeout_sec = 10.0
command = "node"
args = [".pegasus/mcp_servers/event_booking_server.js"]
cwd = "."

Examples

Ask Pegasus to inspect a codebase:

pegasus-cli --message "inspect the current project and explain how session startup works"

Use browser-based task execution:

[user]> open a browser, go to the target site, and tell me which clickable options are visible

Use camera capture in a multimodal workflow:

[user]> capture the camera feed for 10 seconds and describe what changed across the frames

Use MCP composition:

[user]> list the available mcp functions, then fetch details for the sf hackathons

Packaging

The published distribution name is pegasus-ai.

Install command:

pip install pegasus-ai

Python import package:

import pegasus

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

pegasus_ai-0.1.4.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

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

pegasus_ai-0.1.4-py3-none-any.whl (62.2 kB view details)

Uploaded Python 3

File details

Details for the file pegasus_ai-0.1.4.tar.gz.

File metadata

  • Download URL: pegasus_ai-0.1.4.tar.gz
  • Upload date:
  • Size: 49.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for pegasus_ai-0.1.4.tar.gz
Algorithm Hash digest
SHA256 76953c7582c3c3b217d336275b9440e556fb0932afce655d79989b6ef6a849de
MD5 58d7011b480340dc8c026720c5bb3e4a
BLAKE2b-256 2a74ad55a4f8f828ecf0dbacbc2b494da79d22ba49b64e0cb8b66ad6fdb8eaf3

See more details on using hashes here.

File details

Details for the file pegasus_ai-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: pegasus_ai-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 62.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for pegasus_ai-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2fc5446b817a6c2f5f9760ef1107b893fed050becaace136dbe8cd6a6966e27d
MD5 1777d93f8290a219895b1ffe2d6a5ceb
BLAKE2b-256 b853773a898d96015ea33fcfb3fec3f01ea374b1b9c40bd23a633149375b9679

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