Skip to content

/edit and /apply #37

Description

@scottyeager

The edit command edits files or groups of files. Accepts a list of file and folder names along with an optional prompt (the prompt can also be included in the contents of one or more files). A system prompt is provided to the model which instructs the model to return a set of diffs. This could be in Morph format or potentially another format.

The apply command attempts to apply at DFS generated by a previous run of the attic command. The contents of each edit commands response are cached in a file on disk such that the apply commands can always be run against the results of the previous edit commands conveniently. Applying the edits is done by sending them along with the relevant file to an apply model, which could be more for another model as configured by the user under a distinct model configuration for edit applying model. Importantly, the only files that can actually be edited are the same files specified in the original edit command thus these file names must be passed through. Deleting files or creating new files is also possible. New files must either be in the same folder as a file passed for editing or inside of a folder passed for editing.

Since passing large numbers of final names in the terminal can be clunky we also support an HTML based file selector. This generates static a page on the fly containing a tree of all the files and folders under the specified directory or by default the pwd The page allows for expanding and collapsing directories, selecting files, and also selecting entire folders. The output is simply a text list of the file and folder names, which can be conveniently copied using a button in order to paste back into the terminal for an edit command. The /select command simply generates this HTML page under a temporary directory and provides the link for the user to open it, perhaps optionally attempting to open it automatically.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions