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.0.tar.gz (10.8 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.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lumby-0.1.0.tar.gz
  • Upload date:
  • Size: 10.8 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.0.tar.gz
Algorithm Hash digest
SHA256 6a80b8b640c63f801473f6bc4e0db1f4386b62608a9fe1e904db3d90d4ce5674
MD5 c237f2041301a7fb03ec6b3594d0cac9
BLAKE2b-256 33be675c5e7c3ce87b5b08521c5557dfe43d7f661751c8b9d1c2f166e6fd242e

See more details on using hashes here.

Provenance

The following attestation bundles were made for lumby-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: lumby-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4e2908d2cb345ade7e0bd477ac78786231b5ca3b1ecfbfef9485f294f6aacf8
MD5 39db022e2c4f2521e0c13d8d634e486a
BLAKE2b-256 72c2b85575d9f98f7e5bc047e4b910b4d6086bbeb4867ffbdafb7fc34ee6a4c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for lumby-0.1.0-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