You had a.py copied across multiple repositories from article.template, making maintenance difficult. This PyPI package solves that by providing a single, centrally maintained tool.
article-cli-package/
├── pyproject.toml # Package configuration
├── README.md # User documentation
├── LICENSE # MIT license
├── DEVELOPMENT.md # Development guide
├── build-and-test.sh # Build script ✅ Working
├── migrate-repository.sh # Migration script
├── src/article_cli/
│ ├── __init__.py
│ ├── cli.py # Main CLI interface
│ ├── config.py # Configuration management
│ ├── zotero.py # Zotero API integration
│ └── git_manager.py # Git operations
└── tests/
├── __init__.py
└── test_config.py # Test suite
- Git Release Management: Create, list, delete releases with gitinfo2 support
- Zotero Integration: Robust bibliography synchronization with pagination and error handling
- LaTeX Build Management: Clean build files with configurable extensions
- Git Hooks Setup: Automated setup of git hooks for gitinfo2
- Configuration Management: TOML-based config with environment variable support
- PyPI-ready: Complete package structure with
pyproject.toml - Semantic Versioning: Proper versioning for compatibility
- Dependencies: Only requires
requests(+ optionaltomlifor Python < 3.11) - Entry Point:
article-clicommand available after installation
- Local Config:
.article-cli.tomlin project root - Global Config:
~/.article-cli.tomlfor user-wide settings - Environment Variables:
ZOTERO_API_KEY,ZOTERO_GROUP_ID, etc. - Command Line Override: All settings can be overridden via CLI args
pip install article-cli# Setup new repository
article-cli setup
# Create configuration
article-cli config create
# Update bibliography
article-cli update-bibtex
# Create release
article-cli create v1.0.0
# Clean build files
article-cli clean# .article-cli.toml
[zotero]
api_key = "your_api_key_here"
group_id = "4678293" # Default for article.template
output_file = "references.bib"
[git]
auto_push = false
default_branch = "main"
[latex]
clean_extensions = [".aux", ".bbl", ".blg", ".log", ".out"]cd article-cli-package
./build-and-test.sh # ✅ Package builds successfully
# Upload to PyPI when readycd ../article.template
# Remove old files
rm a.cli a.py
# Add new setup
echo "article-cli>=1.0.0" > requirements.txt
# Create setup script
cat > setup.sh << 'EOF'
#!/bin/bash
pip install article-cli
article-cli config create
article-cli setup
echo "Edit .article-cli.toml with your Zotero credentials"
EOF
chmod +x setup.sh# In each existing repository
wget https://raw.githubusercontent.com/feelpp/article-cli/main/migrate-repository.sh
chmod +x migrate-repository.sh
./migrate-repository.sh- Command line arguments:
--api-key,--group-id, etc. - Environment variables:
ZOTERO_API_KEY,ZOTERO_GROUP_ID - Local config file:
.article-cli.tomlin project root - Global config file:
~/.article-cli.tomlin home directory - Default values
Each repository can have its own .article-cli.toml:
[zotero]
group_id = "project_specific_group_id"
output_file = "refs.bib" # Different filename if needed
[latex]
clean_extensions = [".aux", ".pdf"] # Project-specific cleanup- ✅ Single Source of Truth: Maintain code in one place
- ✅ Easy Updates:
pip install --upgrade article-cli - ✅ Consistent Interface: Same commands across all projects
- ✅ Better Configuration: Flexible, hierarchical config system
- ✅ Improved Reliability: Proper error handling and testing
- ✅ Professional Distribution: Proper PyPI package with versioning
| Old Command | New Command |
|---|---|
python a.py setup |
article-cli setup |
python a.py clean |
article-cli clean |
python a.py create v1.0.0 |
article-cli create v1.0.0 |
python a.py list |
article-cli list |
python a.py delete v1.0.0 |
article-cli delete v1.0.0 |
python a.py update-bibtex |
article-cli update-bibtex |
- Test the package:
cd article-cli-package && ./build-and-test.sh✅ - Create PyPI account: Register at https://pypi.org/
- Upload to TestPyPI first:
twine upload --repository testpypi dist/* - Test installation:
pip install --index-url https://test.pypi.org/simple/ article-cli
- Update article.template: Remove old scripts, add requirements.txt
- Migrate one repository: Test the migration script
- Create GitHub repository: For issue tracking and documentation
- Migrate all repositories: Use the migration script
- Update documentation: Update README files in projects
- Train team members: Share new commands and configuration
article-cli config create # Create sample config
article-cli config show # Show current configarticle-cli create v1.0.0 --push # Create and push release
article-cli delete v1.0.0 --remote # Delete local and remote tag# Use different credentials per project
article-cli update-bibtex --group-id 123456 --output mybib.bibThe package is production-ready and successfully tested! 🎉