From 8f8d2ad700030329f16f26abcff27c38def77d36 Mon Sep 17 00:00:00 2001 From: mleku Date: Thu, 11 Jan 2024 15:17:23 +0000 Subject: [PATCH] Rename project from 'algia' to 'postr' and simplify available commands The code project has been renamed from 'algia' to 'postr', which involved updating numerous file paths and hardcoded names throughout the project. The list of available commands in the CLI application has also been significantly simplified, with several commands being commented out. --- cmd/{algia => postr}/.gitignore | 0 cmd/{algia => postr}/LICENSE | 0 cmd/{algia => postr}/Makefile | 0 cmd/{algia => postr}/README.md | 24 ++--- cmd/{algia => postr}/config.go | 2 +- cmd/{algia => postr}/extract.go | 0 cmd/{algia => postr}/keys.go | 0 cmd/{algia => postr}/main.go | 180 +++++++++++++++---------------- cmd/{algia => postr}/profile.go | 0 cmd/{algia => postr}/timeline.go | 0 cmd/{algia => postr}/zap.go | 0 11 files changed, 97 insertions(+), 109 deletions(-) rename cmd/{algia => postr}/.gitignore (100%) rename cmd/{algia => postr}/LICENSE (100%) rename cmd/{algia => postr}/Makefile (100%) rename cmd/{algia => postr}/README.md (74%) rename cmd/{algia => postr}/config.go (99%) rename cmd/{algia => postr}/extract.go (100%) rename cmd/{algia => postr}/keys.go (100%) rename cmd/{algia => postr}/main.go (66%) rename cmd/{algia => postr}/profile.go (100%) rename cmd/{algia => postr}/timeline.go (100%) rename cmd/{algia => postr}/zap.go (100%) diff --git a/cmd/algia/.gitignore b/cmd/postr/.gitignore similarity index 100% rename from cmd/algia/.gitignore rename to cmd/postr/.gitignore diff --git a/cmd/algia/LICENSE b/cmd/postr/LICENSE similarity index 100% rename from cmd/algia/LICENSE rename to cmd/postr/LICENSE diff --git a/cmd/algia/Makefile b/cmd/postr/Makefile similarity index 100% rename from cmd/algia/Makefile rename to cmd/postr/Makefile diff --git a/cmd/algia/README.md b/cmd/postr/README.md similarity index 74% rename from cmd/algia/README.md rename to cmd/postr/README.md index 24b55bd5..3c3578ae 100644 --- a/cmd/algia/README.md +++ b/cmd/postr/README.md @@ -1,42 +1,34 @@ -# algia +# postr nostr CLI client written in Go +forked from [algia](github.com/mattn/algia) + ## Usage ``` NAME: - algia - A cli application for nostr + postr - A cli application for nostr USAGE: - algia [global options] command [command options] [arguments...] + postr [global options] command [command options] DESCRIPTION: A cli application for nostr COMMANDS: timeline, tl show timeline - stream show stream post, n post new note reply, r reply to the note repost, b repost the note - unrepost, B unrepost the note like, l like the note - unlike, L unlike the note - delete, d delete the note search, s search notes - dm-list show DM list - dm-timeline show DM timeline - dm-post post new note profile show profile - powa post ぽわ〜 - puru post ぷる - zap zap note1 version show version help, h Shows a list of commands or help for one command GLOBAL OPTIONS: - -a value profile name + -a value profile appName --relays value relays -V verbose (default: false) --help, -h show help @@ -44,11 +36,9 @@ GLOBAL OPTIONS: ## Installation -Download binary from Release page. - Or install with go install command. ``` -go install github.com/mattn/algia@latest +go install github.com/Hubmakerlabs/replicatr/cmd/postr@latest ``` ## Configuration diff --git a/cmd/algia/config.go b/cmd/postr/config.go similarity index 99% rename from cmd/algia/config.go rename to cmd/postr/config.go index 71669442..74eb2211 100644 --- a/cmd/algia/config.go +++ b/cmd/postr/config.go @@ -239,7 +239,7 @@ func (cfg *C) save(profile string) (e error) { if log.Fail(e) { return e } - dir = filepath.Join(dir, "algia") + dir = filepath.Join(dir, appName) var fp string if profile == "" { diff --git a/cmd/algia/extract.go b/cmd/postr/extract.go similarity index 100% rename from cmd/algia/extract.go rename to cmd/postr/extract.go diff --git a/cmd/algia/keys.go b/cmd/postr/keys.go similarity index 100% rename from cmd/algia/keys.go rename to cmd/postr/keys.go diff --git a/cmd/algia/main.go b/cmd/postr/main.go similarity index 66% rename from cmd/algia/main.go rename to cmd/postr/main.go index 110e49c1..2f21b90f 100644 --- a/cmd/algia/main.go +++ b/cmd/postr/main.go @@ -8,14 +8,13 @@ import ( "runtime" "strings" - "github.com/Hubmakerlabs/replicatr/pkg/go-nostr/event" log2 "github.com/Hubmakerlabs/replicatr/pkg/log" "github.com/urfave/cli/v2" ) var log = log2.GetStd() -const appName = "algia" +const appName = "postr" const version = "0.0.54" @@ -107,18 +106,18 @@ func main() { }, Action: doTimeline, }, - { - Name: "stream", - Usage: "show stream", - Flags: []cli.Flag{ - &cli.StringFlag{Name: "author"}, - &cli.IntSliceFlag{Name: "kind", Value: cli.NewIntSlice(event.KindTextNote)}, - &cli.BoolFlag{Name: "follow"}, - &cli.StringFlag{Name: "pattern"}, - &cli.StringFlag{Name: "reply"}, - }, - Action: doStream, - }, + // { + // Name: "stream", + // Usage: "show stream", + // Flags: []cli.Flag{ + // &cli.StringFlag{Name: "author"}, + // &cli.IntSliceFlag{Name: "kind", Value: cli.NewIntSlice(event.KindTextNote)}, + // &cli.BoolFlag{Name: "follow"}, + // &cli.StringFlag{Name: "pattern"}, + // &cli.StringFlag{Name: "reply"}, + // }, + // Action: doStream, + // }, { Name: "post", Aliases: []string{"n"}, @@ -163,17 +162,17 @@ func main() { HelpName: "repost", Action: doRepost, }, - { - Name: "unrepost", - Aliases: []string{"B"}, - Flags: []cli.Flag{ - &cli.StringFlag{Name: "id", Required: true}, - }, - Usage: "unrepost the note", - UsageText: appName + " unrepost --id [id]", - HelpName: "unrepost", - Action: doUnrepost, - }, + // { + // Name: "unrepost", + // Aliases: []string{"B"}, + // Flags: []cli.Flag{ + // &cli.StringFlag{Name: "id", Required: true}, + // }, + // Usage: "unrepost the note", + // UsageText: appName + " unrepost --id [id]", + // HelpName: "unrepost", + // Action: doUnrepost, + // }, { Name: "like", Aliases: []string{"l"}, @@ -187,28 +186,28 @@ func main() { HelpName: "like", Action: doLike, }, - { - Name: "unlike", - Aliases: []string{"L"}, - Flags: []cli.Flag{ - &cli.StringFlag{Name: "id", Required: true}, - }, - Usage: "unlike the note", - UsageText: appName + " unlike --id [id]", - HelpName: "unlike", - Action: doUnlike, - }, - { - Name: "delete", - Aliases: []string{"d"}, - Flags: []cli.Flag{ - &cli.StringFlag{Name: "id", Required: true}, - }, - Usage: "delete the note", - UsageText: appName + " delete --id [id]", - HelpName: "delete", - Action: doDelete, - }, + // { + // Name: "unlike", + // Aliases: []string{"L"}, + // Flags: []cli.Flag{ + // &cli.StringFlag{Name: "id", Required: true}, + // }, + // Usage: "unlike the note", + // UsageText: appName + " unlike --id [id]", + // HelpName: "unlike", + // Action: doUnlike, + // }, + // { + // Name: "delete", + // Aliases: []string{"d"}, + // Flags: []cli.Flag{ + // &cli.StringFlag{Name: "id", Required: true}, + // }, + // Usage: "delete the note", + // UsageText: appName + " delete --id [id]", + // HelpName: "delete", + // Action: doDelete, + // }, { Name: "search", Aliases: []string{"s"}, @@ -222,37 +221,37 @@ func main() { HelpName: "search", Action: doSearch, }, - { - Name: "dm-list", - Usage: "show DM list", - Flags: []cli.Flag{ - &cli.BoolFlag{Name: "json", Usage: "output JSON"}, - }, - Action: doDMList, - }, - { - Name: "dm-timeline", - Usage: "show DM timeline", - Flags: []cli.Flag{ - &cli.StringFlag{Name: "u", Value: "", Usage: "DM user", Required: true}, - &cli.BoolFlag{Name: "json", Usage: "output JSON"}, - &cli.BoolFlag{Name: "extra", Usage: "extra JSON"}, - }, - Action: doDMTimeline, - }, - { - Name: "dm-post", - Flags: []cli.Flag{ - &cli.StringFlag{Name: "u", Value: "", Usage: "DM user", Required: true}, - &cli.BoolFlag{Name: "stdin"}, - &cli.StringFlag{Name: "sensitive"}, - }, - Usage: "post new note", - UsageText: appName + " post [note text]", - HelpName: "post", - ArgsUsage: "[note text]", - Action: doDMPost, - }, + // { + // Name: "dm-list", + // Usage: "show DM list", + // Flags: []cli.Flag{ + // &cli.BoolFlag{Name: "json", Usage: "output JSON"}, + // }, + // Action: doDMList, + // }, + // { + // Name: "dm-timeline", + // Usage: "show DM timeline", + // Flags: []cli.Flag{ + // &cli.StringFlag{Name: "u", Value: "", Usage: "DM user", Required: true}, + // &cli.BoolFlag{Name: "json", Usage: "output JSON"}, + // &cli.BoolFlag{Name: "extra", Usage: "extra JSON"}, + // }, + // Action: doDMTimeline, + // }, + // { + // Name: "dm-post", + // Flags: []cli.Flag{ + // &cli.StringFlag{Name: "u", Value: "", Usage: "DM user", Required: true}, + // &cli.BoolFlag{Name: "stdin"}, + // &cli.StringFlag{Name: "sensitive"}, + // }, + // Usage: "post new note", + // UsageText: appName + " post [note text]", + // HelpName: "post", + // ArgsUsage: "[note text]", + // Action: doDMPost, + // }, { Name: "profile", Flags: []cli.Flag{ @@ -264,17 +263,17 @@ func main() { HelpName: "profile", Action: doProfile, }, - { - Name: "zap", - Flags: []cli.Flag{ - &cli.Uint64Flag{Name: "amount", Usage: "amount for zap", Value: 1}, - &cli.StringFlag{Name: "comment", Usage: "comment for zap", Value: ""}, - }, - Usage: "zap [note|npub|nevent]", - UsageText: appName + " zap [note|npub|nevent]", - HelpName: "zap", - Action: doZap, - }, + // { + // Name: "zap", + // Flags: []cli.Flag{ + // &cli.Uint64Flag{Name: "amount", Usage: "amount for zap", Value: 1}, + // &cli.StringFlag{Name: "comment", Usage: "comment for zap", Value: ""}, + // }, + // Usage: "zap [note|npub|nevent]", + // UsageText: appName + " zap [note|npub|nevent]", + // HelpName: "zap", + // Action: doZap, + // }, { Name: "version", Usage: "show version", @@ -313,8 +312,7 @@ func main() { return nil }, } - - if e := app.Run(os.Args); log.Fail(e) { + if e := app.Run(os.Args); log.E.Chk(e) { os.Exit(1) } } diff --git a/cmd/algia/profile.go b/cmd/postr/profile.go similarity index 100% rename from cmd/algia/profile.go rename to cmd/postr/profile.go diff --git a/cmd/algia/timeline.go b/cmd/postr/timeline.go similarity index 100% rename from cmd/algia/timeline.go rename to cmd/postr/timeline.go diff --git a/cmd/algia/zap.go b/cmd/postr/zap.go similarity index 100% rename from cmd/algia/zap.go rename to cmd/postr/zap.go