From fc499af504e044ffaf3376438be851cc88909170 Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Sun, 19 Jul 2026 20:28:05 +0200 Subject: [PATCH] Rename project to docspell-cli --- README.md | 16 ++++++++-------- ...ort-example.json => docspell-cli-example.json | 0 go.mod | 2 +- main.go | 9 +-------- mount.go | 10 +++++----- 5 files changed, 15 insertions(+), 22 deletions(-) rename docspell-import-example.json => docspell-cli-example.json (100%) diff --git a/README.md b/README.md index 6313f62..b5557e3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Docspell Import +# Docspell CLI Ein Tool zum Aufräumen des Docspell-Importverzeichnisses und zum automatischen Archivieren von bestätigten Dokumenten. @@ -16,23 +16,23 @@ Das Programm: - [Docspell Command Line Client (dsc)](https://docspell.org/docs/tools/cli/) - `jq` Kommandozeilentool -- Eine Konfigurationsdatei unter `~/docspell-import.json` +- Eine Konfigurationsdatei unter `~/docspell-cli.json` ## Konfiguration -Erstellen Sie eine `docspell-import.json` Datei in Ihrem Home-Verzeichnis: [Beispiel-Konfiguration](./docspell-import-example.json) +Erstellen Sie eine `docspell-cli.json` Datei in Ihrem Home-Verzeichnis: [Beispiel-Konfiguration](./docspell-cli-example.json) ## Read-only FUSE mount The `mount` subcommand exposes a Docspell collection as a read-only filesystem. -It uses the same `~/docspell-import.json` configuration and password command as the import command. +It uses the same `~/docspell-cli.json` configuration and password command as the import command. Set `mountPath` in the config to define the default mount point and `mountQuery` to define the default Docspell query. ```bash mkdir -p ~/mnt/docspell -docspell-import mount ~/mnt/docspell # starts in the background +docspell-cli mount ~/mnt/docspell # starts in the background # or, with mountPath configured: -docspell-import mount +docspell-cli mount # unmount when done fusermount -u ~/mnt/docspell ``` @@ -54,8 +54,8 @@ The mount is read-only. File contents are downloaded lazily from `/api/v1/sec/at Helper commands: ```bash -docspell-import get-local-path -docspell-import get-url +docspell-cli get-local-path +docspell-cli get-url ``` `get-local-path` starts the configured mount in the background if it is not mounted yet. diff --git a/docspell-import-example.json b/docspell-cli-example.json similarity index 100% rename from docspell-import-example.json rename to docspell-cli-example.json diff --git a/go.mod b/go.mod index c79664c..ca5e00a 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module git.javil.eu/jacob1123/docspell-import +module git.javil.eu/jacob1123/docspell-cli go 1.23.4 diff --git a/main.go b/main.go index d56d9b3..c934851 100644 --- a/main.go +++ b/main.go @@ -62,13 +62,6 @@ func main() { return } - fmt.Println("##################### START #####################") - fmt.Println(" Docspell Import - v0.3") - fmt.Println(" by jacob1123") - fmt.Println(" (based on work by totti4ever) ") - fmt.Println("#################################################") - fmt.Println() - runImportCommand(cfg, password, os.Args[1:]) } @@ -79,7 +72,7 @@ func loadConfigAndPassword() (config, string) { os.Exit(1) } - configFile := filepath.Join(homeDir, "docspell-import.json") + configFile := filepath.Join(homeDir, "docspell-cli.json") configData, err := os.ReadFile(configFile) if err != nil { fmt.Println("Error reading config file:", err) diff --git a/mount.go b/mount.go index c951b7c..32873f8 100644 --- a/mount.go +++ b/mount.go @@ -53,7 +53,7 @@ func runMountCommand(args []string, cfg config, password string) error { if mountPoint == "" { return fmt.Errorf("mount point missing: pass one or set MountPath in config") } - if os.Getenv("DOCSPELL_IMPORT_MOUNT_FOREGROUND") != "1" { + if os.Getenv("DOCSPELL_CLI_MOUNT_FOREGROUND") != "1" { return startMountInBackground(args, mountPoint, false) } if err := os.MkdirAll(mountPoint, 0755); err != nil { @@ -73,7 +73,7 @@ func runMountCommand(args []string, cfg config, password string) error { conn, err := fuse.Mount( mountPoint, fuse.FSName("docspell"), - fuse.Subtype("docspell-import"), + fuse.Subtype("docspell-cli"), fuse.ReadOnly(), ) if err != nil { @@ -94,7 +94,7 @@ func startMountInBackground(args []string, mountPoint string, quiet bool) error return nil } cmd := exec.Command(os.Args[0], append([]string{"mount"}, args...)...) - cmd.Env = append(os.Environ(), "DOCSPELL_IMPORT_MOUNT_FOREGROUND=1") + cmd.Env = append(os.Environ(), "DOCSPELL_CLI_MOUNT_FOREGROUND=1") logFile, err := mountLogFile() if err != nil { return err @@ -226,9 +226,9 @@ func cleanMountPath(path string) string { func mountLogPath() string { cacheDir, err := os.UserCacheDir() if err != nil || cacheDir == "" { - return filepath.Join(os.TempDir(), "docspell-import-mount.log") + return filepath.Join(os.TempDir(), "docspell-cli-mount.log") } - return filepath.Join(cacheDir, "docspell-import", "mount.log") + return filepath.Join(cacheDir, "docspell-cli", "mount.log") } func mountLogFile() (*os.File, error) {