[GH-ISSUE #80] Command line parameters #63

Closed
opened 2026-02-28 14:25:02 +03:00 by kerem · 7 comments
Owner

Originally created by @Willyarma on GitHub (Sep 6, 2024).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/80

I had written a node.js wrapper for librespot-java, it was capable of spawning multiple instances of librespot-java.
I was using the command line options --deviceName and --player.mixerSearchKeywords so that I could map each instance to a different audio devcie and name it of course.
I didnt have any trouble with having a single config file for all instances.

Would it possible to add this to the go version? Would it work?

Originally created by @Willyarma on GitHub (Sep 6, 2024). Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/80 I had written a node.js wrapper for librespot-java, it was capable of spawning multiple instances of librespot-java. I was using the command line options --deviceName and --player.mixerSearchKeywords so that I could map each instance to a different audio devcie and name it of course. I didnt have any trouble with having a single config file for all instances. Would it possible to add this to the go version? Would it work?
kerem 2026-02-28 14:25:02 +03:00
Author
Owner

@Willyarma commented on GitHub (Sep 11, 2024):

I'm just testing out this version now.
I noticed that it dosent report available audio devices, can this be added too? Perhaps as part of the status get request?

<!-- gh-comment-id:2343022545 --> @Willyarma commented on GitHub (Sep 11, 2024): I'm just testing out this version now. I noticed that it dosent report available audio devices, can this be added too? Perhaps as part of the status get request?
Author
Owner

@devgianlu commented on GitHub (Sep 23, 2024):

@Willyarma If you are willing to have multiple configuration files you can use -config_path and -credentials_path to specify the position of those two.

<!-- gh-comment-id:2367836390 --> @devgianlu commented on GitHub (Sep 23, 2024): @Willyarma If you are willing to have multiple configuration files you can use `-config_path` and `-credentials_path` to specify the position of those two.
Author
Owner

@Willyarma commented on GitHub (Sep 23, 2024):

Thanks, I'll try it out!
Overriding parameters from the command line would be nicer and avoid messy multiple config files but this ought to work for what I want to do.

Is this new or did I completely miss it?

<!-- gh-comment-id:2367988713 --> @Willyarma commented on GitHub (Sep 23, 2024): Thanks, I'll try it out! Overriding parameters from the command line would be nicer and avoid messy multiple config files but this ought to work for what I want to do. Is this new or did I completely miss it?
Author
Owner

@Willyarma commented on GitHub (Sep 23, 2024):

I've been struggling to get it working, not sure where the problem lies, whether its node.js, go or me.
When I use the child_process.spawn function from node.js, go-librespot completley ignores the command line arguments unless I set the shell flag option to true so that it runs inside a shell instead of directly.
This worked fine on the java version.

Appears to work with 2 players going at once with different names, API ports and audio devices.

<!-- gh-comment-id:2368172345 --> @Willyarma commented on GitHub (Sep 23, 2024): I've been struggling to get it working, not sure where the problem lies, whether its node.js, go or me. When I use the child_process.spawn function from node.js, go-librespot completley ignores the command line arguments unless I set the shell flag option to true so that it runs inside a shell instead of directly. This worked fine on the java version. Appears to work with 2 players going at once with different names, API ports and audio devices.
Author
Owner

@devgianlu commented on GitHub (Sep 23, 2024):

When I use the child_process.spawn function from node.js, go-librepot completley ignores the command line arguments unless I set the shell flag option to true so that it runs inside a shell instead of directly.

@Willyarma You may need to pass each parameter as different element of the command array:

spawn('go-librespot', ['-config_path', '/path/to/config.yml', '-credentials_path', '/path/to/creds.json']);

Unlucikly making each of the configurable options available as a command line flag would require a lot of redundant code, so I am a bit esitant to do it.

<!-- gh-comment-id:2368324966 --> @devgianlu commented on GitHub (Sep 23, 2024): > When I use the child_process.spawn function from node.js, go-librepot completley ignores the command line arguments unless I set the shell flag option to true so that it runs inside a shell instead of directly. @Willyarma You may need to pass each parameter as different element of the command array: ```js spawn('go-librespot', ['-config_path', '/path/to/config.yml', '-credentials_path', '/path/to/creds.json']); ``` Unlucikly making each of the configurable options available as a command line flag would require a lot of redundant code, so I am a bit esitant to do it.
Author
Owner

@Willyarma commented on GitHub (Sep 23, 2024):

That worked! :) Thanks! Can't believe it was that simple.
It's working with multiple config files so am happy with that.

Unless anybody else wants this feature, I guess it can be closed.

<!-- gh-comment-id:2368362997 --> @Willyarma commented on GitHub (Sep 23, 2024): That worked! :) Thanks! Can't believe it was that simple. It's working with multiple config files so am happy with that. Unless anybody else wants this feature, I guess it can be closed.
Author
Owner

@devgianlu commented on GitHub (Sep 23, 2024):

Closing for now!

<!-- gh-comment-id:2368410630 --> @devgianlu commented on GitHub (Sep 23, 2024): Closing for now!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/go-librespot#63
No description provided.