<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Benjamin Abendroth</title>
    <description>The latest articles on Forem by Benjamin Abendroth (@crazycomplete).</description>
    <link>https://forem.com/crazycomplete</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2266629%2Fb08e47c4-8c6b-4b22-b9b6-d5b473d02036.png</url>
      <title>Forem: Benjamin Abendroth</title>
      <link>https://forem.com/crazycomplete</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/crazycomplete"/>
    <language>en</language>
    <item>
      <title>crazy-complete: Generate shell auto-completion files with a single configuration file</title>
      <dc:creator>Benjamin Abendroth</dc:creator>
      <pubDate>Sat, 26 Oct 2024 09:46:35 +0000</pubDate>
      <link>https://forem.com/crazycomplete/crazy-complete-generate-shell-auto-completion-files-with-a-single-configuration-file-kk3</link>
      <guid>https://forem.com/crazycomplete/crazy-complete-generate-shell-auto-completion-files-with-a-single-configuration-file-kk3</guid>
      <description>&lt;p&gt;Hello everyone!&lt;/p&gt;

&lt;p&gt;I want to introduce my current project &lt;a href="https://github.com/crazy-complete/crazy-complete" rel="noopener noreferrer"&gt;crazy-complete&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It is a tool that generates shell auto-completion files using a single configuration file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simple configuration&lt;/strong&gt;: The tool uses an easy-to-use &lt;strong&gt;YAML&lt;/strong&gt; format&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi shell support&lt;/strong&gt;: The tool supports &lt;strong&gt;Bash&lt;/strong&gt;, &lt;strong&gt;Fish&lt;/strong&gt; and &lt;strong&gt;Zsh&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Option types&lt;/strong&gt;: All common option types are supported: &lt;strong&gt;long-options&lt;/strong&gt; (--option), &lt;strong&gt;short-options&lt;/strong&gt; (-o) and &lt;strong&gt;old-style-options&lt;/strong&gt; (-option)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Argument types&lt;/strong&gt;: Options with &lt;strong&gt;required&lt;/strong&gt; arguments, with &lt;strong&gt;optional&lt;/strong&gt; arguments and &lt;strong&gt;no arguments&lt;/strong&gt; are supported&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mutually exclusive options&lt;/strong&gt;: You can define groups of options that can't be used together&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repeatable options&lt;/strong&gt;: You can control if an option may be &lt;strong&gt;repeated&lt;/strong&gt; on commandline, or should appear only &lt;strong&gt;once&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Positional arguments&lt;/strong&gt;: You can easily define arguments for your program&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Built-in completion types&lt;/strong&gt;: The tool comes with these completions: &lt;em&gt;file, directory, choices, value_list, range, signal, process, pid, command, user, group, service, variable, environment&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom completions&lt;/strong&gt;: If the built-ins aren't sufficient, there is the &lt;em&gt;exec&lt;/em&gt; command to complete stuff based of a command's output&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conditional options/positionals&lt;/strong&gt;: You can enable options and positionals based on conditions, like "is there an option present?" or "does an option have a specific value?"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subommands&lt;/strong&gt;: You can specify arbitrary levels of subcommands&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Robust scripts&lt;/strong&gt;: Unlike other generation tools, cracy-complete parses the whole commandline according to the specified options (instead of only looking at the last two args, for example)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficient scripts&lt;/strong&gt;: Scripts were made with efficiency in mind. You pay only for what you use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Well tested&lt;/strong&gt;: There are over fifty tests per shell to ensure correct behaviour&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Other Features&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;argparse Support&lt;/strong&gt;: If your program is written in &lt;strong&gt;Python&lt;/strong&gt; and uses the &lt;strong&gt;arparse&lt;/strong&gt;-module, there is a chance that you can generate scripts (or YAML files) from the &lt;strong&gt;argparse.ArgumentParsers&lt;/strong&gt;'s definitions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Help text parser&lt;/strong&gt;: If your program comes with a help text, there is a chance that you can generate YAML definition files by parsing it's output&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're tired of maintaining completion scripts for different shells, &lt;strong&gt;crazy-complete&lt;/strong&gt; may be for you.&lt;/p&gt;

&lt;p&gt;Even if you decide against using generated scripts, the output of the tool may serve as an inspiration.&lt;/p&gt;

&lt;p&gt;Let me know what you think. If you need support or have any questions or improvement-ideas, don't hesitate to ask!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And if you like the tool, please give it a star on&lt;/strong&gt; &lt;a href="https://github.com/crazy-complete/crazy-complete]" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pastecode.io/s/9a07e0xy" rel="noopener noreferrer"&gt;Here you can find an example definition file&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>bash</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
