Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@haitai-social/pit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Pit - AI Conversation History Management Tool
💡pit stand for prompt git.
🕳️ A command-line tool for managing conversation history and chat logs.
🚀 MCP Server Support
NEW! Pit now supports running as an MCP (Model Context Protocol) Server, allowing seamless integration with Claude Desktop and other AI assistants for automatic conversation recording.
Quick MCP Setup
- Install Pit globally:
npm install -g @haitai-social/pit - Add to Claude Desktop config:
{ "mcpServers": { "pit": { "command": "pit", "args": ["mcp"] } } }
- Restart Claude Desktop
See MCP_INSTALL.md for detailed setup instructions.
Installation
npm install -g @haitai-social/pitUsage
CLI Usage
Add Chat Record
Add a single chat record to conversation history:
pit add user "Hello, how are you?"
pit add assistant "I'm doing well, thank you!"
pit add --conversation my-chat tool "Function executed successfully"View Help
pit helpMCP Server Usage
When running as an MCP server, Pit provides the pit_add_chat_history tool that can be called by AI assistants to automatically record conversations.
See MCP_INSTALL.md for MCP server setup and usage details.
JSON File Format
The input JSON file should have the following structure:
{
"chat_list": [
{
"role": "user",
"content": "Hello, how are you?"
},
{
"role": "assistant",
"content": "I'm doing well, thank you!"
},
{
"role": "tool",
"content": "Function executed successfully"
}
]
}Supported Role Types
user: User messageassistant: Assistant replytool: Tool execution result
Storage Structure
Data is stored in the .pit/ folder under the user's home directory:
~/.pit/
├── meta.json # Metadata file
├── conversation1.json # Conversation file 1
├── conversation2.json # Conversation file 2
└── ...meta.json Structure
{
"conversation_queue": ["conversation1.json", "conversation2.json"]
}conversation.json Structure
{
"version": "v0",
"content": {
"chat_list": [
{
"role": "user",
"content": "Message content"
}
]
}
}Contributing
Issues and Pull Requests are welcome at the GitHub repository.