yusufcanb / tlm

Local CLI Copilot, powered by CodeLLaMa. πŸ’»πŸ¦™
Apache License 2.0
1.15k stars 36 forks source link

[Feature Request] Add context of previously executed commands and outputs #20

Open Jasperhino opened 3 months ago

Jasperhino commented 3 months ago

Is there a convenient option to read the bash history and provide a solution for any problem i might run into?

e.g. i execute

poetry install       
Installing dependencies from lock file

Package operations: 66 installs, 0 updates, 0 removals

  - Installing pycddlib (2.1.7): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_ext
  Compiling cdd.pyx because it changed.
  [1/1] Cythonizing cdd.pyx
  building 'cdd' extension
  creating build
  creating build/temp.macosx-14.0-arm64-cpython-312
  creating build/temp.macosx-14.0-arm64-cpython-312/cddlib
  creating build/temp.macosx-14.0-arm64-cpython-312/cddlib/lib-src
  clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -DGMPRATIONAL -Icddlib/lib-src -I/private/var/folders/db/8bjxm83551s6k9y4081jd5sh0000gn/T/tmp56717o84/.venv/include -I/opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12 -c cdd.c -o build/temp.macosx-14.0-arm64-cpython-312/cdd.o
  In file included from cdd.c:1244:
  In file included from cddlib/lib-src/cdd.h:17:
  cddlib/lib-src/cddmp.h:30:11: fatal error: 'gmp.h' file not found
   #include "gmp.h"
            ^~~~~~~
  1 error generated.
  error: command '/usr/bin/clang' failed with exit code 1

  at /opt/homebrew/Cellar/poetry/1.8.2/libexec/lib/python3.12/site-packages/poetry/installation/chef.py:164 in _prepare
      160β”‚ 
      161β”‚                 error = ChefBuildError("\n\n".join(message_parts))
      162β”‚ 
      163β”‚             if error is not None:
    β†’ 164β”‚                 raise error from None
      165β”‚ 
      166β”‚             return path
      167β”‚ 
      168β”‚     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with pycddlib (2.1.7) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "pycddlib (==2.1.7)"'.

I now would love to do something like tlm fix to prompt the llm to help me to fix my problem and suggest a command to run next.

Is there something like this already? Any ideas on how to implement this?

Love the project πŸ’™

yusufcanb commented 3 months ago

This could be done by applying another command and respecting Modelfile.

Something like below seems intuitive; poetry install --verbose | tlm fix

Thanks for your feedback.