Skip to content

Tommel is a lightweight and user-friendly command-line tool designed to simplify the creation of TOML configuration files. Whether you're managing complex configurations or just getting started with TOML, Tommel ensures your files are clean, valid, and headache-free.

License

Notifications You must be signed in to change notification settings

MehrzweckMandala/tommel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🐚 Tommel: The Delightful TOML Generator 🐚

Tommel is a lightweight and user-friendly command-line tool designed to simplify the creation of TOML configuration files. Whether you're managing complex configurations or just getting started with TOML, Tommel ensures your files are clean, valid, and headache-free.


✨ Features

  • Dynamic Table Creation
    Easily create tables and nested tables with intuitive dot notation.

  • Arrays Made Simple
    Define arrays with type validation, ensuring no accidental TOML violations.

  • Multiline Strings
    Add beautifully formatted multiline strings that are automatically closed.

  • Arrays of Tables
    Organize your configurations with array-of-tables support.

  • Key-Value Management
    Add, edit, and validate key-value pairs with type-checking for strings, integers, floats, booleans, and datetimes.

  • Comments
    Document your configurations with inline comments.

  • Error-Proof
    Built-in validation prevents common mistakes like duplicate keys, invalid names, or inconsistent arrays.

  • Export with Ease
    Generate valid TOML files directly to your desktop.


🚀 Getting Started

Prerequisites

  • Java 11 or later
    Ensure you have Java installed. You can check with:
    java -version

Clone the Repository

git clone https://github.com/mehrzweckmandala/tommel.git
cd tommel

Compile and Run

javac -d bin src\main\java\de\mehrzweckmandala\tommel\*.java
java -cp bin de.mehrzweckmandala.tommel.Main

📚 How to Use

Tommel provides an interactive CLI menu to guide you through creating TOML files step-by-step.

Menu Options

  1. Create a New Table
    Define a top-level or nested table. Example:

    [settings]
    [parent.child]
  2. Add Key-Value Pairs
    Assign values to keys with automatic validation:

    theme = "dark"
    retries = 5
  3. Add Arrays
    Input arrays with a key name:

    supported_languages = ["en", "fr", "de"]
  4. Add Multiline Strings
    Easily handle multiline content:

    description = """
    This is a
    multiline string
    example.
    """
  5. Add Comments
    Document your file:

    # This is a comment
  6. Review Configuration
    Preview your current configuration.

  7. Export to TOML
    Save your file as a valid TOML document.

  8. Reset Configuration
    Start fresh by clearing the current configuration.


🛠 Example Workflow

Here’s how you might use Tommel to create a configuration:

  1. Start the Program
    Run java -cp bin de.mehrzweckmandala.tommel.

  2. Create a Table
    Add a table for your app settings:

    > 1
    Enter table name (use dot notation for nested tables):
    > app.settings
    
  3. Add Key-Value Pairs
    Specify configurations:

    > 2
    Enter key:
    > theme
    Enter value:
    > dark
    Enter value type (string, integer, float, boolean, datetime):
    > string
    
  4. Add an Array
    Add supported languages:

    > 4
    Enter array name:
    > supported_languages
    Enter array elements separated by commas:
    > en, fr, de
    
  5. Export Your File
    Save your work:

    > 8
    Configuration exported to: /Users/yourname/Desktop/config.toml
    

🔥 Example Output

Here’s the TOML file generated by Tommel:

[app.settings]
theme = "dark"
supported_languages = ["en", "fr", "de"]

🌟 Why Tommel?

  • Beginner-Friendly: No need to memorize TOML syntax – Tommel guides you every step of the way.
  • Error-Free: Built-in validation ensures your files are always valid TOML.
  • Flexible: Supports advanced TOML features like arrays of tables and nested tables.

📄 License

Tommel is open-source under the MIT License. Contributions are welcome! 🛠️


🤝 Contributing

Got ideas for features or improvements? Feel free to open an issue or submit a pull request!


🎉 Have Fun with Tommel!

TOML is meant to be simple and human-readable – and so is Tommel. Go ahead and create your first configuration file today!

About

Tommel is a lightweight and user-friendly command-line tool designed to simplify the creation of TOML configuration files. Whether you're managing complex configurations or just getting started with TOML, Tommel ensures your files are clean, valid, and headache-free.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages