Markdown Converter
Agent skill for markdown-converter
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Selfspy is a comprehensive activity monitoring suite with implementations in multiple programming languages. It continuously monitors:
This is a multi-language project with implementations in Python (primary), Rust, Elixir/Phoenix, Objective-C, Nim, Crystal, Zig, and more. The Python implementation is the most mature and feature-complete.
selfspy3/ ├── python/ # 🐍 Main Python implementation (most mature) ├── rust/ # 🦀 Rust implementation with GUI ├── elixir/ # 🔥 Phoenix web interface ├── objective-c/ # 🍎 macOS native widgets ├── nim/ # ⚡ Nim compiled implementation ├── crystal/ # 💎 Crystal implementation ├── zig/ # ⚡ Zig high-performance implementation ├── [other langs]/ # Additional language implementations ├── shared/ # Shared resources and scripts ├── tools/ # Development tools └── dev # Multi-language development helper script
Use the
./dev helper script to work with different implementations:
# Work with Python (most mature implementation) ./dev python uv run selfspy start ./dev python uv run pytest # Work with Rust implementation ./dev rust cargo build --release ./dev rust cargo run --bin selfspy-gui # Work with Elixir/Phoenix web interface ./dev elixir mix phx.server ./dev elixir mix test # Work with other implementations ./dev objective-c make all # macOS widgets ./dev nim nimble build # Nim compiled ./dev crystal shards build # Crystal compiled ./dev zig zig build # Zig performance # Language-agnostic commands ./dev test # Run all tests ./dev build # Build all implementations
Note: You are currently on the
elixir-phoenix-implementation branch, which indicates active development on the Elixir/Phoenix web interface implementation.
The following commands are specific to the Python implementation (located in
python/ directory):
Option 1: Using uv (recommended for development)
# Install dependencies uv sync --group dev # Install with macOS extras for full functionality uv sync --group dev --extra macos # Alternative uv installation uv pip install .
Option 2: Using pip (standard Python)
# Quick automatic installation python3 install.py # Manual installation - basic pip3 install -r requirements.txt pip3 install -e . # Manual installation - macOS with full functionality pip3 install -r requirements-macos.txt pip3 install -e . # Development setup pip3 install -r requirements-dev.txt pip3 install -e .
With uv (from development environment):
# Start monitoring (will guide through permission setup on macOS) uv run selfspy start # Start monitoring with custom data directory uv run selfspy start --data-dir /path/to/data # Start monitoring without text logging uv run selfspy start --no-text # View enhanced statistics with rich visualizations 🎨 uv run selfviz enhanced # View activity timeline uv run selfviz timeline --days 1 # Terminal command analytics 🔧 uv run selfterminal commands --days 7 uv run selfspy terminal sessions --days 30 # Check macOS permissions manually uv run selfspy check-permissions
Direct commands (after installation):
# Start monitoring selfspy start # View statistics selfstats selfviz enhanced # Terminal analytics selfterminal commands --days 7 selfspy terminal projects --days 30 # Check permissions (macOS) selfspy check-permissions
With uv (recommended for development):
# Run tests uv run pytest # Run with coverage (default from pytest.ini) uv run pytest --cov=src # Run a single test file uv run pytest tests/test_models.py # Linting and formatting uv run black src/ tests/ uv run isort src/ tests/ uv run ruff check src/ tests/ uv run mypy src/ # Pre-commit hooks uv run pre-commit run --all-files
Direct commands (after pip installation):
# Run tests pytest # Linting and formatting black src/ tests/ isort src/ tests/ ruff check src/ tests/ mypy src/ # Pre-commit hooks pre-commit run --all-files
Entry Points (
and python/src/cli.py
)python/src/stats.py
start (monitoring), stats (analysis), check-permissionsActivity Monitor (
)python/src/activity_monitor.py
Terminal Tracking (
and python/src/terminal_tracker.py
)python/src/terminal_stats.py
Data Layer
python/src/models.py: SQLAlchemy 2.0 models with modern mapped_column syntaxpython/src/activity_store.py: Database operations with async session managementpython/src/encryption.py: Handles keystroke encryption using cryptography libraryPlatform Abstraction (
)python/src/platform/
base.py: Abstract interfaces for cross-platform supportdarwin.py: macOS-specific implementations using PyObjCfallback.py: Basic implementations for other platformsUses SQLAlchemy 2.0 with declarative base and relationships:
Process: Application information with macOS bundle IDsWindow: Window metadata including geometry and screen infoKeys: Encrypted keystroke data with countsClick: Mouse events with coordinates and movement trackingTerminalSession: Terminal session metadata (shell type, working directory)TerminalCommand: Individual commands with context (git branch, project type, exit codes)All tables include timestamp mixins and proper indexing for performance.
python/src/config.py)Uses Pydantic Settings for type-safe configuration:
SELFSPY_ prefixThe project has extensive macOS support requiring:
Use
uv sync --group dev --extra macos for full macOS functionality.
The codebase follows modern Python conventions with comprehensive type hints and documentation.