Skip to content

ProperTree but with CLI Integration - #216

Open
kaffeindecaf wants to merge 7 commits into
corpnewt:masterfrom
kaffeindecaf:master
Open

kaffeindecaf wants to merge 7 commits into
corpnewt:masterfrom
kaffeindecaf:master

Conversation

@kaffeindecaf

Copy link
Copy Markdown

ProperTree, but in the terminal

ProperTreeCLI edits plists from the terminal: the same job as corpnewt's ProperTree, without tkinter.

plist test.plist opens a tree you fold with the arrows, edit inline, and save with ctrl+s, styled after W0lfSword (a project ive been working on).
It also adds what a terminal tool should have: scriptable one-shot commands (get, set, del, diff, convert, new, settings), real exit codes, plain output when piped, and no display needed, so it works over ssh and inside tmux. Stdlib only, no pip, no venv.

The original gui still works and stays credited.

by kaffeindecaf

p.s: if youre looking for a maintainer for ProperTree i would be happy to contribute ;)

propertreecli.py and plist_tui.py bring the ProperTree workflow to the
terminal: a curses editor (tree view, fold, add, delete, duplicate,
rename, type change, reorder, clipboard, 200-step undo, scoped find
with replace) and headless get/set/del/convert/new one-shots for
scripts. install.sh links a plist command into ~/.local/bin.

find scope (keys/values/both) is pickable in the prompt and defaults
from the config file, which now also has a settings command to show
and change values. top-level keys keep the frost blue, nested keys
desaturate toward gray. version bumped to 0.3.0.

readme and roadmap updated to match.
the root container is never drawn as a row, so a fresh `plist new` had
an empty row list and every row op died with "IndexError: list index out
of range" (logged to /tmp/plist_tui.log, flashed as an error line - the
editor stayed usable, so it looked like the keys did nothing at all).
i, enter, d, c, r, t, D and the fold arrows were all affected.

- _sel_row() / _target_of_row(): an empty tree falls back to the root
  as the container, so i (and p) can fill a brand new dict or array
- _last(): the selection can no longer land on -1 when there are no
  rows, and the two arrow branches in _handle bail out
- an empty body now says what the file is and how to fill it instead
  of showing a blank tree, and ? mentions the empty-plist case
- tests/run.sh: pty smoke tests, no deps - fills a new dict root and a
  new array root through the real editor, then a regression pass over a
  normal tree (insert order, fold, copy/paste, undo, rename, quit)
- test.plist: the sample comment now says what to try
d476fd2 (github web edit, sep 4) dropped the paragraph under "The
editor" and left two blank lines behind, so the section listed / find,
^t convert and T presets but never said how to move, edit or save. put
it back, with the one change the fix earned: i on an empty plist fills
the root.
this fork is meant to be PR-able to corpnewt/ProperTree, so the session
notes should not ship with the tool.

- ROADMAP.md leaves the repo and keeps living locally as ROADMAP.local.md
  (gitignored): a public fork ships the tool, not the build log
- roadmap item numbers out of the code headers and the version comment,
  the "when 4.3 lands" note gone, and the section rules line back up at
  64 columns
- README: no plan talk ("for later", "is next", "one item per session",
  "the snapshot logic stays for later"), and the reuse section now says
  what is shared code and what is a port of gui behaviour
- README gets a section for a maintainer: the four added things, no
  upstream file modified, no new deps, no build step, same licence
- test.plist moves to tests/sample.plist so the repo root only gains the
  tool itself; the empty-argv hint and the README follow it
- both new modules say what they are and that they are BSD-3 new code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant