FFFF ghostty-fx-goal/README.md at main · hmmhmmhm/ghostty-fx-goal · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
159 lines (112 loc) · 5.35 KB

README.md

File metadata and controls

159 lines (112 loc) · 5.35 KB
Ghostty logo

Ghostty fx goal

Keep an fx agent working toward a goal in its existing Ghostty session.

Get started · Use a goal · How it works · Troubleshooting

The agent sets a goal and decides when it can continue. A local watcher sends the next prompt when that session is idle and ready. The agent completes the goal when it verifies the result, or pauses when it needs you.

Requirements

  • macOS 13 or later and Ghostty.
  • fx, signed in and available on PATH.
  • Python 3.9 or later.
  • Node.js and npm, to install agent-desktop.

The end-to-end flow was tested with Ghostty 1.4.0, fx 0.0.18, and agent-desktop 1.2.0 on macOS. The prompt check recognizes the English fx 0.0.18 layout. Other versions may require changes.

Get started

1. Install the dependencies

Install Ghostty, fx, Python, and Node.js if they are not already installed. Then install agent-desktop:

npm install -g agent-desktop@1.2.0

Check that the commands are available in Ghostty:

fx --version
python3 --version
agent-desktop --version

2. Install fx-goal

Clone the repository:

git clone https://github.com/hmmhmmhm/ghostty-fx-goal.git
cd ghostty-fx-goal
./install.sh

The installer links fx-goal to ~/.local/bin and the skills to ~/.agents/skills. It stops if any destination already exists. Keep the cloned directory in place because the links point to it.

Make sure ~/.local/bin is on your shell's PATH. For the current shell, run:

export PATH="$HOME/.local/bin:$PATH"
command -v fx-goal

Add the export to your shell startup file to keep it for future sessions. Restart fx after installation so it can find the skills.

3. Grant macOS permissions

In Ghostty, run:

agent-desktop permissions --guide

Follow the guide to grant Accessibility access to the app or executable it identifies. Allow macOS Automation access to Ghostty if prompted. Run agent-desktop permissions to check the Accessibility grant.

Use a goal

  1. Open fx in a Ghostty window with one terminal pane.
  2. Type /fx-goal and select the skill.
  3. Describe the goal, then submit the prompt.

For example:

/fx-goal
Add input validation to the settings form and verify it with the existing tests.

The first line selects the skill in fx's picker. The next line is an example goal to submit with the selected skill. You can ask the agent to check the goal's status, pause it, or resume it.

To remove a goal, type /fx-goal-clear, select the skill, and submit it. Clearing a goal does not delete the fx conversation. These entries are skills selected in fx, not native fx slash commands.

How it works

  1. The agent runs fx-goal start for the current session.
  2. When the agent can continue without your input, it ends its response with [[FX_GOAL_CONTINUE]].
  3. The watcher checks the session, Ghostty window, and prompt, then submits a continuation request.
  4. The agent runs fx-goal complete when the goal is verified, or fx-goal pause when blocked.

The watcher does not start another fx instance. If the agent omits the marker, the watcher does not send a continuation. The marker is not proof that the goal is complete.

Warning

Use a dedicated Ghostty window while a goal is active. A person can type between the watcher's final check and its submission. Ghostty does not provide an atomic check-and-submit operation.

The watcher pauses if the window is hidden or minimized, the target is ambiguous, the prompt is not empty, or another safety check fails. Split panes are not supported. It records an attempt before submission to avoid retrying an uncertain delivery. In fx's ask mode, the agent's shell commands may require your approval.

Goal state is stored locally in ~/.local/state/ghostty-fx-goal. Set FX_GOAL_HOME before starting fx to use another state directory. The watcher reads the saved fx response and the Ghostty accessibility tree to decide whether to continue.

Troubleshooting

The skill does not appear. Restart fx, then check that ~/.agents/skills/fx-goal points to the cloned repository.

The goal is paused. Ask the agent for the goal status and inspect the reported reason. Select the target Ghostty tab, use a single pane, and clear any draft or dialog before asking the agent to resume. If delivery was unconfirmed, inspect the terminal before resuming.

The watcher cannot read Ghostty. Check Accessibility permission with agent-desktop permissions from Ghostty. Check macOS Automation permissions if the watcher cannot control Ghostty.

The session ended. Resume the fx session and identify it before resuming its goal. From a separate shell, find the exact session ID and use it explicitly:

fx sessions --live --all --json
fx-goal --session SESSION_ID status
fx-goal --session SESSION_ID pause
fx-goal --session SESSION_ID resume
fx-goal --session SESSION_ID clear

The agent can run fx-goal without --session when it can identify its own fx process. Outside the agent, use an exact session ID.

Test

python3 -m unittest discover -s tests -v
0