npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@agnoc/cli

v0.17.2

Published

Agnoc command line

Downloads

39

Readme

@agnoc/cli

Agnoc command line tool.

Install

Using npm:

$ npm install -g @agnoc/cli

or using yarn:

$ yarn add -g @agnoc/cli

The tool is named agnoc:

$ agnoc --help

Commands

Wlan

This command configures the wifi connection of the robot to the given one.

$ agnoc wlan my-wifi my-password

Read

This command reads a binary pcap dump file generated with tcpdump and prints packets to stdout.

$ agnoc read dump.pcap
[ID: 7a479a0fbb978c12] [Flow: 1] [UID: 1] [DID: 2] [OP: DEVICE_GETTIME_RSP] {"result":0,"body":{"deviceTime":1606129555,"deviceTimezone":3600}}

It is possible to output to json format to be able to parse and manipulate it:

$ agnoc read --json dump.pcap

[
  {
    "ctype": 2,
    "flow": 1,
    "deviceId": 1,
    "userId": 2,
    "sequence": "7a479a0fbb978c12",
    "payload": {
      "opcode": {
        "code": "0x1012",
        "name": "DEVICE_GETTIME_RSP"
      },
      "object": {
        "result": 0,
        "body": {
          "deviceTime": 1606129555,
          "deviceTimezone": 3600
        }
      }
    }
  }
]

It is possible to use stdin as input, for example:

$ cat dump.pcap | agnoc read -

[ID: 7a479a0fbb978c12] [Flow: 1] [UID: 2] [DID: 1] [OP: DEVICE_GETTIME_RSP] {"result":0,"body":{"deviceTime":1606129555,"deviceTimezone":3600}}

Decode

This command reads a binary tcp flow file generated with WireShark or TShark and prints packets to stdout.

$ agnoc decode example.bin

[ID: 7a479a0fbb978c12] [Flow: 1] [UID: 1] [DID: 2] [OP: DEVICE_GETTIME_RSP] {"result":0,"body":{"deviceTime":1606129555,"deviceTimezone":3600}}

It is possible to output to json format to be able to parse and manipulate it:

$ agnoc decode --json example.bin

[
  {
    "ctype": 2,
    "flow": 1,
    "deviceId": 1,
    "userId": 2,
    "sequence": "7a479a0fbb978c12",
    "payload": {
      "opcode": {
        "code": "0x1012",
        "name": "DEVICE_GETTIME_RSP"
      },
      "object": {
        "result": 0,
        "body": {
          "deviceTime": 1606129555,
          "deviceTimezone": 3600
        }
      }
    }
  }
]

It is possible to use stdin as input, for example:

$ echo "2500000002010100000002000000128c97bb0f9a477a121008001a090893afeefd0510901c" | xxd -r -p | agnoc decode -

[ID: 7a479a0fbb978c12] [Flow: 1] [UID: 2] [DID: 1] [OP: DEVICE_GETTIME_RSP] {"result":0,"body":{"deviceTime":1606129555,"deviceTimezone":3600}}

Encode

As a reverse operation to decode, encode command allows to build a binary dump using json as input:

$ agnoc encode example.json | xxd -r -p

2500000002010200000001000000128c97bb0f9a477a121008001a090893
afeefd0510901c

Also, it can be used with stdin:

$ echo '[{"ctype":2,"flow":1,"deviceId":1,"userId":2,"sequence":"7a479a0fbb978c12","opcode":{"code":"0x1012","name":"DEVICE_GETTIME_RSP"},"payload":{"result":0,"body":{"deviceTime":1606129555,"deviceTimezone":3600}}}]' | agnoc encode - | xxd -p

2500000002010200000001000000128c97bb0f9a477a121008001a090893
afeefd0510901c