Skip to content

Saturnyx/curator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

74 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Curator

License: MIT Rust

A powerful command-line tool for managing project licenses and configuration with smart license detection and interactive setup.

Get it from the Snap Store

✨ Features

  • πŸ” Smart License Management: Automatically fetch and download licenses from the SPDX License List
  • 🎯 Fuzzy Search: Intelligent license name matching with suggestions for typos
  • βš™οΈ Project Configuration: Interactive project setup with persistent configuration
  • πŸ”„ License Reloading: Easily update or reload existing licenses
  • πŸ“ Template Processing: Automatic placeholder replacement in license templates
  • πŸ—‚οΈŽ Git Integration: Optional .gitignore management for configuration files

πŸš€ Installation

From Source

git clone https://github.com/Saturnyx/curator.git
cd curator
cargo build --release

The binary will be available at target/release/curator (or curator.exe on Windows).

Using Cargo

Method 1: Install directly from crates.io

cargo install curator_cli

Method 2: Install from the repository

git clone https://github.com/Saturnyx/curator.git
cd curator
cargo install --path .

Snap Package

Curator is available as a Snap package for easy installation on Linux:

sudo snap install curator-cli
sudo snap alias curator-cli.curator cu

πŸ“– Usage

Curator uses the command alias cu for convenience.

Initial Setup

Before using license management features, initialize your project configuration:

cu config set

This will prompt you for:

  • Your legal name (for copyright notices)
  • Preferred license type
  • Whether to add curator.json to .gitignore

License Management

Set a License

Download and configure a license for your project:

cu license set MIT
cu license set apache-2.0
cu license set GPL-3.0

If you make a typo, Curator will suggest similar license names:

cu license set ap
# License 'ap' not found in SPDX list. Please try again.
# Did you mean:
#   1. Apache-2.0
#   2. APSL-2.0
#   3. APL-1.0

Remove License

Remove the current LICENSE file:

cu license remove

Reload License

Reload the license from your configuration (useful after updating project details):

cu license reload

Project Configuration Management

View Current Configuration

The project configuration is stored in curator.json:

{
  "data": {
    "year": "2025",
    "license": "MIT",
    "copyright holders": "Your Name"
  },
  "settings": {
    "path": "/path/to/your/project",
    "author": "Your Name",
    "project": "project-name"
  }
}

Reconfigure Project

To update your project configuration:

cu config set

πŸ› οΈŽ How It Works

License Processing

  1. Fetches Available Licenses: Curator connects to the SPDX License List GitHub repository to get the latest available licenses
  2. Smart Matching: Uses fuzzy matching to find licenses even with typos
  3. Template Processing: Automatically replaces placeholders like <year>, <copyright holders> with your configuration data
  4. Interactive Prompts: Asks for any missing information needed to complete the license

Configuration Management

  • Project Validation: Ensures configuration matches the current project directory
  • Persistent Storage: Saves project metadata for consistent license generation
  • Git Integration: Optionally manages .gitignore entries for configuration files

πŸ—οΈŽ Architecture

Curator is built with a modular architecture:

  • main.rs: CLI interface using clap for argument parsing
  • config.rs: Configuration management and project initialization
  • license.rs: License fetching, processing, and management
  • tools.rs: Utility functions including fuzzy search
  • lib.rs: Library interface for external use

Dependencies

  • clap: Command-line argument parsing
  • reqwest: HTTP client for fetching licenses
  • serde_json: JSON serialization for configuration
  • dialoguer: Interactive prompts
  • fuzzy-matcher: Fuzzy string matching for license suggestions
  • crossterm: Cross-platform terminal styling
  • chrono: Date handling for copyright years

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change. For more information, please check the CONTRIBUTING.md file.

Development Setup

  1. Clone the repository
  2. Install Rust (1.70+ recommended)
  3. Run tests: cargo test
  4. Build: cargo build
  5. Run: cargo run -- --help

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • SPDX License List for providing the comprehensive license database
  • The Rust community for excellent crates and documentation

About

A versatile CLI tool for project management

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Languages