HNHacker News
TopNewBestAskShowJobs

amjith

1,042 karma · joined May 13, 2008

http://blog.amjith.com

* Creator of pgcli and mycli.

amjith.r at gmail.com

@amjithr

submissionscomments
amjith··on Sensible Defaults
That's good to know. Perhaps I should replace the dots with empty space. I'll do that if we get more requests for it.

Thank you for the feedback.

amjith··on PyCon 2017 – Talk videos
Yes! I always use bpython never the default python repl. That's one of the very few python packages that gets installed system wide.
amjith··on PyCon 2017 – Talk videos
My talk at Pycon was about building modern commandline shells using python.

https://www.youtube.com/watch?v=hJhZhLg3obk

I'd love some feedback.

amjith··on Vivaldi browser v1.8 released, with calendar-style browsing history
There is a chrome extension for that: https://github.com/lengstrom/falcon
amjith··on Usql – A universal command-line interface for SQL databases
You know this actually exists: https://github.com/catherinedevlin/ipython-sql

I found out about this from one of the core-devs of pgcli. He made it possible to embed pgcli inside ipython. We wrote a blog post about how to use this: http://pgcli.com/embedding-pgcli-in-ipython.html

amjith··on Usql – A universal command-line interface for SQL databases
I'm the author of pgcli and mycli. I was tempted to write a universal cli that supported both postgres and mysql, but then I decided to keep them separate for the following reasons:

1. Psql comes with backslash commands that are implemented at the client level and not in the database. So you can't simply send `\dt` to the database. That will fail. The same is true for mysql as well (such as `\u`).

2. There wasn't a huge overlap in users who use Postgres and Mysql at the same time. Even for the minority that do, I tried to keep pgcli and mycli behave similarly so they can switch between them seamlessly.

3. The code complexity needed to support multiple database backends would make it hard for a newcomer to contribute to the project. This is just my guess and I don't have data to back this up.

4. I didn't think I could do a good enough job of maintaining parity with psql and mysql's default client if I had a universal client. I still don't have complete parity but it is close enough that users don't feel like their compromising a lot.

I'm happy you're taking on this challenge and I'll be glad to give you pointers on how the sql completion engine works in pgcli and mycli.

Cheers!

amjith··on Show HN: Zazu App – An OSS app launcher, similar to Alfred
It takes minute to download and install all the default plugins. So it takes a few minutes after the first launch to start working.
amjith··on Ask HN: How do I break through the plateau in touch typing speed?
I've been living with the current speed for 10 years now. I do feel like it is dragging me down a bit. Especially when I pair program with coworkers and I see how fast they can type, I feel like I could be doing better.
amjith··on Show HN: I wrote a kid's game to teach my son alphabets. Feedback appreciated
Hi. I'm the author.

This was written after I watched a couple of videos from javascript30.com.

It doesn't use any framework, just pure JavaScript. It's designed for desktop with a keyboard. Does not work on phones or tablets.

My son is 4 years old. He can recognize most of the alphabets but not all of them.

amjith··on VimWiki – A personal wiki for Vim
Thanks a lot for creating vimwiki. I've been using it for years to keep my notes.

Thanks for adding markdown support. :)

Is there a way in which I can show my gratitude? I can donate money or contribute code (if you need help).

amjith··on Ask HN: What simple tools or products are you most proud of making?
Thank you for spreading the love. :)

The initial surge of users came from HN when I originally posted it at launch, but since then most of the users were through word of mouth.

amjith··on Ask HN: What simple tools or products are you most proud of making?
Two years ago I created a CLI tool called pgcli (http://pgcli.com). A postgres client with auto-completion. It became ridiculously successful. I got a few requests to support mysql. So I launched a kickstarter to write mycli (http://mycli.net). This also became quite successful.

There is a thriving community of core devs and a ton of users. I'm happy with both creations and made a lot of online friends.

These projects also led me to create a standalone python library for doing fuzzy matching. I'm quite proud of this one since the resulting code ended up being ridiculously small but produced really good results. https://github.com/amjith/fuzzyfinder/

amjith··on Fusuma: Multitouch gestures with libinput dirver on X11, Linux
Is it possible to map gestures that are not controlled by keyboard shortcuts?

Such as dragging a window using a three finger swipe?

amjith··on Show HN: RepoCreator – GitHub Project Scaffolding as a Service
The site looks good. Landing page has good description about the tool.

I don't see many templates except that gradle one, do you have more or is that yet to come?

amjith··on Show HN: SAWS: A Supercharged AWS CLI
The tool looks fantastic. Well done!

I like how prompt_toolkit (https://github.com/jonathanslenders/python-prompt-toolkit) is inspiring a lot of these user friendly command line tools.

amjith··on Mycli: A MySQL Client with auto-completion and syntax highlighting
I'm the author of the tool. I had posted this yesterday linking to the home page. http://mycli.net

I guess a few people didn't see it. :)

Discussion Thread: https://news.ycombinator.com/item?id=9975022

I'll be happy to answer questions about the project.

amjith··on Show HN: Mycli – A CLI for MySQL with auto-completion and syntax highlighting
It still does auto-complete the DROP TABLE and DROP DATABASE, but it will ask for confirmation before running it.
amjith··on Show HN: Mycli – A CLI for MySQL with auto-completion and syntax highlighting
If you have 'less' on your system then it should work because I'm manipulating the options that are passed into less. I'm setting the less options here: https://github.com/dbcli/mycli/blob/master/mycli/main.py#L42...

You can try that from the command line yourself. Try:

less -SRXF <filename.txt>

That should print the file and not clear the screen when you press 'q'.

You can also override the pager to change from less to something else right from inside mycli. For example:

amjith@localhost:(none)> pager cat

That will use cat instead of less for paging the output and that should keep the output in the screen but it won't page them like less.

amjith··on Show HN: Mycli – A CLI for MySQL with auto-completion and syntax highlighting
Can you tell me which OS you're using?

In Linux and OS X the less command should keep the output in the screen after you press 'q'.

amjith··on Show HN: Mycli – A CLI for MySQL with auto-completion and syntax highlighting
Thank you for reporting the missing keys. I had them as <C-r> and <F3> but it was misinterpreted as html tags.

It is fixed now.

I'm not sure what you mean by view the results without re-running the query. Does scrolling not work? or do you mean if you launch a new session and want to see the results?

If you want to keep the results you can use audit logging feature (http://mycli.net/logging) which records every query and it's output into a file.

amjith··on Show HN: Mycli – A CLI for MySQL with auto-completion and syntax highlighting
Yes! Python-prompt-toolkit has made it tremendously easy to write programs like mycli and pgcli.

The author has done an excellent job of keeping the APIs simple and intuitive.

It also helps that he's a good OSS maintainer (responsive and courteous). :)

amjith··on Show HN: Mycli – A CLI for MySQL with auto-completion and syntax highlighting
You're right. I didn't know that.

http://docs.memsql.com/latest/faq/#is-memsql-a-storage-engin...

I haven't personally tried it with memsql.

amjith··on Show HN: Mycli – A CLI for MySQL with auto-completion and syntax highlighting
I don't fully understand your question. If you're asking whether this client will work with memsql, then the answer is No. Unless, memsql uses mysql protocol to talk to clients.

Mycli uses MySQL adapter called PyMySQL to connect to MySQL instances. I don't think it'll work with memsql.

If you're talking about writing a similar client for memsql, then yes it is possible to do that as long as there is a Python adapter for it.

amjith··on Show HN: Mycli – A CLI for MySQL with auto-completion and syntax highlighting
I've heard it from someone else as well. I couldn't reproduce it myself.

The suggested solution was to uninstall mycli and reinstall directly from github.

pip uninstall mycli six; pip install https://github.com/dbcli/mycli/archive/master.zip

amjith··on Show HN: Mycli – A CLI for MySQL with auto-completion and syntax highlighting
I'm the author of this project. I'll be happy to answer any questions.

Brief Intro: This is a command line tool that is intended as a replacement for MySQL client.

It works with MySQL, MariaDB and Percona.

It is written in Python and it works in Python 2.6 to Python 3.4.

This is a counter part to http://pgcli.com.

MyCli was funded through Kickstarter (https://www.kickstarter.com/projects/1839007321/mysql-cli)

amjith··on Postgres CLI with autocompletion and syntax highlighting
Redshift is not officially supported since I'm targeting Postgres 9.x.

But there is some work underway to add support for Redshift.

https://github.com/dbcli/pgcli/issues/18

amjith··on Postgres CLI with autocompletion and syntax highlighting
There is no native support for ssh port forwarding. But I do support connecting via a socket.
amjith··on Postgres CLI with autocompletion and syntax highlighting
I'm planning to add confirmation for those commands to make sure people don't accidentally drop something they don't intend to.
amjith··on Postgres CLI with autocompletion and syntax highlighting
I don't think Vim's autocompletion can suggest table names and column names from the current database. I think the advantage of this tool is in using the metadata from the database to suggest relevant completions instead of mere keyword completions.
amjith··on Postgres CLI with autocompletion and syntax highlighting
I used licecap (http://www.cockos.com/licecap/) to create that gif.
← PreviousPage 2 of 6Next →