Forky is a command-line interface (CLI) tool that implements a git-style conversation structure for interactions with the Claude API. It allows users to create, manage, and navigate through branching conversations, providing a unique way to explore different conversation paths with an AI assistant.
- Conversation Tree Structure: Manage conversations in a tree-like structure, allowing for branching and merging of dialogue paths.
- Forking: Create new branches in the conversation to explore alternative dialogue paths.
- Merging: Combine forked conversations back into the main thread with automatic summarization.
- CLI Interface: Easy-to-use command-line interface for interacting with the conversation tree.
- Visualization: ASCII-based tree visualization of the conversation structure.
- History Tracking: View and manage the full conversation history.
-
Clone the repository:
git clone https://github.com/ishandhanani/forky.git cd forky -
Install the required dependencies:
pip install -r requirements.txt -
Set up your Anthropic API key:
- Create a
.envfile in the project root. - Add your API key:
ANTHROPIC_API_KEY=your_api_key_here
- Create a
Run the CLI application:
python -m cli.main chatYou can also run the web interface for a richer visualization:
-
Start the Backend Server:
export PYTHONPATH=$PYTHONPATH:. python3 server/app.py
The server runs on
http://localhost:8000. -
Start the Frontend:
cd web npm install # First time only npm run dev
The web app runs on
http://localhost:5173.
- Type your message to chat with Claude
/fork: Create a new branch in the conversation/merge: Merge the current branch back into the main conversation/status: View the current conversation state/visualize: See an ASCII representation of the conversation tree/history: View the full conversation historyquit: Exit the application
api_client.py: Handles communication with the Claude APIcli.py: Implements the command-line interfaceconversation_node.py: Defines the ConversationNode class for tree structureconversation_tree.py: Manages the overall conversation tree and operations
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.

