Skip to content

elusznik/swesh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
mini-swe-agent banner

swesh | SWE-agent shell

Live-SWE-agent

mini-swe-agent

ℹ️ About | ✨ Features | πŸš€ Setup | πŸ’» Usage | πŸ“Š Comparison | πŸ“œ Attribution

ℹ️ About

swesh is an interactive CLI evolution of Live-SWE-agent and mini-swe-agent.

It combines the "100 lines of Python" philosophy of mini with the self-evolving capabilities of live, while adding robust features for daily development.

Why swesh?

  1. Daemonless Execution: Run secure, isolated environments using Podman without needing root access or a Docker daemon.
  2. Robust Local AI: Optimized for open-source models (e.g., Mistral, OpenRouter) with built-in message cleaning and fault-tolerant cost tracking.
  3. Interactive Shell: Enhanced generic agent shell that supports ! commands for direct shell escape interactions.
  4. Batch & Interactive: Supports both single-task interactive runs and full SWE-bench evaluations out of the box.

⚠️ Security Warning: swesh executes bash commands with your user privileges. Always review commands before approving in confirm mode. For untrusted tasks, use --sandbox mode. See docs/security.md for details.


✨ Features

  • Interactive REPL w/ Shell Escape:
    • Inputs starting with ! execute directly via subprocess and re-prompt the agent.
    • Full history preservation for debugging.
  • Native Podman Support:
    • Explicit --environment-class podman support.
    • Works with rootless containers and user sockets.
  • SWE-bench Verified:
    • Fully compatible with the official evaluation harness.
    • Includes specific fixes (timeouts, API compatibility) for running benchmarks on consumer hardware/APIs.
  • Generic Model Support:
    • Works with any OpenAI-compatible API (Mistral, Anthropic, vLLM, etc.).
    • RobustLitellmModel handles API quirks automatically.

πŸš€ Setup

Python version: Requires Python 3.14 (this repo currently targets 3.14-only; other versions are unsupported).

swesh offers flexible installation options similar to mini-swe-agent.

1. Installation

Option 1: Local Install (Recommended)

# Install with uv (fastest)
uv sync

Option 2: Developer Setup

git clone https://github.com/elusznik/swesh.git
cd swesh
./sync_remotes.sh   # Adds upstream remotes (live-swe-agent, mini-swe-agent)
uv sync

Note: swesh tracks two upstream projects. Run ./sync_remotes.sh periodically to pull latest changes from both.

2. Configure Podman (Recommended)

swesh is built for Podman. Ensure you have the socket enabled for compatibility:

# Install podman
sudo apt install podman

# Enable the socket
systemctl --user enable --now podman.socket

# Export the host variable (add to ~/.bashrc)
export DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock

3. Set API Keys

Configure your .env file (~/.config/mini-swe-agent/.env):

MISTRAL_API_KEY=...
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
# Check https://docs.litellm.ai/docs/providers for other providers

See Global Configuration for more options.


πŸ’» Usage

1. Interactive Mode

Run swesh (or mini) to start an interactive session.

swesh --model mistral/codestral-latest --task "Fix the bug in src/utils.py"

Interactive Commands:

  • !ls -la: Run a shell command directly.
  • exit: valid exit command.

2. Visual Mode

swesh defaults to an opencode-style Textual TUI (continuous transcript + bottom input bar).

To use the legacy pager-style Textual UI (the same as mini -v), run:

swesh -v

To override the opencode UI styling, set MSWEA_OPENCODE_STYLE_PATH to a .tcss file.

3. Live-SWE-agent Self-Evolution

Enable the self-evolving features by using the Live-SWE-agent config:

mini --config config/livesweagent.yaml --model mistral/codestral-latest --task "Refactor the memory module"

4. SWE-bench Evaluation

Run full benchmarks on the SWE-bench Verified dataset using Podman:

uv run src/minisweagent/run/extra/swebench.py \
  --config config/livesweagent_swebench.yaml \
  --subset verified \
  --split test \
  --model mistral/devstral-2512 \
  --slice 0:1 \
  --environment-class podman \
  --workers 1

See docs/guides/running_swebench.md for a full guide.


πŸ“Š Comparison

Live-SWE-agent (the basis for swesh) is the current state-of-the-art on SWE-bench Verified.

Claude Opus 4.5 + Live-SWE-agent scores 79.2%, leading all open-source scaffolds. Gemini 3 Pro + Live-SWE-agent scores 77.4%.

swesh brings these SOTA capabilities to your local command line with improved developer ergonomics.


πŸ“œ Attribution

swesh is built by Nikodem Eluszkiewicz, heavily based on the incredible work of the Live-SWE-agent and mini-swe-agent teams.

Citing swesh

If you use this project, please cite:

@misc{swesh,
  author = {Eluszkiewicz, Nikodem},
  title = {swesh: Software Engineering Shell},
  year = {2025},
  howpublished = {\url{https://github.com/elusznik/swesh}},
  note = {GitHub repository}
}

Original Works

Please also credit the original projects:

Live-SWE-agent:

@article{livesweagent,
  author    = {Xia, Chunqiu Steven and Wang, Zhe and Yang, Yan and Wei, Yuxiang and Zhang, Lingming},
  title     = {Live-SWE-agent: Can Software Engineering Agents Self-Evolve on the Fly?},
  year      = {2025},
  journal   = {arXiv preprint},
}

SWE-agent:

@inproceedings{yang2024sweagent,
  title={{SWE}-agent: Agent-Computer Interfaces Enable Automated Software Engineering},
  author={John Yang and Carlos E Jimenez and Alexander Wettig and Kilian Lieret and Shunyu Yao and Karthik R Narasimhan and Ofir Press},
  booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems},
  year={2024},
  url={https://arxiv.org/abs/2405.15793}
}

Acknowledgements

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 26