lune

created pr with 124.1 on 2026-04-22T02:46:44Z · by 613b58b7
changed status to closed on 2026-06-21T16:45:31Z · by 66ddd677
Closing as superceded by 126
cmds
checkout latest patchset:
ssh pr.pico.sh print 124 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print 124.[rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 124
set PR to open (enables RSS notifications):
ssh pr.pico.sh pr open 124
set PR to draft (stops RSS notifications):
ssh pr.pico.sh pr draft 124

Patchset 124.1 on 2026-04-22T02:46:44Z · commit 8ed3aa1

listing real name of tasks
juan 2026-04-21T03:21:16Z
construction of db for management of decrypted names of tasks
juan 2026-04-21T05:43:09Z
fix UTF8 chracteres
juan 2026-04-21T21:13:24Z
filter by status and coloring types of status
juan 2026-04-21T21:18:53Z
update help
juan 2026-04-21T21:21:36Z
list areas names
juan 2026-04-21T21:44:53Z
adjust table tasks to truncate name and list area
juan 2026-04-21T21:56:40Z
partial implementation of listing tasks by areas
juan 2026-04-21T22:05:20Z
final implementation of listing tasks by areas with UTF-8 chracteres
juan 2026-04-21T22:10:20Z
sort on task list to show first do now
juan 2026-04-21T22:33:29Z
update with 8 char of id and db.go
juan 2026-04-21T23:27:54Z
partial implementation of TUI menu on task update
juan 2026-04-21T23:35:35Z
task name correcion on TUI menu of Update task
juan 2026-04-21T23:38:19Z
TUI menu for update task with others flags
juan 2026-04-21T23:43:02Z
helper for TUI update task
juan 2026-04-21T23:49:56Z
search by first 8 char of note id for editing it
juan 2026-04-22T00:00:17Z
partial implementation on note TUI menu for update
juan 2026-04-22T00:05:46Z
TUI menu notebook just with tags
juan 2026-04-22T00:20:55Z
Note update now let you insert only the first 8 char of notebook id in update
juan 2026-04-22T00:25:53Z
implementation of (lune note notebook-list) for listing all notebooks and its ID
juan 2026-04-22T01:10:51Z
partial implementation of lune note show-content ID
juan 2026-04-22T02:01:11Z
convert \n in new line and \ in space for lune note show-content ID
juan 2026-04-22T02:18:42Z
+1 -0 cmd/note/note.go #
......@@ -17,6 +17,7 @@ var Cmd = &cobra.Command{
1717 func init() {
1818 Cmd.AddCommand(AddCmd)
1919 Cmd.AddCommand(ListCmd)
20+ Cmd.AddCommand(NotebookListCmd)
2021 Cmd.AddCommand(ShowCmd)
2122 Cmd.AddCommand(UpdateCmd)
2223 Cmd.AddCommand(DeleteCmd)
+89 -0 cmd/note/notebook_list.go #
......@@ -0,0 +1,89 @@
1+// SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
2+//
3+// SPDX-License-Identifier: AGPL-3.0-or-later
4+
5+package note
6+
7+import (
8+ "fmt"
9+
10+ "git.secluded.site/go-lunatask"
11+ "git.secluded.site/lune/internal/client"
12+ "git.secluded.site/lune/internal/config"
13+ "git.secluded.site/lune/internal/db"
14+ "git.secluded.site/lune/internal/ui"
15+ "github.com/charmbracelet/lipgloss"
16+ "github.com/charmbracelet/lipgloss/table"
17+ "github.com/spf13/cobra"
18+)
19+
20+// NotebookListCmd lists notebooks extracted from notes.
21+var NotebookListCmd = &cobra.Command{
22+ Use: "notebook-list",
23+ Short: "List notebooks found in notes",
24+ Long: `List all notebooks identified in your notes with their names and IDs.`,
25+ RunE: runNotebookList,
26+}
27+
28+func runNotebookList(cmd *cobra.Command, _ []string) error {
29+ apiClient, err := client.New()
30+ if err != nil {
31+ return err
32+ }
33+
34+ notes, err := ui.Spin("Fetching notes…", func() ([]lunatask.Note, error) {
35+ return apiClient.ListNotes(cmd.Context(), nil)
36+ })
37+ if err != nil {
38+ return err
39+ }
40+
41+ cfg, _ := config.Load()
42+
43+ // Map to store unique notebooks: ID -> Name
44+ notebooks := make(map[string]string)
45+
46+ for _, n := range notes {
47+ if n.NotebookID != nil {
48+ id := *n.NotebookID
49+ if _, exists := notebooks[id]; !exists {
50+ // Determine name
51+ name := id
52+ if cfg != nil {
53+ if nb := cfg.NotebookByID(id); nb != nil {
54+ name = nb.Name
55+ } else if cfg.Experimental.LocalDB {
56+ if dbName, _ := db.EnrichTask(id); dbName != "" {
57+ name = dbName
58+ }
59+ }
60+ }
61+ notebooks[id] = name
62+ }
63+ }
64+ }
65+
66+ if len(notebooks) == 0 {
67+ fmt.Fprintln(cmd.OutOrStdout(), "No notebooks found")
68+ return nil
69+ }
70+
71+ rows := make([][]string, 0)
72+ for id, name := range notebooks {
73+ rows = append(rows, []string{id[:8], name})
74+ }
75+
76+ tbl := table.New().
77+ Headers("ID", "NAME").
78+ Rows(rows...).
79+ StyleFunc(func(row, col int) lipgloss.Style {
80+ if row == table.HeaderRow {
81+ return ui.TableHeaderStyle()
82+ }
83+ return lipgloss.NewStyle()
84+ }).
85+ Border(ui.TableBorder())
86+
87+ fmt.Fprintln(cmd.OutOrStdout(), tbl.Render())
88+ return nil
89+}
Back to top