Skip to content

Commit e3e2223

Browse files
Merge pull request #21 from CosmicPredator/develop
Release v1.1.0
2 parents 8d80e5d + a69883b commit e3e2223

24 files changed

+554
-569
lines changed

CHANGELOG.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
### ✨ What's New
2-
- Chibi is now available in Snap Store for Linux users. To install chibi, run
3-
```shell
4-
sudo snap install chibi
5-
- Added Loading indicator to all API Requests.
6-
- Added `chibi logout` command to log you out from AniList.
7-
- Start Date is automatically added when `chibi add` command in invoked and `status` flag is set to `watching`.
8-
- `chibi update` command now supports 2 new flags,
9-
- `-n "<note>"` for entry notes.
10-
- `-r <score>` for entry score.
2+
3+
#### The `chibi profile` command now supports **Rendering Pixel Perfect Avatar** in the terminal. See [supported](https://sw.kovidgoyal.net/kitty/graphics-protocol/#:~:text=Other%20terminals%20that%20have%20implemented%20the%20graphics%20protocol%3A) terminals.
4+
<img src="https://github.com/user-attachments/assets/0eb56d2b-1b13-4f54-b71f-f953b012bc93" width="500">
5+
6+
---
7+
8+
#### New colorful help text (thanks to [charmbracelet/fang](https://github.com/charmbracelet/fang))
9+
<img src="https://github.com/user-attachments/assets/6884eed5-97f7-45a5-b639-1b2c6f8dc860" width="500"/>
10+
11+
---
12+
13+
#### The Table Layout for `chibi ls` and `chibi search` commands has been redesigned to be a compact [`eza`](https://github.com/eza-community/eza) like layout.
14+
<img src="https://github.com/user-attachments/assets/baba0b6c-d2f8-4063-805a-6972883827ec" width="500"/>
15+
1116

1217
### ✨ Other Changes
13-
- Migrated from JSON file storage to Sqlite3 storage for configurations.
14-
- Complete Architecture change for faster response.
15-
- Added Code Comments in missing areas
18+
- Removed SQLite Dependencies.
19+
- Used keyring store instead of SQLite DB.
20+
- Removed [`charmbracelet/huh`](https://github.com/charmbracelet/huh) dependencies (forms, spinners) and implemented those manually.
1621

17-
### 🐛 Bug Fixes
18-
- Fixed a bad `if` check when handling start date. (085fff237d04fde01e6b19d96078af2030ab1bbb)
19-
- Fixed app exiting with weird error messages.
20-
- Fixed "WinGet not detecting app version". This change will take effect when installing upcoming versions of chibi.
22+
> [!NOTE]
23+
> By reducing those dependencies, I was able to save approximately 3MB 😁.
2124
22-
Thanks @mist8kengas for the contributions ☺️.
25+
### 🐛 Bug Fixes
26+
- Fixed an early token check in `chibi ls` command, which restricts from calling the AniList API.

cmd/cmd_media_search.go

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,6 @@ import (
1313
var pageSize int
1414
var searchMediaType string
1515

16-
// func getMediaSearch(searchQuery string) {
17-
// CheckIfTokenExists()
18-
19-
// if pageSize < 0 || pageSize > 50 {
20-
// fmt.Println("page count must be lesser than 50 and greater than 0")
21-
// os.Exit(0)
22-
// }
23-
24-
// mediaSearch := internal.NewMediaSearch()
25-
// err := mediaSearch.Get(searchQuery, searchMediaType, pageSize)
26-
// if err != nil {
27-
// ErrorMessage(err.Error())
28-
// }
29-
// rows := [][]string{}
30-
31-
// for _, i := range mediaSearch.Data.Page.Media {
32-
// rows = append(rows, []string{
33-
// strconv.Itoa(i.Id),
34-
// i.Title.UserPreferred,
35-
// fmt.Sprintf("%.2f", i.AverageScore),
36-
// })
37-
// }
38-
39-
// // get size of terminal
40-
// tw, _, err := term.GetSize((os.Stdout.Fd()))
41-
// if err != nil {
42-
// ErrorMessage(err.Error())
43-
// }
44-
45-
// t := table.New().
46-
// Border(lipgloss.RoundedBorder()).
47-
// BorderStyle(lipgloss.NewStyle().Foreground(lipgloss.Color("99"))).
48-
// StyleFunc(func(row, col int) lipgloss.Style {
49-
// // style for table header row
50-
// if row == -1 {
51-
// return lipgloss.NewStyle().Foreground(lipgloss.Color("99")).Bold(true).Align(lipgloss.Center)
52-
// }
53-
54-
// // force title column to wrap by specifying terminal width
55-
// if col == 1 {
56-
// return lipgloss.NewStyle().Align(lipgloss.Center).PaddingLeft(2).PaddingRight(2).Width(tw)
57-
// }
58-
59-
// return lipgloss.NewStyle().Align(lipgloss.Center).PaddingLeft(2).PaddingRight(2)
60-
// }).
61-
// Headers("ID", "TITLE", "SCORE").
62-
// Rows(rows...).Width(tw)
63-
64-
// fmt.Println(t)
65-
// }
66-
6716
func handleMediaSearch(cmd *cobra.Command, args []string) {
6817
if len(args) == 0 {
6918
fmt.Println("No seach queries provided")

cmd/cmd_root.go

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,20 @@
11
package cmd
22

33
import (
4+
"context"
45
"fmt"
56

7+
"github.com/CosmicPredator/chibi/internal/ui"
8+
"github.com/charmbracelet/fang"
69
"github.com/spf13/cobra"
710
)
811

9-
var isVersionCmd bool
10-
var appVersion string = "develop"
11-
1212
var rootCmd = &cobra.Command{
1313
Use: "chibi",
14-
Long: "Chibi for AniList - A lightweight anime & manga tracker CLI app powered by AniList.",
15-
Run: func(cmd *cobra.Command, args []string) {
16-
if isVersionCmd {
17-
fmt.Printf("chibi version %s\n", appVersion)
18-
} else {
19-
cmd.Help()
20-
}
21-
},
22-
}
23-
24-
func init() {
25-
rootCmd.Flags().BoolVarP(&isVersionCmd, "version", "v", false, "prints the version of chibi")
14+
Long: "Chibi for AniList - A lightweight anime & manga tracker CLI app powered by AniList.\nRead the documentation at https://chibi-cli.pages.dev/",
2615
}
2716

2817
func Execute(version string) {
29-
appVersion = version
3018
rootCmd.CompletionOptions.DisableDefaultCmd = true
3119
rootCmd.AddCommand(
3220
loginCmd,
@@ -37,5 +25,11 @@ func Execute(version string) {
3725
mediaUpdateCmd,
3826
mediaAddCmd,
3927
)
40-
rootCmd.Execute()
28+
if err := fang.Execute(
29+
context.TODO(),
30+
rootCmd,
31+
fang.WithVersion(version),
32+
); err != nil {
33+
fmt.Println(ui.ErrorText(err))
34+
}
4135
}

go.mod

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,38 @@ module github.com/CosmicPredator/chibi
33
go 1.24.0
44

55
require (
6-
github.com/charmbracelet/huh v0.6.0
7-
github.com/charmbracelet/huh/spinner v0.0.0-20250213143221-71c9d72e6770
8-
github.com/charmbracelet/lipgloss v1.0.0
9-
github.com/charmbracelet/x/term v0.2.1
10-
github.com/spf13/cobra v1.8.1
11-
modernc.org/sqlite v1.35.0
6+
github.com/charmbracelet/fang v0.1.0
7+
github.com/charmbracelet/lipgloss v1.1.0
8+
github.com/spf13/cobra v1.9.1
9+
github.com/zalando/go-keyring v0.2.6
1210
)
1311

1412
require (
15-
github.com/atotto/clipboard v0.1.4 // indirect
13+
al.essio.dev/pkg/shellescape v1.5.1 // indirect
1614
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
17-
github.com/catppuccin/go v0.2.0 // indirect
18-
github.com/charmbracelet/bubbles v0.20.0 // indirect
19-
github.com/charmbracelet/bubbletea v1.3.3 // indirect
20-
github.com/charmbracelet/x/ansi v0.8.0 // indirect
21-
github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 // indirect
22-
github.com/dustin/go-humanize v1.0.1 // indirect
23-
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
24-
github.com/google/uuid v1.6.0 // indirect
15+
github.com/charmbracelet/colorprofile v0.3.1 // indirect
16+
github.com/charmbracelet/lipgloss/v2 v2.0.0-beta1 // indirect
17+
github.com/charmbracelet/x/ansi v0.9.3 // indirect
18+
github.com/charmbracelet/x/cellbuf v0.0.13 // indirect
19+
github.com/charmbracelet/x/exp/charmtone v0.0.0-20250616121729-19b66ab4499b // indirect
20+
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 // indirect
21+
github.com/charmbracelet/x/term v0.2.1 // indirect
22+
github.com/danieljoos/wincred v1.2.2 // indirect
23+
github.com/godbus/dbus/v5 v5.1.0 // indirect
2524
github.com/inconshreveable/mousetrap v1.1.0 // indirect
2625
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
2726
github.com/mattn/go-isatty v0.0.20 // indirect
28-
github.com/mattn/go-localereader v0.0.1 // indirect
2927
github.com/mattn/go-runewidth v0.0.16 // indirect
30-
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
31-
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
3228
github.com/muesli/cancelreader v0.2.2 // indirect
33-
github.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a // indirect
34-
github.com/ncruces/go-strftime v0.1.9 // indirect
35-
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
29+
github.com/muesli/mango v0.2.0 // indirect
30+
github.com/muesli/mango-cobra v1.2.0 // indirect
31+
github.com/muesli/mango-pflag v0.1.0 // indirect
32+
github.com/muesli/roff v0.1.0 // indirect
33+
github.com/muesli/termenv v0.16.0 // indirect
3634
github.com/rivo/uniseg v0.4.7 // indirect
3735
github.com/spf13/pflag v1.0.6 // indirect
38-
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 // indirect
39-
golang.org/x/sync v0.11.0 // indirect
40-
golang.org/x/sys v0.30.0 // indirect
41-
golang.org/x/text v0.22.0 // indirect
42-
modernc.org/libc v1.61.13 // indirect
43-
modernc.org/mathutil v1.7.1 // indirect
44-
modernc.org/memory v1.8.2 // indirect
36+
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
37+
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
38+
golang.org/x/sys v0.33.0 // indirect
39+
golang.org/x/text v0.26.0 // indirect
4540
)

0 commit comments

Comments
 (0)