Delta Chat on the command line
Lars-Magnus Skog 374e4c6576
Merge pull request #55 from deltachat/greenkeeper/deltachat-node-0.16.0
10 months ago
scripts Enable Travis 11 months ago
.gitignore Initial commit :seedling: 11 months ago
.travis.yml Enable Travis 11 months ago
CHANGELOG.md Prepare changelog for 0.2.1 11 months ago
LICENSE Initial commit :seedling: 11 months ago
README.md Update README.md (#43) 11 months ago
app.js Do not skip to next page, stay on first at startup 11 months ago
cli.js Use ready event so ui can be rendered before open is finished 11 months ago
commander.js /create-contact can accept one parameter (address only) 11 months ago
layout.js Show account and date in statusbar (and change date format in messages) 11 months ago
package.json fix(package): update deltachat-node to version 0.16.0 10 months ago
rc.js Mention styles and rc 11 months ago
state.js Show account and date in statusbar (and change date format in messages) 11 months ago
util.js Show account and date in statusbar (and change date format in messages) 11 months ago

README.md

deltachat-cli

Delta Chat on the command line.

npm Build Status Node version JavaScript Style Guide

Experimental application built on top of the deltachat-node native addon. Bringing E2EE chat over email to the commmand line.

Install

npm i deltachat-cli -g

Usage

deltachat --email user@site.org --mail_pw foo

By default deltachat will use the $HOME/.deltachat_cli folder for storing data. This can be overriden by using the --home argument.

Run deltachat using current folder to store data:

deltachat --email user@site.org --mail_pw foo --home .

Platform Support

Currently deltachat-cli only works on Linux. This is completely dependent on the platform support of deltachat-node. If you're on a Debian based distro the following command should be enough to cover software and build dependencies.

sudo apt install libetpan-dev libssl-dev libsqlite3-dev libsasl2-dev \
libbz2-dev zlib1g-dev meson ninja-build

Screenshots

TODO

Shortcuts and Keys

  • ctrl-n Switch to next window.
  • ctrl-p Switch to previous window.
  • alt-n or pagedown Scroll down.
  • alt-p or pageup Scroll up.
  • alt-<n> Switch to window <n> where n is between 1 and 9.
  • enter Accept input from the user.
  • tab Auto completes commands (starting with /) and nicks.

Commands

Commands can be executed from anywhere, but the output of all commands show up in the status window.

  • /archive-chat [<id>] Archive a chat. If <id> is omitted, defaults to current chat.
  • /block-contact <id> Block a contact.
  • /clear Clear the debug or status window.
  • /create-chat <contactId> Create a normal chat with a single user.
  • /create-contact [<name>] <address> Create a contact.
  • /delete-chat [<id>] Delete a chat. If <id> is omitted, defaults to current chat.
  • /delete-contact <id> Delete a contact (might fail if you have an open chat with that particular user).
  • /delete-message <id> Delete a message.
  • /get-chats List all chats.
  • /get-contacts List all contacts.
  • /help [<command>] Show all commands and their short syntax or help about a specific command.
  • /star-message <id> Star a message (starred messages show up in a virtual stars chat).
  • /unarchive-chat <id> Unarchive a chat.
  • /unblock-contact <id> Unblock a contact.

Configuration

You can use environment variables instead of command line arguments:

deltachat_cli_email=user@site.org deltachat_cli_mail_pw=foo deltachat

You can also write a custom configuration file in either .json or .ini format. Please see the rc documentation for more details.

Styles

It's possible to configure various styles in the application.

  • Text colors and background colors are taken from chalk.
  • Gradient types are taken from the gradient-string module.
  • Box styles (for chat messages) are taken from the boxen module.

Please consult rc.js for default values.

Why?

Why not just write a plugin for irssi or weechat and be done with it?

That's a great question. You should write one yourself!

The main goal is to implement something using deltachat-node to exercise the api, find stuff that doesn't work so well and make way for a coming desktop application. It's also an exploration into writing command line application based on the following node modules:

You should check them out. They're great!

Debug

Running deltachat with --debug will create a debug window where all events from deltachat-node can be seen.

Kudos and Inspiration

A lot of inspiration comes from irssi and the architecture has a lot in common with cabal.

License

Licensed under the GPLv3, see LICENSE file for details.

Copyright © 2018 Delta Chat contributors.