A JSON terminal UI made in C++

Related tags

JSON json-tui
Overview

json-tui

Video

Features

  • Interactive: Use keyboard or mouse to scroll/expand objects.
  • Colors
  • Responsive: Adapt to the terminal dimensions. Very long text values are wrapped on several lines.
  • The output is displayed inline with the previous commands. Meaning you can still see the json after leaving json-tui.
  • (Vim users): Also support j/k for navigation.

Features for developers

  • simple: Only 300 line of C++ only. Depends on FTXUI.
  • No dependencies to install. Build simply using CMake.

Build:

mkdir build; cd build
cmake ..
make
sudo make install

Package

  • Snap package: sudo snap install json-tui. /!\ File access is confined to your home.
  • Deb package: Available in release page.
  • RPM package: Available in release page.
  • Arch linux package: Available as AUR package.
  • Binaries: Available in release page.

Authors:

  • Arthur Sonzogni
  • You? (PR are welcomed)

Similar projects:

Issues
  • Add arch linux package

    Add arch linux package

    Hi! A friend of mine shared me your tweet! That's a very nice tool!

    I just released an AUR package which relies on the .tar.gz in your Release page.

    Cheers!

    opened by Drarig29 5
  • Hitbox issue when not on top of the terminal window

    Hitbox issue when not on top of the terminal window

    Sorry if I'm being annoying, but I found a hitbox bug. The video explains it all.

    Basically, after I hit Ctrl+C and re-run the command, the hitboxes are shifted away from their real location.

    I really think it's because the command isn't run from the top of the window.

    Could someone test this in his terminal? Maybe the bug comes from my terminal emulator actually... I use https://github.com/kovidgoyal/kitty

    Here is the example file I used: https://pastebin.com/HxCY0NUm

    https://user-images.githubusercontent.com/9317502/148837469-363681d8-5379-42fb-a3ca-5758a5a61f3f.mp4

    opened by Drarig29 4
  • Resize to full terminal screen

    Resize to full terminal screen

    Thanks for such a great tool! I've been trying to give some feedback.


    Like how fx already does, we can resize the output to full terminal screen by passing a flag or by default.

    Current behavior: Screen Shot 2022-01-11 at 12 00 30

    Press q to exit. Wdyt?

    enhancement 
    opened by Dentrax 2
  • Cannot build with -fno-exceptions

    Cannot build with -fno-exceptions

    $ cmake -DCMAKE_CXX_FLAGS="-fno-exceptions" . $ make :

    [ 97%] Building CXX object CMakeFiles/json-tui.dir/src/main.cpp.o
    /Users/igor/dev/json-tui/src/main.cpp:324:3: error: cannot use 'try' with exceptions disabled
      try {
      ^
    1 error generated.
    make[2]: *** [CMakeFiles/json-tui.dir/src/main.cpp.o] Error 1
    make[1]: *** [CMakeFiles/json-tui.dir/all] Error 2
    make: *** [all] Error 2
    
    opened by hextriclosan 2
  • Integer overflow for big numbers in JSON

    Integer overflow for big numbers in JSON

    I was working with Unix timestamps, and the displayed number is incorrect. It looks like an integer overflow.

    {
      "big": 1640267163452
    }
    

    What is displayed:

    {
      "big": -410343620
    }
    
    opened by Drarig29 2
  • Can't build version 1.2.0 nor master

    Can't build version 1.2.0 nor master

    Steps to reproduce:

    git clone https://github.com/ArthurSonzogni/json-tui
    cd json-tui
    cmake -B build
    

    output:

    -- Populating ftxui
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /tmp/json-tui/build/_deps/ftxui-subbuild
    [ 12%] Creating directories for 'ftxui-populate'
    [ 25%] Performing download step (git clone) for 'ftxui-populate'
    Cloning into 'ftxui-src'...
    remote: Enumerating objects: 1518, done.        
    remote: Counting objects: 100% (1518/1518), done.        
    remote: Compressing objects: 100% (700/700), done.        
    remote: Total 1518 (delta 804), reused 1298 (delta 718), pack-reused 0        
    Receiving objects: 100% (1518/1518), 8.03 MiB | 7.47 MiB/s, done.
    Resolving deltas: 100% (804/804), done.
    fatal: reference is not a tree: 3dc215e6c0eecb1607d428af0295bcd98db74b8f
    CMake Error at ftxui-subbuild/ftxui-populate-prefix/tmp/ftxui-populate-gitclone.cmake:40 (message):
      Failed to checkout tag: '3dc215e6c0eecb1607d428af0295bcd98db74b8f'
    
    
    make[2]: *** [CMakeFiles/ftxui-populate.dir/build.make:98: ftxui-populate-prefix/src/ftxui-populate-stamp/ftxui-populate-download] Error 1
    make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/ftxui-populate.dir/all] Error 2
    make: *** [Makefile:91: all] Error 2
    CMake Error at /usr/share/cmake/Modules/FetchContent.cmake:1087 (message):
      Build step for ftxui failed: 2
    Call Stack (most recent call first):
      /usr/share/cmake/Modules/FetchContent.cmake:1216:EVAL:2 (__FetchContent_directPopulate)
      /usr/share/cmake/Modules/FetchContent.cmake:1216 (cmake_language)
      CMakeLists.txt:33 (FetchContent_Populate)
    
    
    -- Configuring incomplete, errors occurred!
    

    Version 1.1.0 builds fine, though.

    Thanks in advance :)

    opened by arrufat 0
  • Fix cursor reporting.

    Fix cursor reporting.

    Fix cursor reporting.

    The fix has been made on the FTXUI repository. This patch upgrade it to the latest version.

    This should fix: https://github.com/ArthurSonzogni/json-tui/issues/7

    opened by ArthurSonzogni 0
  • Feature request: ability to copy the JSON's value at the cursor's position

    Feature request: ability to copy the JSON's value at the cursor's position

    Move cursor to the target key that you want to copy value from.

    Screen Shot 2022-01-11 at 12 06 23

    Press smth like CMD+C to copy items's value as JSON format:

    [
     {
      ...
     },
     {
      ...
     }
    ]
    
    enhancement 
    opened by Dentrax 2
Releases(v1.3.0)
Owner
Arthur Sonzogni
Love C++. - Image rendering / analysis. - Ascii art / TUI. - Games
Arthur Sonzogni
A JSON terminal UI made in C++

json-tui Features Interactive: Use keyboard or mouse to scroll/expand objects. Colors Responsive: Adapt to the terminal dimensions. Very long text val

Arthur Sonzogni 183 Jun 26, 2022
json-cpp is a C++11 JSON serialization library.

JSON parser and generator for C++ Version 0.1 alpha json-cpp is a C++11 JSON serialization library. Example #include <json-cpp.hpp> struct Foo {

Anatoly Scheglov 4 Dec 31, 2019
This is a JSON C++ library. It can write and read JSON files with ease and speed.

Json Box JSON (JavaScript Object Notation) is a lightweight data-interchange format. Json Box is a C++ library used to read and write JSON with ease a

Anhero inc. 109 Apr 24, 2022
A convenience C++ wrapper library for JSON-Glib providing friendly syntactic sugar for parsing JSON

This library is a wrapper for the json-glib library that aims to provide the user with a trivial alternative API to the API provided by the base json-

Rob J Meijer 16 May 10, 2022
json-build is a zero-allocation JSON serializer compatible with C89

json-build is a zero-allocation JSON serializer compatible with C89. It is inspired by jsmn, a minimalistic JSON tokenizer.

Lucas Müller 24 Jun 20, 2022
Ultralightweight JSON parser in ANSI C

cJSON Ultralightweight JSON parser in ANSI C. Table of contents License Usage Welcome to cJSON Building Copying the source CMake Makefile Vcpkg Includ

Dave Gamble 7.6k Jun 23, 2022
JSON parser and generator for C/C++ with scanf/printf like interface. Targeting embedded systems.

JSON parser and emitter for C/C++ Features ISO C and ISO C++ compliant portable code Very small footprint No dependencies json_scanf() scans a string

Cesanta Software 608 Jun 14, 2022
C library for encoding, decoding and manipulating JSON data

Jansson README Jansson is a C library for encoding, decoding and manipulating JSON data. Its main features and design principles are: Simple and intui

Petri Lehtinen 2.6k Jun 21, 2022
JSON & BSON parser/writer

jbson is a library for building & iterating BSON data, and JSON documents in C++14. \tableofcontents Features # {#features} Header only. Boost license

Chris Manning 39 May 12, 2022
A very sane (header only) C++14 JSON library

JeayeSON - a very sane C++14 JSON library JeayeSON was designed out of frustration that there aren't many template-based approaches to handling JSON i

Jeaye Wilkerson 128 Jun 7, 2022
Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket

JSMN jsmn (pronounced like 'jasmine') is a minimalistic JSON parser in C. It can be easily integrated into resource-limited or embedded projects. You

Serge Zaitsev 3k Jun 28, 2022
JSON for Modern C++

Design goals Sponsors Integration CMake Package Managers Pkg-config Examples JSON as first-class data type Serialization / Deserialization STL-like ac

Niels Lohmann 30.7k Jun 29, 2022
A JSON parser in C++

JSON++ Introduction JSON++ is a light-weight JSON parser, writer and reader written in C++. JSON++ can also convert JSON documents into lossless XML d

Hong Jiang 481 May 26, 2022
🗄️ single header json parser for C and C++

??️ json.h A simple single header solution to parsing JSON in C and C++. JSON is parsed into a read-only, single allocation buffer. The current suppor

Neil Henning 498 Jun 9, 2022
A C++ library for interacting with JSON.

JsonCpp JSON is a lightweight data-interchange format. It can represent numbers, strings, ordered sequences of values, and collections of name/value p

null 6.5k Jun 23, 2022
Very low footprint JSON parser written in portable ANSI C

Very low footprint JSON parser written in portable ANSI C. BSD licensed with no dependencies (i.e. just drop the C file into your project) Never recur

James McLaughlin 1.2k Jun 15, 2022
A tiny JSON library for C++11.

json11 json11 is a tiny JSON library for C++11, providing JSON parsing and serialization. The core object provided by the library is json11::Json. A J

Dropbox 2.3k Jun 22, 2022
A killer modern C++ library for interacting with JSON.

JSON Voorhees Yet another JSON library for C++. This one touts new C++11 features for developer-friendliness, an extremely slow-speed parser and no de

Travis Gockel 125 Mar 4, 2022
Very simple C++ JSON Parser

Very simple JSON parser for c++ data.json: { "examples": [ { "tag_name": "a", "attr": [ { "key":

Amir Saboury 64 May 12, 2022