็ฎไฝไธญๆ | ๆฅๆฌ่ช | Espaรฑol | Franรงais | Portuguรชs
A lightweight CLI tool for personal data management. Store anything as key-value pairs, search instantly, and let AI manage it all with natural language.
Every developer has been there:
"Wait, what was that Docker command I used last month?" "Where did my colleague share that config file?" "I know I read an article about this... but can't find it anywhere."
We store knowledge everywhere โ browser tabs, Slack messages, emails, bookmark folders, notes apps. When we actually need it, we waste time digging through endless tabs and scrolling through chat history.
This was my pain too.
So I built ttl.
The name comes from "Time to Live" โ but with a different meaning. Instead of expiring, it's about giving your knowledge a time to live forever.
- Store everything in one place as key-value pairs
- Tag it for easy organization
- Search instantly by keyword
- Use AI to manage it with natural language
No more searching through old emails or scrolling through Slack history. Just ttl get <keyword> and you have it.
ttl is your personal knowledge archive โ everything you need, when you need it.
| Feature | Description |
|---|---|
| ๐๏ธ Local KV Storage | Fast, zero-config embedded database (bbolt) |
| ๐ท๏ธ Tag System | Organize resources with flexible, searchable tags |
| ๐ Fuzzy Search | Find what you need instantly across keys and tags |
| ๐ค AI Agent | Manage data with natural language (OpenAI / DeepSeek / Ollama) |
| ๐ Work Log | Track daily work, generate weekly/monthly reports with AI |
| ๐ MCP Protocol | Let AI tools (Claude Code, Cursor) operate your data directly |
| โ๏ธ Cloud Sync | Self-host multi-tenant server with per-user data isolation |
| ๐ Privacy First | AI never sends your values โ only keys and tags |
| ๐ Smart Open | Open URLs and files with system default programs |
| ๐ค Export | Export data as JSON or CSV |
# Install from GitHub releases
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/ZHANGSHUNLIN/TTL-CLI/main/install.sh)"
# Or build from source
go build -o ttl .
sudo mv ttl /usr/local/bin/# Install from GitHub releases
irm https://raw.githubusercontent.com/ZHANGSHUNLIN/TTL-CLI/main/install.ps1 | iexFor internal networks or custom mirrors:
# Linux/macOS
TTL_DOWNLOAD_URL="https://your-mirror.com/ttl-cli-v1.0.0-linux-amd64" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/ZHANGSHUNLIN/TTL-CLI/main/install.sh)"# Windows
$env:TTL_DOWNLOAD_URL="https://your-mirror.com/ttl-cli-v1.0.0-windows-amd64.zip"; irm https://raw.githubusercontent.com/ZHANGSHUNLIN/TTL-CLI/main/install.ps1 | iex
### Basic Usage
```bash
# Add a resource
ttl add my-link https://example.com
# Add with tags
ttl add docker-cmd "docker run -d -p 8080:80 nginx"
ttl tag docker-cmd dev ops
# Search resources
ttl get docker
# Open in browser
ttl open my-link
# Delete
ttl del old-key
One command replaces ten. Just describe what you want in natural language.
# Configure AI first
ttl config ai
# Then use natural language
ttl ai "save this nginx config: port 8080 changed to 443"
ttl ai "find all my docker related resources"
ttl ai "open the sugar dashboard"
ttl ai "what did I store recently?"
ttl ai "tag nginx-config with ops and deploy"The AI Agent only sends resource keys and tags to the LLM. Your values โ which may contain passwords, tokens, internal URLs, or sensitive data โ never leave your machine. Only work log content is sent in full for summarization.
- OpenAI (GPT-4, GPT-4o, GPT-4o-mini)
- DeepSeek
- Moonshot
- Ollama (local models)
- Any OpenAI Chat Completions API compatible model
Track your daily work and let AI generate reports.
# Write a log entry
ttl log write "Finished user module refactoring" --tags "projectA,dev"
# View logs
ttl log list # Today's logs
ttl log list --range week # This week
ttl log list --range month # This month
# AI-powered weekly report
ttl ai "summarize my work logs this week"
ttl ai "generate a weekly report in markdown format"Let AI tools operate your data via Model Context Protocol.
ttl mcpAdd to ~/.claude/claude_code_config.json:
{
"mcpServers": {
"ttl": {
"command": "ttl",
"args": ["mcp"]
}
}
}Now Claude Code can read, write, and manage your resources directly!
Available MCP Tools:
ttl_getโ Retrieve resourcesttl_addโ Add new resourcesttl_updateโ Update existing resourcesttl_deleteโ Delete resourcesttl_tagโ Add tagsttl_dtagโ Remove tagsttl_openโ Open resourcesttl_renameโ Rename resources
# Create a user
ttl server user add alice
# Start multi-tenant server
ttl server start --port 8080# Configure remote server
ttl config
# Edit the server section with your endpoint and API key
# Sync local <-> remote
ttl syncArchitecture:
- Multi-tenant design with per-user isolated databases
- API Key authentication
- REST API for programmatic access
- MCP HTTP endpoint at
/mcpfor AI clients
Config file: ~/.ttl/ttl.ini
[default]
db_path = ~/.ttl/data.db
[ai]
api_key = your-api-key-here
base_url = https://api.openai.com
model = gpt-4o-mini
timeout = 30
[server]
endpoint = https://your-server.com
api_key = your-user-api-key# View current config
ttl config
# Configure AI interactively
ttl config ai# Export as JSON
ttl export --format json
# Export as CSV
ttl export --format csv
# Export to specific file
ttl export --format json --output backup.jsonttl
โโโ main.go # Entry point, CLI setup (cobra)
โโโ command/ # CLI command definitions
โ โโโ commands.go # Core commands (get/add/del/tag/open...)
โ โโโ ai.go # AI Agent command
โ โโโ log.go # Work log commands
โ โโโ export.go # Export command
โ โโโ server.go # Server commands
โโโ ai/ # AI Agent (ReAct loop)
โ โโโ client.go # LLM HTTP client
โ โโโ agent.go # ReAct engine + tool execution
โ โโโ prompt.go # System prompt
โโโ db/ # Storage layer (bbolt)
โ โโโ db.go # Database initialization
โ โโโ storage.go # Local storage implementation
โ โโโ tenant_storage.go# Multi-tenant storage router
โ โโโ user_store.go # User CRUD (users.json)
โ โโโ context.go # Request-scoped storage
โโโ api/ # HTTP server
โ โโโ server.go # Server startup
โ โโโ handlers.go # REST API handlers
โ โโโ middleware.go # Auth middleware
โโโ mcp/ # MCP protocol
โ โโโ tools.go # MCP tool definitions
โ โโโ handlers.go # MCP tool handlers
โโโ sync/ # Data sync logic
โโโ models/ # Shared data models
โโโ conf/ # Config file (INI) handling
โโโ util/ # Utility functions
| Component | Technology |
|---|---|
| Language | Go 1.23 |
| CLI Framework | cobra |
| Storage | bbolt |
| Configuration | ini.v1 |
| MCP Protocol | mcp-go |
| AI API | OpenAI Chat Completions API (compatible) |
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For major changes, please open an issue first to discuss what you'd like to change.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- cobra for the excellent CLI framework
- bbolt for the reliable embedded key-value store
- mcp-go for MCP protocol support
- The open-source community
Made with โค๏ธ by developers who hate searching for lost knowledge