- Python 3.8+
- pip
- git
# Clone the repository
git clone https://github.com/anyspecs/anyspecs-cli.git
cd anyspecs-cli
# Install in development mode
pip install -e ".[dev]"
# Install pre-commit hooks (optional)
pre-commit installWe use pyproject.toml as the primary configuration file, following modern Python packaging standards.
# Install build tools
pip install build twine
# Build source distribution and wheel
python -m build
# Check the built packages
python -m twine check dist/*# Install from wheel
pip install dist/anyspecs_cli-*.whl
# Or install in editable mode for development
pip install -e .# Upload to Test PyPI first
python -m twine upload --repository testpypi dist/*
# Upload to PyPI
python -m twine upload dist/*# Install test dependencies
pip install -e ".[test]"
# Run tests with coverage
pytest
# Run specific tests
pytest tests/test_extractors.py
# Run tests with verbose output
pytest -vpytest -m unit: Run only unit testspytest -m integration: Run only integration testspytest -m "not slow": Skip slow tests
# Format code with black
black anyspecs/
# Sort imports with isort
isort anyspecs/# Lint with flake8
flake8 anyspecs/
# Lint with ruff (modern alternative)
ruff check anyspecs/
# Fix issues automatically
ruff check --fix anyspecs/# Type check with mypy
mypy anyspecs/# Install pre-commit
pip install pre-commit
# Install hooks
pre-commit install
# Run on all files
pre-commit run --all-filesanyspecs-cli/
├── anyspecs/ # Main package
│ ├── __init__.py # Package entry point
│ ├── cli.py # Unified CLI interface
│ ├── config.py # Configuration management
│ ├── py.typed # Type hints marker
│ ├── core/ # Core functionality
│ │ ├── __init__.py
│ │ ├── extractors.py # Base extractor classes
│ │ └── formatters.py # Export formatters
│ ├── exporters/ # Source-specific extractors
│ │ ├── __init__.py
│ │ ├── cursor.py # Cursor AI extractor
│ │ └── claude.py # Claude Code extractor
│ └── utils/ # Utility modules
│ ├── __init__.py
│ ├── logging.py # Logging configuration
│ ├── paths.py # Path utilities
│ └── upload.py # Upload functionality
├── tests/ # Test suite (create when needed)
├── docs/ # Documentation (create when needed)
├── pyproject.toml # Modern package configuration
├── requirements.txt # Dependencies
├── MANIFEST.in # File inclusion rules
├── .gitignore # Git ignore rules
├── .pre-commit-config.yaml # Pre-commit hooks
├── README.md # Main documentation
├── CHANGELOG.md # Version history
├── DEVELOPMENT.md # This file
└── LICENSE # MIT License
- Update version in
pyproject.toml - Update
CHANGELOG.md - Create git tag:
git tag v1.0.1 - Push tag:
git push origin v1.0.1
# Clean previous builds
rm -rf dist/ build/ *.egg-info/
# Build new packages
python -m build
# Check packages
python -m twine check dist/*
# Upload to PyPI
python -m twine upload dist/*- Create new extractor in
anyspecs/exporters/ - Inherit from
BaseExtractor - Implement required methods:
extract_chats(): Extract chat datalist_sessions(): List available sessions
- Add to
anyspecs/exporters/__init__.py - Update CLI in
anyspecs/cli.py:- Add to
self.extractorsdict - Add to source choices in argument parsers
- Update sources_to_check lists
- Add to
- Update documentation
- Add tests
- Create new formatter in
anyspecs/core/formatters.py - Inherit from
BaseFormatter - Implement required methods
- Add to CLI options
- Add tests
anyspecs --verbose list
anyspecs export --verbose --source cursor- Import errors: Check if package is installed in editable mode
- Command not found: Reinstall with
pip install -e . - Permission errors: Check file permissions and paths
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make changes and add tests
- Run quality checks:
pre-commit run --all-files - Commit changes:
git commit -m "Description" - Push to branch:
git push origin feature-name - Create Pull Request
We use pyproject.toml instead of setup.py for:
- ✅ Modern Python packaging standard (PEP 517/518)
- ✅ Single configuration file for build and tools
- ✅ Better dependency isolation
- ✅ Declarative configuration
- ✅ Tool-specific configurations in one place
- Isolated builds: Build dependencies are isolated
- Reproducible builds: Consistent across environments
- Modern toolchain: Compatible with latest packaging tools
- Type safety: Includes
py.typedmarker for type hints - Quality tools: Pre-configured linting, formatting, testing