{"id":16378630,"url":"https://github.com/svdgoor/strinput","last_synced_at":"2025-10-08T16:04:32.513Z","repository":{"id":109214506,"uuid":"432277756","full_name":"svdgoor/StrInput","owner":"svdgoor","description":"Command system for parsing strings into types. General purpose with in and output API.","archived":false,"fork":false,"pushed_at":"2023-05-07T14:40:30.000Z","size":1125,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-08T16:02:48.126Z","etag":null,"topics":["command-parser","commands"],"latest_commit_sha":null,"homepage":"https://github.com/cocoTheOwner/strinput","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/svdgoor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-11-26T19:08:46.000Z","updated_at":"2023-03-27T21:40:56.000Z","dependencies_parsed_at":"2023-03-13T14:15:07.167Z","dependency_job_id":null,"html_url":"https://github.com/svdgoor/StrInput","commit_stats":null,"previous_names":["sjoerd-vdg/strinput","svdgoor/strinput"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/svdgoor/StrInput","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svdgoor%2FStrInput","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svdgoor%2FStrInput/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svdgoor%2FStrInput/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svdgoor%2FStrInput/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svdgoor","download_url":"https://codeload.github.com/svdgoor/StrInput/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svdgoor%2FStrInput/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278972327,"owners_count":26078019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-parser","commands"],"created_at":"2024-10-11T03:45:59.313Z","updated_at":"2025-10-08T16:04:32.487Z","avatar_url":"https://github.com/svdgoor.png","language":"Java","readme":"[license]: https://github.com/CocoTheOwner/StrInput/tree/main/LICENSE.md\n[license-shield]: https://img.shields.io/badge/license-GNU%20GPL%20v3-green\n[docs]: https://cocotheowner.github.io/StrInput/index.html\n[docs-shield]: https://img.shields.io/badge/Docs-Github%20Pages-green\n\n[ ![license-shield]][license]\n[![](https://jitpack.io/v/cocoTheOwner/strinput.svg)](https://jitpack.io/#cocoTheOwner/strinput)\n[ ![docs-shield]][docs]\n\n\n# StrInput\n\nStrInput provides a feature-rich general-use command parsing system.\nThis library helps implement command systems through reducing type conversion complexity and command parsing improvements.\n\n## Summary\n\n1. [Installation](#installation)\n2. [Setup (simple)](#setup-simple)\n3. [Setup (advanced)](#setup-advanced)\n4. [To-do](#to-do)\n\n# Release with jitpack support\nStrInput is now ready to be used. Though lacking some features, its main flow is working.\nExamples for both [Discord](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/examples/discord/package-summary.html) ([JDA](https://github.com/DV8FromTheWorld/JDA)) and [Spigot](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/examples/spigotmc/package-summary.html) ([SpigotMC](https://github.com/SpigotMC)) are present in the `examples` module.\n\n# Installation\n\nMake sure to replace `VERSION` with the latest version:  \n[![](https://jitpack.io/v/cocoTheOwner/strinput.svg)](https://jitpack.io/#cocoTheOwner/strinput)\n\nFor the latest (potentially unstable) available builds replace `VERSION` with `main-SNAPSHOT`.\n\n**Gradle**\n```gradle\nrepositories {\n    maven { url \"https://jitpack.io\" }\n    mavenCentral()\n}\n\ndependencies {\n    implementation 'com.github.CocoTheOwner:StrInput:VERSION'\n}\n```\n**Maven**\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.CocoTheOwner\u003c/groupId\u003e\n    \u003cartifactId\u003eStrInput\u003c/artifactId\u003e\n    \u003cversion\u003eVERSION\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n# Setup (simple)\nSetting up the command system is quite simple and requires only three steps.\n1. [User](#user)\n2. [Command Center](#command-center)\n3. [First Category](#first-category)\n\n## User\nTo interact with the system you will need an implementation of the abstract class [StrUser](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/system/StrUser.html). This implementation will handle messages from the system to the user.\n\n```java\npublic class CustomUser implements StrUser {\n    // To be defined\n}\n```\n\n## Command Center\nThe command center is an instance of [StrCenter](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/system/StrCenter.html).\nYou provide in the constructor at least a settings directory and one (or more) class instances (implementing [StrCategory](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/system/StrCategory.html)), which are your root commands. Additionally, you can (as shown in [Setup (advanced)](#setup-advanced)) optionally specify a console [StrUser](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/system/StrUser.html) (which by default simply uses `System.out.println()`), extra [StrParameterHandlers](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/system/parameter/StrParameterHandler.html) and [StrContextHandlers](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/system/context/StrContextHandler.html). It is advisable to store the command system in a main class (such as in the Spigot example, [SpigotPlugin](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/examples/spigotmc/SpigotPlugin.html)).\n\n```java\npublic class MainClass {\n    private static final StrCenter COMMAND_CENTER = new StrCenter(\n            new File(\"settings\"), // The file where settings are created, stored and can be edited\n            new ExampleCategory() // The 'root' category (this is a vararg, so there can be multiple!)\n    );\n}\n```\n_Notice the user of `ExampleCategory`. This class will be the first category made (the main command category). See [First Category](#first-category)._\n\nAfter creating the command center, whenever your system receives a user command, send it to the command center.\n```java\npublic class MainClass {\n\n    // Seen previously\n    private static final StrCenter COMMAND_CENTER = new StrCenter(\n            new File(\"settings\"),\n            new ExampleCategory()\n    );\n    \n    public void onCommand(String command, SomeUser user) {\n    \n        // Handle prefixes\n        if (!command.startsWith(\"!\")) {\n            return;\n        }\n        \n        // Run other logic to prevent users from using commands\n        if (!user.isCool()) {\n            return;\n        }\n        \n        // Pass the command to the command system\n        COMMAND_CENTER.onCommand(command.split(\" \"), new CustomUser(user.getName()));\n    }\n}\n```\nNow all that is left is creating the first command category!\n\n## First Category\nEach command (sub)category gets its own class.\nCommand categories can extend [StrCategory](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/system/StrCategory.html) (or a custom expansion of that, which you can create, see [StrCategory Extension](#strcategory-extension)) to gain access to the current [#user()](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/system/StrCategory.html#user()) (the command sender) and the current [#center()](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/system/StrCategory.html#center()) (the active command center).__\nThe category and commands therein must be annotated with [@StrInput](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/system/StrInput.html) and parameters with [@Param](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/system/Param.html). These annotation also contain settings such as the name, aliases and a description (and more, see the classes).\n\n```java\npublic final class ExampleCategory implements SpigotCommandCategory {\n\n    /**\n     * Send a message to the user\n     */\n    @StrInput(description = \"Send a message\", aliases = \"msg\")\n    public void message() {\n        user().sendMessage(C.G + \"Hey!\");\n    }\n\n    /**\n     * Send a message to debug\n     *\n     * @param message the message to send\n     */\n    @StrInput(description = \"Send a message to debug\")\n    public void debug(\n            @Param(\n                    description = \"The message to send to debug\",\n                    name = \"message\"\n            )\n            final String message\n    ) {\n        center().debug(message);\n    }\n}\n```\n_Note `)`. [Str](https://cocotheowner.github.io/StrInput/nl/codevs/strinput/system/text/Str.html) is the custom text format which can contain colors, color gradients, clickable event and text-hovering._\n\n# Setup (advanced)\nA set of custom options are available to further simplify command creation.\n1. [Advanced User](#advanced-user)\n2. [Extra Parameter Handlers](#extra-parameter-handlers)\n3. [Extra Context Handlers](#extra-context-handlers)\n4. [StrCategory Extension](#strcategory-extension)\n\n## Advanced User\nTBD\n\n## Extra Parameter Handlers\nTBD\n\n## Extra Context Handlers\nTBD\n\n## StrCategory Extension\nTBD\n\n# To-do\n- Implement help messages (categories, commands \u0026 parameters)\n- Add prepared Discord category, guild and permission handlers\n- Add suggestions (auto-completions)\n- Add Spigot colours + colour gradients\n- Add Discord \u0026 Spigot on-click implementation\n- Add Discord \u0026 Spigot on-hover implementation\n- Expand range of testcases for:\n  - Individual parameter \u0026 context handlers\n  - Discord \u0026 Spigot user and Center implementations\n- Style and documentation on Discord examples\n- Parameter performance improvements (it's fast enough, but can be faster)\n- Write advanced setup\n- Add support for only-root commands (/kill, instead of /plugin kill)\n- Test if multiple instances of the system running at once (meaning different implementations, such as on multiple Spigot plugins) will interfere with one-another.\n- Make sure parameters' names are saved\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvdgoor%2Fstrinput","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvdgoor%2Fstrinput","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvdgoor%2Fstrinput/lists"}