Skip to content

Commit

Permalink
Rename project from 'algia' to 'postr' and simplify available commands
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mleku committed Jan 11, 2024
1 parent 5efa5da commit 8f8d2ad
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 109 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 7 additions & 17 deletions cmd/algia/README.md → cmd/postr/README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,44 @@
# 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
```

## 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
Expand Down
2 changes: 1 addition & 1 deletion cmd/algia/config.go → cmd/postr/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand Down
File renamed without changes.
File renamed without changes.
180 changes: 89 additions & 91 deletions cmd/algia/main.go → cmd/postr/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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"},
Expand Down Expand Up @@ -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"},
Expand All @@ -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"},
Expand All @@ -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{
Expand All @@ -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",
Expand Down Expand Up @@ -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)
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8f8d2ad

Please sign in to comment.