Thank you for your interest in contributing to Datalab CLI! This document provides guidelines and instructions for contributing.
Please be respectful and constructive in all interactions. We're all here to build great software together.
- Rust 1.70 or later
- Git
- Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/datalab-cli
cd datalab-cli- Build the project:
cargo build- Run tests:
cargo test- Run the CLI locally:
cargo run -- convert document.pdfWe use rustfmt and clippy to maintain consistent code style:
# Format code
cargo fmt
# Check formatting
cargo fmt --check
# Run lints
cargo clippy
# Run lints with warnings as errors
cargo clippy -- -D warningsPlease ensure all code passes these checks before submitting a PR.
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run a specific test
cargo test test_name# Build MkDocs documentation
cd documentation
pip install -r requirements.txt
mkdocs serve- Create feature branches from
main - Use descriptive branch names:
feature/add-xyz,fix/issue-123,docs/update-readme
Write clear, concise commit messages:
Add support for PDF/A output format
- Add --pdf-a flag to convert command
- Update output handling for PDF/A compliance
- Add tests for new functionality
- Create a PR against the
mainbranch - Fill out the PR template with all relevant information
- Ensure CI passes - all tests and lints must pass
- Request review from maintainers
- Address feedback and update your PR as needed
- Squash commits if requested before merge
- Code follows the project's style guidelines
- Tests added for new functionality
- Documentation updated if needed
- CHANGELOG.md updated for user-facing changes
- All CI checks pass
When reporting bugs, please include:
- Datalab CLI version (
datalab --version) - Operating system and version
- Steps to reproduce the issue
- Expected behavior
- Actual behavior
- Any error messages or logs
For feature requests, please describe:
- The problem you're trying to solve
- Your proposed solution
- Any alternatives you've considered
- Additional context or examples
src/
├── main.rs # CLI entry point and argument parsing
├── lib.rs # Library exports
├── client.rs # HTTP client for Datalab API
├── cache.rs # Local file-based caching
├── error.rs # Error types and handling
├── output.rs # Progress and output formatting
└── commands/ # Command implementations
├── convert.rs
├── extract.rs
├── segment.rs
├── fill.rs
├── track_changes.rs
├── create_document.rs
├── extract_score.rs
├── files.rs
├── workflows.rs
└── cache.rs
- Commands are implemented in
src/commands/with clap derive macros - API client handles authentication, request building, and polling
- Cache stores responses keyed by file hash + endpoint + parameters
- Output handles JSON output to stdout and progress to stderr
- Open a GitHub issue for bugs or feature requests
- Check existing issues before creating new ones
- For questions, use GitHub Discussions
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing!