Skip to content

CLI tool that tries to find the last command run, and its output, to pipe into an AI for problem-solving.

Notifications You must be signed in to change notification settings

binary-is/cmdcatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Status

Currently just a proof-of-concept. Really fragile and probably doesn't work for you without modifications.

Assumptions

  • You are using tmux.

  • You are using bash with a relatively boring prompt ($PS1).

  • You are using opencode.

The problem

You may be going about your business in the terminal, when you encounter an error.

What you might do, is to simply copy-paste the entire output of the failed command, including the command and prompt at the top, into some AI service, and that AI service will give you hints about what's wrong.

The problem with this is simply the constant copy-ing and pasting from terminal to browser, and then having to copy-paste things back into the terminal.

The solution

This utility is currently an experiment to see how far we can get with automating this process. It captures the last run command, including the prompt, and the output, and prints out an instruction intended to be digested by some AI.

Further development

It's currently an experiment so it's not obvious where it will lead, if anywhere.

Example usage

[someuser@somehost ~/code/some-project]$ npm run start

> start
> yarn workspace $START_COMMAND

sh: 1: yarn: not found
[someuser@somehost ~/code/some-project]$ cmdcatch | opencode run
|  Read     package.json

The `yarn` command is not installed or available in your system's PATH. This project uses Yarn 3.3.1 (as specified in `package.json`), which requires Yarn to be installed globally or the local Yarn binary to be used.

To fix this, install Yarn globally with `npm install -g yarn`, or run the start command using the local Yarn binary: `node .yarn/releases/yarn-3.3.1.cjs workspace $START_COMMAND`.

[someuser@somehost ~/code/some-project]$

About

CLI tool that tries to find the last command run, and its output, to pipe into an AI for problem-solving.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages