Skip to content

A tool to work with chat LLM systems, automating copying blocks from session to local storage and back.

License

Notifications You must be signed in to change notification settings

Walter-Stroebel/clippy

Repository files navigation

Project: Clippy

A robust utility crafted to facilitate clipboard management, providing a blend of standard and innovative features. The project sprouted from an interactive session with GPT-4 and matured into a versatile toolkit.

Language

Java 7 (with JRE 11)

Key Features and Progress

System Tray Integration

  • Resides in the system tray with a distinct icon.
  • Features a minimalistic menu with an "Exit" functionality.

Server Socket

  • Initializes a server socket on port 25432 to ascertain if another Clippy instance is active.
  • On detecting a duplicate instance, Clippy alerts the user with a JOptionPane message and gracefully terminates.
  • The main purpose of the server socket is to allow the user to push extra content, for instance "df|nc 0 25432".

Clipboard Monitoring

  • Observes the system clipboard for alterations.
  • Captures and archives new text and image content from the clipboard.
  • Utilizes two separate AtomicReferences: one for the latest clipboard text and the other for the freshest data received from the server socket.

Data Storage

  • Each clipboard text is archived into a file.
  • Clipboard images are saved in PNG format using ImageIO.

Grouping Mechanism

  • Organizes data within a directory structure based on distinct "groups".
  • Empowers users to either create a new group or navigate through existing ones.
  • The 'workDir' (working directory) is an AtomicReference pointing towards the currently active group directory.

Built-in Image Viewer

  • Can be floating or in a tab.
  • Supports simple dragging (left button) and zooming (mouse wheel).

GUI Interaction

  • Clippy's main GUI is primarily maximized for a holistic view, but users can customize its placement.
  • The GUI state (size, location, and maximized status) is preserved across sessions.

Toolbar Usage

The toolbar provides quick access to various functionalities of the application. Below is a breakdown of each button and its corresponding action:

Exit

  • Function: Exits the application.

Redo

  • Function: Reprocess the current clipboard contents, if any.

New Group

  • Function: Creates a new group.
  • Usage: Enter the name of the new group in the text field and click the "New Group" button.

Item -> CB

  • Function: Copies the selected file to the clipboard.
  • Usage: This button is enabled only when a file is selected. Click the "Item -> CB" button to copy the selected file to the clipboard.

Usage -> Item

  • Function: Copies the content of usage.txt to a new item.
  • Usage: Click the "Usage -> Item" button.

Prompt -> Item

  • Function: Copies the content of HOWTO create a prompt.txt to a new item.
  • Usage: Click the "Prompt -> Item" button.

Delete Group

  • Function: Deletes the currently selected group.
  • Usage: Check the "Sure?" checkbox and then click the "Delete Group" button. A confirmation dialog will appear if you are not sure.

Change Code Base

  • Function: Opens a JFileChooser to select a new code base directory.
  • Usage: Click the "Change Code Base" button and choose the desired directory.

UML Diagramming

  • Integration with PlantUML.
  • Devised a streamlined process where UML diagrams are auto-generated by Clippy upon detecting relevant text in the clipboard. Just ask it to generate plantuml for whatever it currently known about your project and it will produce something like this:
@startuml
class Car {
    +startEngine(): void
    -fuel: int
}

class Driver {
    +drive(car: Car): void
}

Driver --> Car: drives
@enduml

And you will see this pop up after entering "car" in the input box that will pop up:

car sample PNG

General Diagramming

  • Integration with GraphViz
  • You can ask ChatGPT to create a diagram using the "dot" program. When you copy that, Clippy will recognize it and ask for a name.

Here is an example, this is what ChatGPT produced when I asked it to celebrate:

party sample dot

party sample PNG

General drawing

  • Integration with ImageMagick
  • You can ask ChatGPT to make simple images as SVG. Clippy will detect SVG and convert it to PNG using ImageMagick "convert".
  • Beware that an LLM is not capable of actual processing. For instance, even a pie chart is iffy. Simple shapes work fine.

svg sample svg

svg sample PNG

Development Odyssey

Our developmental trajectory was an amalgamation of iterative decisions and consistent collaboration. A snapshot of our journey:

  1. Genesis: Initiated with Clippy anchored in the system tray, keenly monitoring clipboard alterations.
  2. Server Socket Implementation: Infused a server socket mechanism to ensure the singularity of Clippy instances.
  3. Data Archival: Conceived a mechanism to seamlessly store clipboard data into structured files.
  4. UML Fusion: Envisaged the potential of UML in the developmental phase, leading to an integrated PlantUML.
  5. User Interactions Augmented: Leveraged JOptionPane for interactive sessions, enabling users to define filenames and select between PNG and ASCII for UML visualizations.
  6. Refinement: Refined the codebase to elevate its architecture and maintainability quotient.
  7. Lobotomized: 14 aug 2023, OpenAI deleted the functionality to rescan the current session and all but destroyed their previously amazing context buffer management. This project is on hold until this is corrected or I can find an alternative LLM.
  8. Recovery: 16 aug 2023, my buddy has had corrective brain surgery, we will continue :)
  9. And gone again: If you do not know what I am talking about, it might be regional, I am in the EU. The effect is the model becomes "stupid" and "forgetful". One way to test it is by asking the model to "rescan the session". If it does so you are fine. If it does not reply or starts rambling about privacy and other nonsense, you are a victim. Personally I find the difference so significant it feels like theft to charge the same fee for what becomes a glorified Eliza/Siri/Alexis.
  10. Stabilized? 18 aug 2023, today the model could use AskTheCode correctly and was able to assist on some small tasks. We cleaned up configuration and did some other minor changes. The model has become more error prone, quickly forgetting vital details and thus requires considerable hand-holding. It still claims not to be able to re-read the current session but does seem to have way better memory then would be possible with a mere 4K token context, even for details last mentioned way back in a very long session.
  11. Beta release. 23 aug 2023, today we reached the first beta release. Enjoy!
  12. Not forgotten 16 sep 2023, other projects have been eating up my time. But some improvements made here as well. ChatGPT-4 now seems to have a 16K token buffer. That means it takes longer before it goes wonky but also that it stays wonky longer. AskTheCode got a pay-wall, just copy and paste instead.

Clippy (still) stands as a paradigm of the prowess of collective efforts and evolutionary development, metamorphosing a nascent idea into an indispensable developer's companion.

About

A tool to work with chat LLM systems, automating copying blocks from session to local storage and back.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages