
Catppuccin CLI
Catppuccin CLI
A work-in-progress CLI for Catppuccin themes.
It allows you to:
- Install themes with one command
- Uninstall themes with one command
- Update themes with one command
Installation
- You can download the executable for this project from the releases section. Download the release as per your OS.
Development
- The foremost requirement to develop is to make sure that go version 1.19 is installed.
- Clone the repository and switch to the dev branch.
- Make all the changes to dev branch. To build the executable run
go build -o ctp
.
Note
- You need to make sure that you set the environmental variable
$ORG_OVERRIDE
tocatppuccin-rfc
or the tool will search for.catppuccin.yaml
in thecatppuccin
organisation which currently doesn't host the yaml files. This is a temporary measure to test the tool during its development.
Checklist
- Clone Template Repo
- Interactive Setup
- Custom Bubbletea UI
- Theme Name
- Interactive ctprc builder
- Program Name
- Operating Systems
- Install Location
- Handle inputs by renaming and editing files
Copyright © 2021-present Catppuccin Org
Rename package to ctp by changing locations
Optional, but raising an issue since we spoke about it in Discord.
Perhaps the current
cmd
directory could be moved tointernal
, and we could movemain.go
tocmd/ctp
This would mean that building would no longer strictly require the
-o
flag, andgo install
would work out of the box.Caching repos bug
Error: repos.json does not exist. Caching JSON...Received repositories. Caching! Cannot open file.
This happens when trying to search a catppuccin port.
Install command attempts to install even when no arguments are passed
Describe the bug This is a trivial bug and more so a cleanup step then anything but when running
ctp install
without a specific input argument, the cli attempts to install rather than detect that there was no input and exit gracefully.Observed behaviour The issue I've seen is as follows:
./ctp install
Expected behavior ctp returns an error indicating that for the install com
Screenshots
mand cannot have an empty arg.
Device Information OS: MacOS
Why are we cloning repos to pwd?
Wouldn't cloning repos to the pwd make it harder to check if something is already installed? If we're installing themes, are we installing them to a particular directory depending on the project? So, for example kitty themes we would want to install it at
~/.config/kitty/themes/
or something. Would it be worth having some confirmation of the default install location and you can provide an alternate location if you want?Unclear error message when initializing a duplicate project
Describe the bug When you try to create a new project with a name that conflict with an existing project, the error message is too vague to help debug.
Expected behavior I believe the error message should state that a project with the name ____ already exists in insert location
Screenshots
Device Information MacOS Monterey go version go1.19 darwin/arm64
feat uninstall hook
feat: add JSON Schema
There are a few extraneous commits in here, let me know if you want them removed or in another PR.
Both
mvdan/gofumpt
andmatryer/is
are personal preferences, so feel free to veto them.Of note,
mvdan/gofumpt
is fully compatible withgofmt
, so it shouldn't cause conflicts.And of course, the point of the PR, please take a look at the schema to make sure it makes sense. I followed the spec as closely as I could.
Major Internal Overhaul
List of changes:
Took a lot of time and a lot of blood was shed.
Bug: Remove function removing wrong files
Description The remove function needs a rewrite and as it currently stands, it does not yet handle flavours. But the function removes the top-level directory for most applications which is intended but this can cause issues with some electron based applications which store their user configuration in these top-level Directories (example: catppuccin/joplin or catppuccin/element). Invoking the remove command for such apps also removes the user configuration and usually logs the user out. This needs to be tackled.
Possible approach This can be worked in tandem with #14 by saving the installation location of the config for an application and then reading this installed location to uninstall only the required files, thus not removing the top-level directory.
Suggestion: Save location instead of flavour name for easier uninstallation.
This is more of a suggestion, not a bug
An alternate implementation idea for saving flavours during install
Currently, the half-working implementation saves the flavour the user enters and saves it to a file
flavours.yaml
at$XDG_DATA_HOME/catppuccin-cli/
. This is a bit problematic since this also causes #13. An alternate way to tackle this was suggested by @DakshG07, where we can store the location where a new config is being installed and then this location can be used during installation.Bug: Cli cannot detect already installed flavours if not on the first position in flavours.yaml file.
Description of the issue
flavours.yaml
file.Current behaviour If the contents of the
flavours.yaml
file is:and if the user tries to reinstall the latte variant, it should throw an error since latte is installed already but it instead throws the error:
Expected behaviour The cli should detect that the latte variant is already installed and instead throw the error:
A good start approach in solving this would be to understandthe
MakeFlavour
function: https://github.com/catppuccin/cli/blob/b0a050535705e70f2493606fc8dd382ff87ae088/internal/utils/utils.go#L406Acceptance criteria Any changes should be made on the dev branch and the PRs should be opened against the dev branch itself.