TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Pgcli – A CLI for Postgres with auto-completion and syntax highlighting

227 pointsby amjithover 10 years ago

21 comments

amjithover 10 years ago
I&#x27;m the author of pgcli.<p>There is an FAQ page: <a href="http://pgcli.com/faq" rel="nofollow">http:&#x2F;&#x2F;pgcli.com&#x2F;faq</a><p>I&#x27;ll be happy to answer questions here as well.
评论 #8846327 未加载
评论 #8845495 未加载
评论 #8846144 未加载
评论 #8846095 未加载
a3nover 10 years ago
This looks really nice, especially the colors.<p>As a reminder&#x2F;heads up, you can often get simple command line editing and completion in tools like psql in a bash-like environment, just by having a .inputrc file in your home directory. Basically anything that uses readline, like bash, psql, ipython, etc.<p>Extra benefit, you don&#x27;t need to set -o vi (or the other flavor) in your .bashrc or on the command line; anything that uses readline (including bash and many other cli interfaces) will read the .inputrc file and do what it says. I&#x27;m often pleasantly surprised that a new cli tool uses my .inputrc.<p><a href="http://linux.die.net/man/3/readline" rel="nofollow">http:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;3&#x2F;readline</a><p><a href="https://www.gnu.org/software/bash/manual/bashref.html#Command-Line-Editing" rel="nofollow">https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;bash&#x2F;manual&#x2F;bashref.html#Comman...</a><p>You can easily add the capability to command line tools that you write. For example:<p><a href="https://docs.python.org/2/library/readline.html" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;2&#x2F;library&#x2F;readline.html</a>
评论 #8846410 未加载
Svenstaroover 10 years ago
Awesome! I made a package for Arch Linux and stuck it into AUR: <a href="https://aur.archlinux.org/packages/pgcli/" rel="nofollow">https:&#x2F;&#x2F;aur.archlinux.org&#x2F;packages&#x2F;pgcli&#x2F;</a>
wldcordeiroover 10 years ago
Awesome! Adding a django-extensions command for a &#x27;dbshell_plus&#x27; that utilizes this sounds like a great idea. I think I may just do that.
lobster_johnsonover 10 years ago
Looks great! Just reported an incompatibility with Unicode.<p>Also, is it possible to tweak the autocompletion so that hitting Enter selects the first offered completion? Right now, you have to hit tab or use the arrow keys to select.<p>A Homebrew formula would be great.
评论 #8846068 未加载
评论 #8846801 未加载
评论 #8846083 未加载
rlvesco7over 10 years ago
Does this work with emacs? I love the integration of psql and emacs, but this would be even better. <a href="http://www.emacswiki.org/emacs/SqlMode" rel="nofollow">http:&#x2F;&#x2F;www.emacswiki.org&#x2F;emacs&#x2F;SqlMode</a>
评论 #8851718 未加载
评论 #8845575 未加载
beefieldover 10 years ago
Based on 3 minute testing, I like, thanks.<p>If someone tries to install this on ubuntu with just the quick start instructions and fails, note that you need to<p>sudo apt-get install libpq-dev<p>Obviously, this is told in the more detailed install instructions.
评论 #8847614 未加载
RyanHamiltonover 10 years ago
I actually work on a piece of software for creating sql charts from the command line (<a href="http://www.sqldashboards.com/help/sqlchart-command-line-sql-chart-generator" rel="nofollow">http:&#x2F;&#x2F;www.sqldashboards.com&#x2F;help&#x2F;sqlchart-command-line-sql-...</a>),this is brilliant! Thanks.
asoloveover 10 years ago
Lazyweb: is there a way to get this to be the default handler for connecting to my heroku db?
IbJackedover 10 years ago
Looks pretty slick, I&#x27;ll give it try when I get home.<p>I&#x27;ll go ahead and ask, since I&#x27;m probably not the only one thinking it: will there be a MySQL version? ;)<p>EDIT: oh, and I guess the name wouldn&#x27;t be very fitting for a MySQL cli...
评论 #8845555 未加载
xfalcoxover 10 years ago
Sorry, but how to see tables from other schemas besides public in the FROM clause autocomplete?
评论 #8845935 未加载
pmontraover 10 years ago
Tried it. It&#x27;s wonderful. I think it will replace psql quickly, at least in my workflow.
ravipratapmover 10 years ago
This is cool! Thanks for sharing.<p>Considering I&#x27;m new to Postgres (been on MySQL for too many years), this is definitely making my life easier because of the autocomplete :)<p>But a question for you: how does this help someone who&#x27;s a power user of Postgres?
pca2over 10 years ago
This is great Is there support or planned support for expanded display? (\x in psql)
评论 #8848250 未加载
klaussilveiraover 10 years ago
Does anyone know something similar, but for mysql?
tmalyover 10 years ago
I wish there was something like this for Oracle. sqlplus is so painful
评论 #8851397 未加载
random_numberover 10 years ago
Looks fantastic, great idea!
pca2over 10 years ago
This is great Is there support or planned support for expanded display? (\x in psql)
pca2over 10 years ago
This is great Is there support or planned support for expanded display? (\x in psql)
pca2over 10 years ago
This is great Is there support or planned support for expanded display? (\x in psql)
pca2over 10 years ago
This is great Is there support or planned support for expanded display? (\x in psql)