Giter Club home page Giter Club logo

algia's Introduction

algia

nostr CLI client written in Go

Usage

NAME:
   algia - A cli application for nostr

USAGE:
   algia [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 [note|npub|nevent]
   version       show version
   help, h       Shows a list of commands or help for one command

GLOBAL OPTIONS:
   -a value        profile name
   --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

Configuration

Minimal configuration. Need to be at ~/.config/algia/config.json

{
  "relays": {
    "wss://relay-jp.nostr.wirednet.jp": {
      "read": true,
      "write": true,
      "search": false
    }
  },
  "privatekey": "nsecXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}

If you want to zap via Nostr Wallet Connect, please add nwc-pub and nwc-uri which are provided from https://nwc.getalby.com/apps/new?c=Algia

{
  "relays": {
   ...
  },
  "privatekey": "nsecXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "nwc-uri": "nostr+walletconnect://xxxxx",
  "nwc-pub": "xxxxxxxxxxxxxxxxxxxxxxx"
}

TODO

  • like
  • repost
  • zap
  • upload images

FAQ

Do you use proxy? then set environment variable HTTP_PROXY like below.

HTTP_PROXY=http://myproxy.example.com:8080

License

MIT

Author

Yasuhiro Matsumoto (a.k.a. mattn)

algia's People

Contributors

bndw avatar dag7dev avatar fiatjaf avatar jundow avatar mattn avatar ohac avatar shinoharata avatar yuhr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

algia's Issues

Initializing ev.Tags with nostr.Tags{} in case of tag is empty when publishing an event at doPost function

In doPost function, ev.Tags may need to be initialized with nostr.Tags{ }.

If no tags were added to the event object, the ev.Tags was nil.
I observed many of relays reject event objects when it was nil.

To resolve this, initializing ev.Tags with nostr.Tags{ } (an empty array of array) worked for me.

I would suggest to add this line,

ev.Tags = nostr.Tags{ }

before the line 260 in "timeline.go."

/*Line 260: func doPost in timeline.go*/
	for i, u := range cCtx.StringSlice("u") {
		ev.Content = fmt.Sprintf("#[%d] ", i) + ev.Content
		if pp := sdk.InputToProfile(u); pp == nil {
			return fmt.Errorf("failed to parse pubkey from '%s'", u)
		} else {
			u = pp.PublicKey
		}
		ev.Tags = ev.Tags.AppendUnique(nostr.Tag{"p", u})
	}
/*the function goes on...*/

If ev.Tags is nil, the corresponding part in the parsed JSON will be nil.
If initialized with nostr.Tags{}, it will be "[]".

add example command

I am trying to use your client, however it says "string not all lowercase or all uppercase".

I am typing "algia timeline".

Can you provide some simple example in the readme?

Thanks!

cannot use path@version syntax in GOPATH mode?

$ go version
go version go1.15.15 linux/arm64
$ uname -a
Linux 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux
$ go install github.com/mattn/algia@latest
package github.com/mattn/algia@latest: cannot use path@version syntax in GOPATH mode

Config dir on macOS

Minimal configuration. Need to be at ~/.config/algia/config.json

On macOS this actually defaults to $HOME/Library/Application Support/algia/config.json as per os.UserConfigDir, which is not ideal.

I think the most straightforward way to get macOS clients to use the ~/.config dir is to replace os.UserConfigDir with a 3rd party package like github.com/mitchellh/go-homedir. If this is an acceptable solution let me know - I'd be happy to submit a pull request.

invalid separator index 66

Cheers,

I've cloned the repo, run make, copied the config to the proper location and updated it for use in my project.

However, every algia command returns invalid separator index 66

Any ideas?

Config control command

We can make a command set that helps you create, change, and manage config file, as well as set a password and encrypt the config file with the password. If a user has a password, we can ask for the password, otherwise we use config normally.

If you think it's a good idea, please assign this issue to me to work on this feature.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.