Skip to main content

Smart command wrapper with AI-powered failure diagnosis

Project description

Lumby

A CLI tool that wraps shell commands, streams output live, and provides AI-powered diagnosis when commands fail.

Named after Lumbridge in Old School RuneScape - where you respawn after death with knowledge of what killed you.

Installation

pip install lumby

Or install from source:

git clone https://github.com/RasmusGodske/lumby.git
cd lumby
pip install -e .

Usage

Lumby uses -- to separate its flags from the wrapped command:

# Basic usage - wrap any command
lumby -- php artisan test --parallel
lumby -- npm run build
lumby -- cargo build

# With configuration
lumby --log-level=debug -- make test
lumby --response-guide="Keep it under 2 sentences" -- pytest
lumby --config=./lumby.json -- ./vendor/bin/phpstan

What Happens

  1. Command runs normally - You see output in real-time, just like running the command directly
  2. On success - Lumby exits with the same exit code (0)
  3. On failure - Lumby captures the output, sends it to Claude for diagnosis, and shows you a concise explanation of what went wrong

Example Output

$ lumby -- php artisan test --filter=UserTest

   FAIL  Tests\Feature\UserServiceTest::test_user_creation_validates_email
   Expected exception [InvalidArgumentException] was not thrown.

   Tests:    1 failed, 15 passed
   Duration: 2.34s

════════════════════════════════════════════════════════════════════
   Diagnosis
════════════════════════════════════════════════════════════════════

The test expects InvalidArgumentException when creating a user with
invalid email, but UserService::create() doesn't validate email format.
Add email validation before line 45 in app/Services/UserService.php.

════════════════════════════════════════════════════════════════════

Configuration

CLI Flags

Flag Description
--config PATH Path to JSON config file
--log-file PATH Path to log file
--log-level LEVEL Log level: debug, info, warning, error
--response-guide TEXT Guide for AI response length/style
--prompt-file PATH Path to custom prompt template
--verbose Shortcut for detailed diagnosis

Config File

Create a lumby.json:

{
  "log_file": "/tmp/lumby.log",
  "log_level": "info",
  "response_guide": "Keep it under 3 sentences"
}

Use it:

lumby --config=./lumby.json -- npm test

Environment Variables

Variable Description
LUMBY_LOG_FILE Path to log file
LUMBY_LOG_LEVEL Log level
LUMBY_RESPONSE_GUIDE Response guideline
LUMBY_PROMPT_FILE Path to prompt template

Configuration Priority

CLI flags > Config file > Environment variables > Defaults

Custom Prompts

Create a custom prompt template with these variables:

  • {command} - The command that was run
  • {exit_code} - The exit code
  • {output} - The captured output
  • {response_guide} - The response guideline

Example my-prompt.md:

Analyze this failed command:

Command: {command}
Exit code: {exit_code}

Output:
{output}

{response_guide}

Use it:

lumby --prompt-file=./my-prompt.md -- make build

Use Cases

In CI/CD Pipelines

Get immediate diagnosis when builds fail:

# GitHub Actions
- name: Run tests
  run: lumby -- npm test

Wrapping Test Runners

# In your test script
#!/bin/bash
lumby -- php artisan test "$@"

Development Workflow

# Quick iteration with diagnosis
lumby -- cargo build && ./target/debug/myapp

Requirements

  • Python 3.11+
  • Claude API access (via claude-agent-sdk)

Why "Lumby"?

The name comes from Lumbridge, the starting town in Old School RuneScape.

In OSRS, when your character dies, you respawn in Lumbridge, affectionately called "Lumby" by players. You wake up at the castle, slightly confused, but with the knowledge of what killed you. Maybe it was that level 80 dragon you weren't ready for. Maybe you forgot to bring food. Either way, you learn from the experience.

That's exactly what this tool does. When your command "dies" (fails), you respawn with a diagnosis of what went wrong, so you can try again, smarter this time.

Home teleport to Lumby.

License

MIT

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

lumby-0.1.1.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

lumby-0.1.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file lumby-0.1.1.tar.gz.

File metadata

  • Download URL: lumby-0.1.1.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lumby-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0ff3de752f02c7c56d67a5a72fa84a0f25c38b700c6b11f70f07a55ece176de8
MD5 828fd2f49f18c71ffd661fe6c94c5eb6
BLAKE2b-256 374697ca7abd92ebd99b9a5be825119b92580041392637feb0d4e59653846f6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for lumby-0.1.1.tar.gz:

Publisher: publish.yml on RasmusGodske/lumby

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lumby-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: lumby-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lumby-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 accfcad45e41ba9f5d4ff129f03b7cd03fca9673b4ac8a8c703f45ab44c6d35a
MD5 5ca2a65de0cd54f9041d2264d1919142
BLAKE2b-256 bc48d2fc2bd87cfefff9ff07a16406352ca2004e0a7c345cc7bf2451924fc3f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for lumby-0.1.1-py3-none-any.whl:

Publisher: publish.yml on RasmusGodske/lumby

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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