Giter Site home page Giter Site logo

izk's Introduction

IZK: interactive zookeeper

Build Status Coverage Status

izk is a modern and simple zookeeper shell, with autocompletion, history search, vi bindings, syntax highlighting and pretty-printing.

asciicast

Installation

To install izk, simply run

$ pip install izk

izk is Python 3 only. I do not plan to support Python 2, but it that's important to you, feel free to contribute!

Docker

izk is also available as a docker image. To run it, execute

$ docker run -it brouberol/izk

Note that to ease usage woith docker, all command-line arguments can be passed as environment variables, prefixed with IZK_.

Example: here is how to run izk --write in docker

$ docker run -it -e IZK_WRITE=1 brouberol/izk

Usage

$ izk --help
usage: izk [-h] [--eval [EVAL]] [--write WRITE]
           [--style {default,emacs, ...}]
           [--version]
           [zk_url]

CLI for zookeeper with syntax-highlighting and auto-completion.

positional arguments:
  zk_url                URL of the zookeeper node. Default: localhost:2181.
                        Override via the IZK_ZK_URL environment variable.

optional arguments:
  -h, --help            show this help message and exit
  --eval [EVAL]         Evaluate a single zk command and exit
  --write WRITE         Authorize write operations (update/insert/remove).
                        Override via the IZK_WRITE environment variable.
  --style {default,emacs, ...}
                        The color style to adopt. Default: monokai. Override
                        via the IZK_STYLE environment variable.
  --input-mode {vi,emacs}
                        The input mode to adopt. Default: vi. Override via the
                        IZK_INPUT_MODE environment variable.
  --version             Display izk version number and exit

Version: 0.4.4

Local Development

If you plan on developing on izk, you can install the local code by running

$ poetry run izk

You can then start a local zookeeper instance by running

$ docker run -it -p 2181:2181 --name zookeeper --rm zookeeper

izk's People

Contributors

brouberol avatar dependabot[bot] avatar espadrine avatar mackong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

espadrine mackong

izk's Issues

raw command seems not play well

About raw command

when i type raw srvr ,it seems like invalid why is that

(RO 0) > raw srvr
Command 'raw srvr' is invalid

[idea] Allow `set` to open an editor to input the data

Instead of typing a one-liner such as set /test '{"super": "long", "json": "file", "with": {"nested": "values"}}, we could only type set /test, wich would open the user's EDITOR, in which the value would be typed in, saved to a tmpfile, read, and assigned to the znode.

Improve output of `ls` command

Example

(0) > ls /
test test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12 test13 test14 test15 test16 test17

We should probably see how the unix ls command does it and try to replicate

Timeout on zk connection at startup

This is just bad XP

(izk) λ  izk git:(master) ✗ izk
Connection dropped: socket connection error: Connection refused
Connection dropped: socket connection error: Connection refused
Connection dropped: socket connection error: Connection refused
Connection dropped: socket connection error: Connection refused
Connection dropped: socket connection error: Connection refused
Connection dropped: socket connection error: Connection refused
^CTraceback (most recent call last):
  File "/Users/balthazarrouberol/dd/.envs/izk/bin/izk", line 11, in <module>
    load_entry_point('izk', 'console_scripts', 'izk')()
  File "/Users/balthazarrouberol/code/izk/izk/prompt.py", line 71, in main
    read_only=not args.write
  File "/Users/balthazarrouberol/code/izk/izk/zk.py", line 8, in __enter__
    self.start()
  File "/Users/balthazarrouberol/dd/.envs/izk/lib/python3.6/site-packages/kazoo/client.py", line 563, in start
    event.wait(timeout=timeout)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 551, in wait
    signaled = self._cond.wait(timeout)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 299, in wait
    gotit = waiter.acquire(True, timeout)
KeyboardInterrupt

Fail with a helpful error message instead.

Define linting rules

Define linting configuration files and travis tests, to maintain the code quality throughout the project lifetime.

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.