Git Product home page Git Product logo

arst's Introduction

arst, at least until I think of a real name

I was looking at devutils and thinking it would be nice if

  1. I could use it from the command line
  2. It worked on Linux
  3. It was open source

So, here we go. To be clear, I don't actually care about a lot of the features it includes, and I have several others that aren't included in it, but the idea of a simple tool for conversions, generations, and formatting is appealing.

Yes, there are tools for all these things, but having a consistent syntax and one tool seems convenient.

Things I probably want

  • JSON pretty print
  • JSON -> YAML -> JSON
  • Line sort & dedupe
  • Number base conversions
  • LEB128 conversions
  • UUID generation
  • Hex -> ASCII -> Hex
  • Bytes in almost any format to:
    • Base64 string
    • JS Array of numbers
    • ASCII
    • Hex string
  • Unix time (seconds or millis) and ISO 8601 into:
    • Relative time
    • Human readable time (wtf does this mean? Is there a standard for it?)
    • ISO 8601
    • Local time
  • MD5, SHA1, SHA256, SHA512
  • JWT decode
  • URL encode/decode
  • X.509 certificate parsing
  • Escape/unescape JSON
  • Cron expression parsing

Design goals & constraints

  • Single, small binary
  • Cross platform (eventually, but focus on Linux first)
  • Rust
  • Intuitive (to me) syntax
  • Man page
  • Shell completions
  • Tolerant of input
  • Fast
  • Integrate w/ clipboard (?)
    • Option to copy output to clipboard automatically
    • Try to read from the clipboard if no input is provided

Syntax examples

$ arst --from unix 1610000000
Unix timestamp: 1610000000
ISO 8601: 2021-01-07T20:53:20Z
Relative time: 1 week ago
Human readable time: Thursday, January 7, 2021 8:53:20 PM PST
$ arst --to iso8601 1610000000
2021-01-07T20:53:20Z

# or, if you really like typing extra...
# 
$ arst --from unix --to iso8601 1610000000
2021-01-07T20:53:20Z
$ arst --to array 0x01 0x02 0x03
[0x01, 0x02, 0x03]

$ arst --to array fffe01ab
[0xff, 0xfe, 0x01, 0xab]

$ arst --to array ff fe 01 ab
[0xff, 0xfe, 0x01, 0xab]

$ arst --to array ff;fe;01;ab
[0xff, 0xfe, 0x01, 0xab]

$ arst --to array ff:fe:01:ab
[0xff, 0xfe, 0x01, 0xab]

arst's People

Contributors

anson-vandoren avatar

Watchers

 avatar  avatar

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.