dcdpr / dcdpr/jp

Add configuration options to provide JSON to `query` editor command

Open
#91 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
16
Forks
3
Avg merge
1d 1h
Merged PRs (30d)
121

Description

Currently, if no query message is provided, the configured EDITOR is opened with the conversation history shown in markdown, below a marker line looking like this:

---------------------------------------8<---------------------------------------
--------------------- EVERYTHING BELOW THIS LINE IS IGNORED --------------------
--------------------------------------->8---------------------------------------

# 2025-05-25 21:38:27

## YOU

Hello World!

## ASSISTANT

I'm here, ready to assist!

This is fine for the most common use-case, but if we truly want to allow people to integrate jp into their workflow, we need to provide ways to manipulate how the conversation history is shown in an exact way.

For example, in my case, I want the history to open in a new window in Neovim, with filetype set to markdown and potentially other tweaks applied to the format of the contents.

Instead of allowing customizations for specific editors, we should provide for a way for JP to output the conversation details (including its history) in JSON, so that e.g. JP_EDITOR can be set to some kind of external tool that parses that JSON, and runs the relevant commands. e.g. for me there could be a command nvim +configure_jp_query which would run configure_jp_query when nvim opens with the JON as its contents, which it would then parse and open the relevant formatted buffers.

Alternatively, JP_EDITOR could point to a shell script which takes in the JSON, creates a (or multiple) new file with the correct formatted contents, and opens those files in separate splits.

Regardless of how it's used, the end-goal is for there to be a way to ensure JP always returns the JSON object to EDITOR when no query message is provided, instead of opening the markdown-formatted conversation history in a single file.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the query editor command and trace the existing EDITOR and JP_EDITOR handling for conversation history. Define the JSON input contract and verify that a configured external editor receives it when no query message is supplied, while preserving the stated workflow for editor-side formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
neovim, rust
Domain
cli, developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.