<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Niclas van Eyk</title><description>Blog posts and projects by Niclas van Eyk</description><link>https://niclasve.me/</link><item><title>Diy</title><link>https://niclasve.me/projects/diy/</link><guid isPermaLink="true">https://niclasve.me/projects/diy/</guid><description>A modern dependency injection container for Python.</description><pubDate>Sun, 07 Apr 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I really like the &lt;a href=&quot;https://laravel.com/docs/container&quot;&gt;Laravel Service Container&lt;/a&gt;.
&lt;code&gt;diy&lt;/code&gt; is my attempt at recreating something in Python.
After working with FastAPI, I notices some shortcomings in their &lt;a href=&quot;https://fastapi.tiangolo.com/tutorial/dependencies&quot;&gt;DI system&lt;/a&gt;.
Other solutions in the Python ecosystem also did not satisfy me.
Most of the issues I had are described in the &lt;a href=&quot;https://diy.niclasve.me/reference/guiding-principles&quot;&gt;guiding principles section&lt;/a&gt; of &lt;code&gt;diy&lt;/code&gt;s documentation, though no libraries are explicitly mentioned.&lt;/p&gt;
&lt;h2&gt;Quickstart&lt;/h2&gt;
&lt;p&gt;There are two important parts in &lt;code&gt;diy&lt;/code&gt;.
&lt;code&gt;Specification&lt;/code&gt;s contain explicit instructions about how to resolve function parameters, construct types or map protocols/interfaces to a concrete implementation.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import diy

spec = diy.Specification()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is our example class, which only takes one parameter&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;class ApiClient:
  def __init__(self, token: str):
    self.token = token

  def get(self, url: str):
    # imagine an actual implementation here using the token
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This teaches our container how to build an &lt;code&gt;ApiClient&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import os

@spec.builders.decorate
def build_api_client() -&amp;gt; ApiClient:
  return ApiClient(token=os.environ[&quot;API_TOKEN&quot;])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The container retrieves a spec, and uses the contained instructions to construct types&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;container = diy.RuntimeContainer(spec)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is how you get an instance&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;api_client = diy.resolve(ApiClient)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can also call functions by letting their parameters be
resolved from the container&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;def get_data(api: ApiClient):
  return api.imaginary_method(&quot;&quot;)
result = diy.call(get_data)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;focus on good error messages&lt;/li&gt;
&lt;li&gt;dependency visualization&lt;/li&gt;
&lt;li&gt;autowiring&lt;/li&gt;
&lt;li&gt;validation&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>Pytest GitLab Code Quality</title><link>https://niclasve.me/projects/pytest-gitlab-code-quality/</link><guid isPermaLink="true">https://niclasve.me/projects/pytest-gitlab-code-quality/</guid><description>Collects warnings while testing and generates a GitLab Code Quality Report.</description><pubDate>Thu, 28 Mar 2024 00:00:00 GMT</pubDate><content:encoded/></item><item><title>Auto-Dark-Mode for Fish Shell</title><link>https://niclasve.me/blog/auto-dark-mode-for-fish-shell/</link><guid isPermaLink="true">https://niclasve.me/blog/auto-dark-mode-for-fish-shell/</guid><pubDate>Wed, 28 Feb 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I prefer using light mode in bright environments and dark mode in darker ones.
To me, this just makes sense.
I don&apos;t want to be blinded by a screen when looking at my phone after waking up.
Similarly, I also don&apos;t want to have a hard time reading white text on a dark background during the day.&lt;/p&gt;
&lt;p&gt;This is why I typically setup my computers to schedule dark mode around sunset and use light mode again after sunrise.
Most applications, such as apps, websites, etc. automatically adjust their theme to match the one of the operating system.
However, as a developer, one notable exception is the terminal.&lt;/p&gt;
&lt;h2&gt;The Problem With Terminal Color Themes&lt;/h2&gt;
&lt;p&gt;&amp;lt;!--
TODO: Maybe talk about fundamentals here.
Terminal text &lt;em&gt;includes&lt;/em&gt; styles, similar to inline styles in HTML.
--&amp;gt;&lt;/p&gt;
&lt;p&gt;Terminals used bright text on a dark background even before operating system dark mode was a thing.
This is also why a lot of tools just assume dark mode, making.&lt;/p&gt;
&lt;p&gt;There are terminals that can automatically change their color theme based on the system dark mode setting.
One example is &lt;a href=&quot;https://wezfurlong.org/wezterm&quot;&gt;WezTerm&lt;/a&gt;, where you configure the terminal using Lua scripts and can adjust your color theme using the &lt;a href=&quot;https://wezfurlong.org/wezterm/config/lua/wezterm.gui/get_appearance.html&quot;&gt;&lt;code&gt;get_appearance&lt;/code&gt; function&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This fixes part of the problem for some terminals, but simply changing the terminal colors, does not automatically make everything readable.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hardcoded Colors&lt;/strong&gt;.
Hopefully these are &lt;a href=&quot;https://en.wikipedia.org/wiki/ANSI_escape_code#Colors&quot;&gt;ANSI colors&lt;/a&gt;.
Then the program specifies, that e.g. a portion of text should be red, and your terminal color scheme then determines the specific shade of red.
However, this might be a concrete RGB value, in which case your out of luck.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Inferred Colors&lt;/strong&gt;.
There are nonstandard ways for programs to detect, whether you use a light or dark terminal color scheme (e.g. have a look at the &lt;a href=&quot;https://github.com/Canop/terminal-light/tree/main&quot;&gt;&lt;code&gt;terminal-light&lt;/code&gt; Rust crate&lt;/a&gt;, which links to a few nice sources in its code).
Based on this, the program can adjust its output and use light text on a dark background or vice verca.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Adjustable Colors&lt;/strong&gt;.
Some programs allow the user to control how it renders its output.
Examples include &lt;a href=&quot;https://github.com/sharkdp/bat&quot;&gt;&lt;code&gt;bat&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://github.com/Wilfred/difftastic&quot;&gt;&lt;code&gt;difft&lt;/code&gt;&lt;/a&gt;, and most programs using Charms &lt;a href=&quot;https://github.com/charmbracelet/glow&quot;&gt;Glow&lt;/a&gt; / &lt;a href=&quot;https://github.com/charmbracelet/lipgloss&quot;&gt;Lip Gloss&lt;/a&gt; libraries for highlighting text, such as GitHubs &lt;a href=&quot;https://cli.github.com&quot;&gt;&lt;code&gt;gh&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ideally the program infers the color scheme, but lets you override the theme yourself.
This way, you can still adjust the color scheme to your liking.
Why this is still useful can be seen in the following image, displaying the output of the previously mentioned &lt;code&gt;bat&lt;/code&gt; program, which, amongst others things, can output the contents of a file with syntax highlighting:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;On the left, you see inferred colors from my terminal color scheme, which is Visual Studios Dark+ Theme for the Kitty terminal emulator.
On the right you see the output when setting the color scheme to a Dark+ Theme specifically created for &lt;code&gt;bat&lt;/code&gt;.
As can be seen, the right one highlights closer to how the color scheme would look in VS Code itself.
While the one on the left also uses colors from the general palette of the theme, the right one uses green for comments, just as VS Code would, leading to a more familiar and uniform look.&lt;/p&gt;
&lt;h2&gt;How Fish Can Help&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;https://fishshell.com&quot;&gt;Fish shell&lt;/a&gt; has some nice features compared to Bash or Zsh.
Out of the box it includes autocompletion, syntax highlighting, and (in my opinion) more sensible defaults in general.&lt;/p&gt;
&lt;p&gt;For this post, we want to focus on its ability to define &lt;a href=&quot;https://fishshell.com/docs/current/language.html#universal-variables&quot;&gt;universal variables&lt;/a&gt; and reacting to variable changes using &lt;a href=&quot;https://fishshell.com/docs/current/language.html#event-handlers&quot;&gt;event handlers&lt;/a&gt;.
In short, the former is a variable that all shell instances share.
These can also be exported, which means that they are available as an environment variable.
The latter allows us to respond to changes of variables.
Together, these two features enable us to configure the color scheme of our CLI programs based on a single value.&lt;/p&gt;
&lt;h2&gt;A Concrete Example&lt;/h2&gt;
&lt;p&gt;Lets say we want to configure the color scheme of both Diffastic and Bat.
We also want to have a single source of truth for whether we are in dark or light mode.&lt;/p&gt;
&lt;p&gt;First, lets define this single value using a universal and exported fish variable.
Fish can be configured by placing any &lt;code&gt;*.fish&lt;/code&gt; file inside your configuration directory, which is usually &lt;code&gt;~/.config/fish/conf.d/&lt;/code&gt;.
So lets create &lt;code&gt;auto_dark_mode.fish&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# ~/.config/fish/conf.d/auto_dark_mode.fish

# We default to dark. It is better to be surprised by a dark theme in a light 
# environment, than a bright screen in a dark one.
set -Ux COLOR_MODE dark
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This now gives us a variable we can change in any shell and it will sync to all other instances:&lt;/p&gt;
&lt;p&gt;&amp;lt;video class=&quot;w-full&quot; controls loop playsinline autoplay muted&amp;gt;
&amp;lt;source src=&quot;https://cdn.niclasve.me/videos%2Ffish-universal-variables.mp4&quot; type=&quot;video/mp4&quot;&amp;gt;
&amp;lt;/video&amp;gt;&lt;/p&gt;
&lt;p&gt;Now, lets create a separate configuration file for bat:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# ~/.config/fish/conf.d/bat.fish

# This environment variable gets read by bat and configures its theme.
set -Ux BAT_THEME &apos;Visual Studio Dark+&apos;

# This function will be automatically called, whenever COLOR_MODE is changed.
function update_bat_theme --on-variable COLOR_MODE
    # Based on the new value of COLOR_MODE, we either configure
    # bat to use our preferred light or dark color scheme.
    if [ $COLOR_MODE = light ]
        set BAT_THEME &apos;Solarized (light)&apos;
    else
        set BAT_THEME &apos;Visual Studio Dark+&apos;
    end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can configure difftastic in a similar way:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# ~/.config/fish/conf.d/difftastic.fish

# Difftastic automatically sets colors, but we need to explicitly tell it 
# whether we have a light or a dark terminal theme.
set -Ux DFT_BACKGROUND dark

function update_difftastic_background --on-variable COLOR_MODE
    # You could also directly assign the value of COLOR_MODE here, but this
    # way it is clear that this is the same pattern as before.
    if [ $COLOR_MODE = light ]
        set DFT_BACKGROUND light
    else
        set DFT_BACKGROUND dark
    end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Automation&lt;/h2&gt;
&lt;p&gt;By now we can manually run &lt;code&gt;set COLOR_MODE = dark&lt;/code&gt; in our shell to explicitly tell our command line applications to adjust to dark mode.
This works, but is a bit cumbersome to do every time you pick up your laptop in the evening or early morning.
Since it is dark outside your OS &lt;em&gt;automatically&lt;/em&gt; adjusted, but our shell still kept the state it was in last time, which might be light mode.&lt;/p&gt;
&lt;p&gt;&amp;lt;!-- Simple Solution --&amp;gt;
A simple solution is just ask the OS what mode we are in every time we start a new shell.
Thanks the universal variables, starting a new shell would also update all the others.
&lt;strong&gt;TODO&lt;/strong&gt; A bit more text here.&lt;/p&gt;
&lt;p&gt;&amp;lt;!-- Dark Mode Daemon -- Motivation --&amp;gt;
A better, but maybe slightly more complex solution is to somehow get notified when the OS dark mode changes and react to this.
We can achieve this using &lt;a href=&quot;https://github.com/NiclasvanEyk/dark-mode-daemon&quot;&gt;Dark Mode Daemon&lt;/a&gt;, which can be easily installed and launched at login via Homebrew.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;To be honest, I searched for a solution to this problem for MacOS, but every article or forum post I did find told me to write my own Swift program and juggle with &lt;code&gt;.plist&lt;/code&gt; entries.
This is not something I could easily put in my dotfiles, so I decided to automate this, leading to the creation of Dark Mode Daemon.
It still is a swift program, but you don&apos;t need to adjust it or maintain it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;lt;!-- Dark Mode Daemon -- How it Works --&amp;gt;
So what does it do?
Basically, you place an executable script in &lt;code&gt;~/.config/dark-mode-daemon/scripts&lt;/code&gt; and it will called when dark mode changes, you initially log in, and when your computer wakes up from sleep mode.
It sets the &lt;code&gt;DMD_COLOR_MODE&lt;/code&gt; to either &lt;code&gt;light&lt;/code&gt; or &lt;code&gt;dark&lt;/code&gt; when running the scripts, so we can very easily automate syncing our universal fish variable:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# ~/.config/dark-mode-daemon/scripts/fish-color-mode.fish

#!/usr/bin/fish

set COLOR_MODE $DMD_COLOR_MODE
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And that&apos;s it!&lt;/p&gt;
&lt;p&gt;&amp;lt;details&amp;gt;
&amp;lt;summary&amp;gt;Bonus: Automate changing your terminal color scheme&amp;lt;/summary&amp;gt;&lt;/p&gt;
&lt;p&gt;If you are not using one of the previously mentioned terminals that can sync their color scheme, you might want to utilize Dark Mode Daemon.
This is what I have done to have my terminal, Kitty, to sync its color scheme with the operation system one.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# ~/.config/dark-mode-daemon/scripts/update-kitty-theme.sh

#!/usr/bin/env bash

# Link light.theme.conf or dark.theme.conf to current.theme.conf
ln -s -f &quot;$HOME/.config/kitty/$DMD_COLOR_MODE.theme.conf&quot; &quot;$HOME/.config/kitty/current.theme.conf&quot;

# Tell all running kitty instances that the color mode has changed and that they should reload their config.
kill -SIGUSR1 $(pgrep -a kitty)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To make the above script work, we need to add the following to our kitty configuration file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;include current.theme.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and then create &lt;code&gt;~/.config/kitty/dark.theme.conf&lt;/code&gt; and &lt;code&gt;~/.config/kitty/light.theme.conf&lt;/code&gt;, which contain our chosen theme files.
The script will then link &lt;code&gt;current.theme.conf&lt;/code&gt; to the theme based on the OS color scheme.
Themes files can be retrieved from the &lt;a href=&quot;https://github.com/dexpota/kitty-themes/tree/master/themes&quot;&gt;&lt;code&gt;kitty-themes&lt;/code&gt; repository on GitHub&lt;/a&gt; or by using the &lt;code&gt;kitty +kitten themes&lt;/code&gt; command.
&amp;lt;/details&amp;gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;&amp;lt;!-- TODO --&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>Dark Mode Daemon</title><link>https://niclasve.me/projects/dark-mode-daemon/</link><guid isPermaLink="true">https://niclasve.me/projects/dark-mode-daemon/</guid><description>Run scripts when the system color scheme changes between light and dark.</description><pubDate>Wed, 28 Feb 2024 00:00:00 GMT</pubDate><content:encoded/></item><item><title>Web Framework Field Guide</title><link>https://niclasve.me/projects/web-framework-field-guide/</link><guid isPermaLink="true">https://niclasve.me/projects/web-framework-field-guide/</guid><description>Documents, compares and explains implementations of common web framework patterns.</description><pubDate>Tue, 03 Oct 2023 00:00:00 GMT</pubDate><content:encoded/></item><item><title>Chers</title><link>https://niclasve.me/projects/chers/</link><guid isPermaLink="true">https://niclasve.me/projects/chers/</guid><description>Chess for the terminal and web.</description><pubDate>Wed, 20 Sep 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;This project primarily originated from the urge to play with technologies.
I like to play chess from time to time, so why not recreate it from scratch?
At first, it was an excuse to learn the Rust programming language.
Then it turned more into an excuse to learn more about rendering in a terminal environment.
Turns out you can compile Rust to WebAssembly, so the logical next step was to do just that so everything can run in the browser.
That however, required to also build a web UI in addition to the terminal one.&lt;/p&gt;
&lt;p&gt;The implementation is definitely not complete though.
While all movement patterns, detecting checks and check mates, and even some more exotic rules like en passant do work, castling and e.g. proper movement clocks do not.
I&apos;d also like to implement peer to peer matches via sockets.&lt;/p&gt;
</content:encoded></item><item><title>Keepac</title><link>https://niclasve.me/projects/keepac/</link><guid isPermaLink="true">https://niclasve.me/projects/keepac/</guid><description>Read, edit and query changelogs from your terminal.</description><pubDate>Fri, 19 May 2023 00:00:00 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;Named after the first few letters of &lt;a href=&quot;https://keepachangelog.com&quot;&gt;&lt;strong&gt;keepac&lt;/strong&gt;hangelog.com&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The Keep a Changelog best practises provide a solid foundation when writing changelogs.
This way, you can concentrate on writing the changelog itself.&lt;/p&gt;
&lt;p&gt;Keepac helps you work with changelogs following these conventions.
Its binary, &lt;code&gt;changelog&lt;/code&gt;, makes all commands feel natural.&lt;/p&gt;
&lt;h2&gt;Example workflow&lt;/h2&gt;
&lt;p&gt;Let&apos;s walk through common software development steps to show how Keepac can help us documenting the user-facing changes.
The command line blocks show the commands and their respective output.
Below the commands you also see the diff of the &lt;code&gt;CHANGELOG.md&lt;/code&gt; file.&lt;/p&gt;
&lt;h3&gt;Creating The Changelog File&lt;/h3&gt;
&lt;p&gt;Now imagine you have already created your project using something like &lt;code&gt;cargo new&lt;/code&gt;, &lt;code&gt;npm create&lt;/code&gt;, or something else.
Since we are very disciplined developers, we start documenting our changes right away.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ changelog init

Initialized empty changelog at /tmp/keepac-demo/CHANGELOG.md:

   Changelog                                                                       
                                                                                   
  All notable changes to this project will be documented in this file.             
                                                                                   
  The format is based on Keep a Changelog https://keepachangelog.com/en/1.1.0/, and
  this project adheres to Semantic Versioning https://semver.org/spec/v2.0.0.html. 
                                                                                   
  ## [Unreleased]                                                                  

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;br&amp;gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
+ # Changelog
+
+ All notable changes to this project will be documented in this file.
+
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+ ## [Unreleased]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That was easy!
We did not even have to open our IDE or text editor.&lt;/p&gt;
&lt;p&gt;If you use &lt;code&gt;git&lt;/code&gt; on the command line, this workflow feels very similar to &lt;code&gt;git init&lt;/code&gt;.
This is on purpose.
While the &lt;code&gt;git&lt;/code&gt; CLI is not known for being intuitive, it has some nice features that inspired &lt;code&gt;changelog&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Documenting Changes&lt;/h3&gt;
&lt;p&gt;Now imagine we have implement a new feature.
The details are not important, just imagine we added a new API that our users should know about.
Again, we use &lt;code&gt;changelog&lt;/code&gt; for this, directly from our terminal.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ changelog add &quot;A shiny new feature&quot;

  ### Added                                                                        
                                                                                   
  • A shiny new feature                                                            
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;br&amp;gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  # Changelog

  All notable changes to this project will be documented in this file.

  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

  ## [Unreleased]
+
+ ### Added
+
+ - A shiny new feature
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Similar to &lt;code&gt;git&lt;/code&gt;, if you omit the message, your &lt;code&gt;$EDITOR&lt;/code&gt; would open and you could provide more detail.&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;Removing, Changing, Or Deprecating Features&lt;/h3&gt;
&lt;p&gt;In our fictional example, it won&apos;t really make sense to document the removal of features.
However, the Keep a Changelog guidelines list several types of changes, such as bug fixes, deprecations or general changes in behavior of the software.
Let&apos;s document the removal of an old feature that we no longer want to support, just to see how that would work.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ changelog rm &quot;A boring old feature&quot;

  ### Removed                                                                      
                                                                                   
  • A boring old feature                                                           
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;br&amp;gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  # Changelog

  All notable changes to this project will be documented in this file.

  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

  ## [Unreleased]

  ### Added

  - A shiny new feature

+ ### Removed
+
+ - A boring old feature
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Instead of using the shortcuts (&lt;code&gt;add&lt;/code&gt;, &lt;code&gt;change&lt;/code&gt;, &lt;code&gt;deprecate&lt;/code&gt;, ...), you may also run the generic &lt;code&gt;changelog insert&lt;/code&gt; and pass one of the following flags&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--added&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--changed&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--deprecated&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--fixed&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--removed&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--security&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can run &lt;code&gt;changelog insert --help&lt;/code&gt; to see a complete list of the supported change types, including their shortcuts and aliases.&lt;/p&gt;
&lt;h3&gt;Releasing&lt;/h3&gt;
&lt;p&gt;Up until now, all our changes are documented under the &lt;code&gt;[Unreleased]&lt;/code&gt; section.
Now we are going to change that.
First, we check what&apos;s contained in our next release.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ changelog show next

  ## [Unreleased]                                                                  
                                                                                   
  ### Added                                                                        
                                                                                   
  • A shiny new feature                                                            
                                                                                   
  ### Removed                                                                      
                                                                                   
  • A boring old feature                                                           
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Just as we expect, it only consists of our two changes.
To be fair, this command is much more helpful when you have a long list of historic releases that you don&apos;t want to look at every time.&lt;/p&gt;
&lt;p&gt;Now we choose, whether we want to increment the major, minor, or patch version and run the &lt;code&gt;release&lt;/code&gt; command.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ changelog release --minor

  ## [0.1.0] - 2024-03-05                                                          
                                                                                   
  ### Added                                                                        
                                                                                   
  • A shiny new feature                                                            
                                                                                   
  ### Removed                                                                      
                                                                                   
  • A boring old feature                                                           
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;br&amp;gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  # Changelog

  All notable changes to this project will be documented in this file.

  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

- ## [Unreleased]
+ ## [0.1.0] - 2024-03-05

  ### Added

  - A shiny new feature

  ### Removed

  - A boring old feature
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We chose to explicitly pass the &lt;code&gt;--minor&lt;/code&gt; flag here, but you can also pass no flag to the &lt;code&gt;release&lt;/code&gt; command to interactively choose the next version.&lt;/p&gt;
&lt;h2&gt;Closing Notes&lt;/h2&gt;
&lt;p&gt;And now we are done!
The steps in the example are roughly the workflows that motivated the creation of Keepac.
I grew tired of looking up the exact headings that Keep a Changelog uses, inserting them manually, or manually looking up todays date for a release.
Every one of these steps does not sound that inconvenient, but I found implementing them using &lt;code&gt;changelog&lt;/code&gt; much more convenient!&lt;/p&gt;
&lt;p&gt;There is more to explore.
You can run &lt;code&gt;changelog --help&lt;/code&gt; to explore everything.
Here are some examples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;generate the text for a GitHub release using &lt;code&gt;changelog show --plain $VERSION&lt;/code&gt; (&lt;a href=&quot;https://github.com/NiclasvanEyk/keepac/blob/main/.github/workflows/goreleaser.yml#L26&quot;&gt;example from Keepacs own release workflow&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;open up &lt;code&gt;CHANGELOG.md&lt;/code&gt; from anywhere in your project using &lt;code&gt;changelog edit&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;view the changes of multiple releases combined using &lt;code&gt;changelog diff --merged 0.2.0 0.2.8&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;search for strings in changelogs (like &lt;code&gt;grep&lt;/code&gt;) and see the resulting within context (version, changetype, unlike &lt;code&gt;grep&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want to try it out and you run Linux or MacOS, just run&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;brew install niclasvaneyk/keepac/keepac
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To learn more, such as how to compile it from scratch for Windows support, is visit the project &lt;a href=&quot;https://github.com/NiclasvanEyk/keepac&quot;&gt;on GitHub&lt;/a&gt;.&lt;/p&gt;
</content:encoded></item><item><title>Initializer for Laravel</title><link>https://niclasve.me/projects/initializer-for-laravel/</link><guid isPermaLink="true">https://niclasve.me/projects/initializer-for-laravel/</guid><description>A visual approach to creating a new Laravel application.</description><pubDate>Fri, 25 Jun 2021 00:00:00 GMT</pubDate><content:encoded/></item><item><title>Make for Laravel</title><link>https://niclasve.me/projects/make-for-laravel/</link><guid isPermaLink="true">https://niclasve.me/projects/make-for-laravel/</guid><description>A set of integration points that connect your Laravel application to PhpStorm.</description><pubDate>Mon, 06 Jul 2020 00:00:00 GMT</pubDate><content:encoded/></item></channel></rss>