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
.env
file 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 chat
Available commands:
- 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. Here are some things I'd like to add:
- Branching: Implement named forks and also persistence of forks.
- Checkout: Add ability to switch between different branches or specific conversation points.
- Rebase: Allow reorganizing and combining conversation branches.
- Cherry-pick: Implement selecting and applying specific messages from other branches.
- Stash: Add functionality to temporarily save and reapply uncommitted changes.
- Tags: Allow marking significant points in the conversation history.
- Diff: Create a tool to compare differences between branches or commits.
- Reset: Implement the ability to move the conversation back to a previous state.
- LLMs: Support other LLM models besides Claude
- Should each node should be a user/assistant exchange, not just a single message
- Should this be extended in a way where a chat is treated as a file therefore allowing for git native operations? (Hint: yes)
This project is licensed under the MIT License - see the LICENSE file for details.