An automated trading journal CLI for cryptocurrency traders. Import trades directly from exchanges, annotate them with your own insights, and analyze your performance — all from the terminal.
coinlog bridges the gap between exchange data and trader self-awareness. It pulls your trade history via exchange APIs, stores everything locally in SQLite, and lets you enrich each trade with manual notes, emotion tags, and setup descriptions. The result: a personal trading journal that combines hard data with human context.
| Feature | Description |
|---|---|
| Exchange Import | Pull trades from Bybit (more exchanges planned) with pagination and rate limiting |
| Local Storage | All data lives in a local SQLite database — no cloud dependency |
| Trade Annotation | Add entry/exit rationale, setup notes, emotion tags, and lessons learned |
| Trade Listing | View trades in a formatted table with symbol and limit filtering |
| Performance Stats | Win rate, P&L, max drawdown, R-multiples, streaks, expectancy, profit factor |
| Duplicate Detection | Safely re-run imports without creating duplicate entries |
| Pure Go | No CGO required — uses modernc.org/sqlite for a fully portable binary |
| Decimal Precision | Financial calculations use shopspring/decimal to avoid floating-point errors |
- Go 1.26 or later
git clone https://github.com/Crypto-Finance/CoinLog.git
cd CoinLog
make buildThe binary will be available at ./bin/coinlog.
make all # fmt + vet + test + buildgo run ./cmd/coinlog --help# 1. Configure your exchange credentials
cat > ~/.coinlog.yaml << 'EOF'
exchange:
bybit:
api_key: "your-api-key"
api_secret: "your-api-secret"
EOF
# 2. Import trades for a symbol
coinlog import --exchange bybit --symbol BTCUSDT
# 3. Annotate a trade with your notes
coinlog annotate --id 1
# 4. List recent trades
coinlog list --symbol BTCUSDT --limit 20
# 5. View your trading statistics
coinlog stats --symbol BTCUSDTcoinlog reads configuration from ~/.coinlog.yaml.
# Database path (optional — defaults to ~/.coinlog.db)
db_path: "~/.coinlog.db"
# Exchange credentials
exchange:
bybit:
api_key: "your-api-key"
api_secret: "your-api-secret"| Field | Required | Description |
|---|---|---|
db_path |
No | Path to the SQLite database file |
exchange.bybit.api_key |
Yes (for import) | Bybit API key |
exchange.bybit.api_secret |
Yes (for import) | Bybit API secret |
| Command | Description | Flags |
|---|---|---|
import |
Import trades from an exchange | --exchange, --symbol |
annotate |
Add manual annotations to a trade | --id |
list |
Display trades in a formatted table | --symbol, --limit |
stats |
Show trading performance statistics | --symbol |
# Import all BTCUSDT trades from Bybit
coinlog import --exchange bybit --symbol BTCUSDT
# Annotate trade with ID 42
coinlog annotate --id 42
# List the 50 most recent ETHUSDT trades
coinlog list --symbol ETHUSDT --limit 50
# Show stats for all symbols
coinlog statscoinlog/
├── cmd/coinlog/ # CLI entry point
├── internal/
│ ├── core/ # Domain models and interfaces (exchange, journal, stats)
│ ├── infra/ # External implementations (Bybit API, SQLite repository)
│ ├── service/ # Application services (import, annotate, list, stats)
│ └── ui/ # User interface (table display, annotation collection, styles)
├── pkg/config/ # Configuration loading
├── testhelper/ # Test utilities (trade builder pattern)
├── Makefile # Build automation
└── go.mod
The project follows a clean architecture pattern:
cmd → service → core ← infra
↑
ui
- core — Domain models and port interfaces (no external dependencies)
- infra — Adapters for external systems (exchange APIs, database)
- service — Application logic that orchestrates core and infra
- ui — Terminal presentation layer
- cmd — CLI wiring and flag parsing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Run the full build pipeline (
make all) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
go test ./...This project is licensed under the GNU General Public License v3.0 — see the LICENSE file for details.