dev-kit 0.1.1

A collection of utilities and tools for development, including URI, JSON, and Time tools.
dev-kit-0.1.1 is not a library.
Visit the last successful build: dev-kit-0.1.11

Dev Kit

A collection of utilities and tools for development.

中文版

Features

1. URI Tools

  • Decode: Decode URI components.
    $ dev-kit uri decode 'foo%20bar'
    foo bar
    

2. JSON Tools

All JSON tools support the following input types:

  • JSON String: Direct JSON string.
    $ dev-kit json beauty '{"a":1}'
    
  • File: Path to a JSON file.
    $ dev-kit json beauty data.json
    
  • URL: URL to a JSON resource.
    $ dev-kit json beauty https://api.example.com/data.json
    
  • Command: Shell command that outputs JSON.
    $ dev-kit json beauty 'cat data.json'
    
  • Unix Pipe: Input from stdin using -.
    $ cat data.json | dev-kit json beauty -
    

Commands:

  • Beauty: Format JSON strings or files. Supports alias format.
    $ dev-kit json beauty '{"a":1,"b":2}'
    {
      "a": 1,
      "b": 2
    }
    
  • Query: Extract content using JSONPath. Supports alias search.
    $ dev-kit json query -q '$.a' '{"a":1,"b":2}'
    1
    
  • Diff: Compare two JSON objects, supports comparison after JSONPath extraction, and can call external Diff tools (e.g., IDEA, VSCode, Zed).
    $ dev-kit json diff '{"a":1}' '{"a":2}' --diff-tool vscode
    

3. Time Tools

  • Now: Get the current time, supports specified timezones and formats.
    # Get current time (RFC3339)
    $ dev-kit time now
    2023-10-27T10:00:00+08:00
    
    # Get current millisecond timestamp
    $ dev-kit time now -f ts
    1698372000000
    
  • Parse: Parse time strings or timestamps.
    # Parse timestamp
    $ dev-kit time parse 1698372000000
    2023-10-27T10:00:00+08:00
    
    # Parse string and convert format
    $ dev-kit time parse "2023-10-27 10:00:00" -f ts
    1698372000000
    

Installation

cargo install --path .

Usage

dev-kit --help