Skip to content

Add an interactive picker: code-node -i walks the folder in the terminal - #37

Merged
utkarsh5026 merged 1 commit into
mainfrom
interactive-picker
Oct 21, 2026
Merged

utkarsh5026 merged 1 commit into
mainfrom
interactive-picker

Conversation

@utkarsh5026

Copy link
Copy Markdown
Owner

What

code-node -i opens a full-screen picker in the terminal, drawn with rich, for choosing where to start:

Key Does
↑ ↓, PgUp PgDn, Home End Move
→ or Enter Open a folder; pick a file, then the function in it (a file with one function is picked at once)
← or Backspace Up a folder (the cursor lands on the folder left)
Any letters Search every file by path: ordhan finds orders/handler.py
Tab Switch between files and the entry points found
Esc Clear the search, go back, or quit

Files and folders holding an entry point have a ★. At 110+ columns a panel beside the list shows a file's functions or a function's code.

Also changed

  • Where the command asked which entry point (the numbered input() list), it opens the same picker. With no entry point found in a terminal, it opens the file browser instead of failing. Without a terminal it still takes the first one; -i without a terminal exits 2.
  • --list, --plugins, errors, the summary and --serve's lines are printed with rich. --mermaid stays plain text.
  • rich>=13.7 is now a package dependency.

Files

  • src/code_node/browse.py: the picker (_Picker, browse)
  • src/code_node/terminal.py: the rich consoles and keys() (termios, or msvcrt on Windows)
  • cli.py, serve.py wired to them; CHANGELOG, README, docs/usage.md, CLAUDE.md updated

Testing

  • make check passes (lint, tests, docs build, package)
  • New test drives the picker with key names and checks what it draws
  • Driven by hand in a pty at 120×30 and 80×16. Not tried in a Windows console.

🤖 Generated with Claude Code

code-node -i opens a full-screen picker drawn with rich: arrow keys through
the folders, type to search every file by path, then pick the function to
start from. Files with an entry point have a star, and a wide terminal
previews a file's functions or a function's code. Tab switches to the entry
points found.

Wherever the command asked which entry point (the numbered list), it now
opens the same picker, and with no entry point found in a terminal it lets
you pick a file. --list, --plugins, errors, the summary and --serve's lines
are drawn with rich, now a dependency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@utkarsh5026
utkarsh5026 merged commit c99dd9c into main Oct 21, 2026
8 checks passed
@utkarsh5026
utkarsh5026 deleted the interactive-picker branch October 21, 2026 04:04
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