GithubHelp home page GithubHelp logo

vidit-bhatia / tdlib-json-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oott123/tdlib-json-cli

0.0 1.0 0.0 163 KB

A CLI Wrapper of TdLib

License: GNU Affero General Public License v3.0

CMake 7.95% C++ 27.01% JavaScript 65.04%

tdlib-json-cli's Introduction

TDLib JSON CLI

TDLib v1.6.0 TDLib JSON CLI v1.6.0 Build Status AGPL v3.0 GitHub release Twitter

About

TDLib JSON CLI is a simple command line tool uses stdin & stdout as input & output of tdlib's td_json_client.

You can use this to replace the buggy, weird tg-cli and it's json interface.

This project is licensed under AGPL v3.0, but you can distribute it separately so you are not required to make your project open source under AGPL compatible license.

Usage

./bin/tdlib-json-cli [verbosity]

[verbosity] = 0123456789 Set TDLib's verbosity level at startup.

  • 0 - fatal errors;
  • 1 - errors;
  • 2 - warnings and debug warnings;
  • 3 - informational;
  • 4 - debug;
  • 5 - verbose debug;
  • greater than 5 and up to 1024 can be used to enable even more logging.

tdlib-json-cli will use stdin & stdout to process data.

Request will be send to tdlib line by line, so make sure you have your json string in one line.

Response will be recieve from tdlib to stdout line by line.

See TDLib Documention for more information.

Commands

We provide 2 extra command to control tdlib-json-cli behaviors.

verbose [int]

Change the verbose level of the tdlib.

exit

exit the tdlib-json-cli.

Events

We provide serveral events for you to know tdlib-json-cli status.

They are json strings which write to stdout like {"@cli":{"event":"EVENT_ID"}}.

client_created

This event will be trigged at td client created.

exited

This event will be trigged at tdlib-json-cli exited.

Build

macOS

brew install gperf cmake openssl readline
mkdir Release
cd Release
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ -DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include -DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib -DCMAKE_BUILD_TYPE=Release ..
make -j4

Linux

See td/README.md

Windows

See td/README.md

Generate Types File

You should have php, doxygen, node.js and npm installed.

Before generate types file, you MUST build successfully at least one time. This because of some code of tdlib which used to generate docs and are generated at the build time.

cd td
doxygen
cd ../types-generator
npm i
cd ..
node ./types-generator/index.js

This will write types.json to the project root directory which contains types of all the objects and functions.

tdlib-json-cli's People

Contributors

oott123 avatar adodulad avatar

Watchers

James Cloos 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.