Skip to content

Conversation

@prkrtg
Copy link
Collaborator

@prkrtg prkrtg commented Nov 10, 2025

Initial CLI ready to use with Libby. Currently discovery isn't complete so in your daemon's address book you have to add "cli": "tcp://127.0.0.1:56001". I'll have a quick how to use guide once this all looks good

Example usage:

% python libby_cli.py req -p peer-B -k ping.txt --addr peer-B=tcp://127.0.0.1:5556
{
  "status": "delivered",
  "transid": "cc8d3f6991834ab3ac3ad2113e559157",
  "resp": {
    "ok": true,
    "data": {
      "data": "pong"
    }
  }
}

% python libby_cli.py req -p peer-B -k perf.echo -d '{"t0": 123.45}' --addr peer-B=tcp://127.0.0.1:5556 
{
  "status": "delivered",
  "transid": "f375ba73172c477ab0f53cd13858a1be",
  "resp": {
    "ok": true,
    "t0": 123.45,
    "t1": 1763363901.555867
  }
}

% python libby_cli.py sub alerts.status --addr peer-A=tcp://127.0.0.1:5555
[libby sub] up: id=cli bind=tcp://127.0.0.1:56001 topics=['alerts.status']
{
  "source": "peer-A",
  "topic": "alerts.status",
  "payload": {
    "source": "peer-A",
    "ok": true
  }
}

@scizen9
Copy link

scizen9 commented Nov 10, 2025

Looks like a good start. When I succeed in spinning up my first daemon, I will try it out.

@prkrtg prkrtg changed the title WIP: Show & Modify cli commands Libby CLI - ability to send keys and subscribe Nov 17, 2025
@prkrtg prkrtg marked this pull request as ready for review November 17, 2025 07:47
exclude = ["peers*", "package*"]

[project.scripts]
lshow = "libby.cli.lshow:main"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would that be lshow = "libby.cli.libby_cli:main" instead?

@scizen9
Copy link

scizen9 commented Nov 18, 2025

The command line is extremely complex. Ideally, one should be able to do:

show -s peer-B ping

or as another example with atcpress:

show -s hsfei atcpress_pressure
or
show -s atcpress pressure
to show the ATC cryostat pressure from the Inficon.

@prkrtg
Copy link
Collaborator Author

prkrtg commented Nov 20, 2025

The command line is extremely complex. Ideally, one should be able to do:

show -s peer-B ping

or as another example with atcpress:

show -s hsfei atcpress_pressure or show -s atcpress pressure to show the ATC cryostat pressure from the Inficon.

@scizen9
The flags can be removed so it could be something like
libby_cli.py req peerB ping

Eventually will add the feature to allow just
libbycli req peerB ping (or lshow hsfei atcpress_pressure)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants