Skip to content

feat: Actions — run a command on the selected Project with a key #62

Closed

Description

@hammadmajid

Part of #61. Covers feature 1 (custom keystroke commands) and feature 5 (programs that must run inside the project directory, e.g. lazygit).

What

Add Action to CONTEXT.md: a named command bound to a key in the Picker and run on the selected Project. Define it in config:

[actions.code]
key    = "ctrl+v"
run    = "code {path}"   # {path} is replaced with the shell-quoted absolute path
jump   = false           # also Jump after the command exits
detach = true            # start without waiting; the Picker stays open

[actions.lazygit]
key = "ctrl+l"
run = "lazygit"          # runs with cwd = the Project

Behaviour

  • The command runs as sh -c <run> with cwd set to the Project and CDD_PATH exported. {path} is substituted shell-quoted. We avoid $path because zsh ties it to $PATH.
  • Non-detached (the default): the Picker quits and the program gets /dev/tty for stdin, stdout and stderr. It must not use the binary's stdout, which the Wrapper captures as the Jump target. cdd waits for it and exits with its status.
  • jump = true: after the program exits, the binary prints the path so the Wrapper Jumps.
  • detach = true: the program starts in its own session, cdd doesn't wait, output is discarded, and the Picker stays open. If the program fails to start, the error shows on one footer line.
  • Every Action run on a Project records a Visit.

Key rules (validated at config load, errors name the line)

  • Key names must be ones the Picker recognises (ctrl+x, alt+x, enter, f1, …).
  • A user binding overrides a built-in navigation key. Binding ctrl+n takes it away from "down"; the arrow keys still move.
  • esc and ctrl+c can never be bound.
  • A plain printable key (a, ?) is an error in the default key map because it would steal typing. It is allowed only with keys.vim = true, where it applies in list focus.
  • Two Actions on one key is an error. key = "" leaves an Action unbound.

Acceptance

  • CONTEXT.md defines Action (and Avoid: command, binding, hotkey, shortcut).
  • Config decodes [actions.*]; the validation above is covered by tests.
  • Non-detached, detached and jump = true Actions work from fish, bash and zsh Wrappers with no Wrapper change.
  • A Visit is recorded for each Action run.
  • README documents Actions.

Activity

  1. self-assigned this
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready-for-agentFully specified, ready for an AFK agentwayfinder:taskWayfinder ticket: implementation task

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions