rlx(1)
Deprecated, see the node version rlx
Command line interface for couchdb.
Features
- UNIX style commands such as
cd
,pwd
,ls
andrm
. - Pretty print JSON documents with support for
perl
,python
,node
andruby
, configurable with thelang
setting. - Validate JSON before sending to a server, configurable with the
lint
setting. - Syntax highlighting is available using either
source-highlight
orpygmentize
. - View large documents using
less
, disabled by default but may be toggled with theusepager
setting. - Toggle display of network requests with the
verbose
setting. - Configure default server and database with the
server
anddatabase
settings. - Use the
save
command to save response documents to files. - Familiar readline line editing with command history
- Inline manual with the
help
command.
Authentication API
- Login and logout from servers using the
login
andlogout
commands. - Create, edit and delete from the users database with the
user
commands. - Retrieve information about the current session with the
whoami
andsession
commands. - Switch between authenticated servers within the same terminal session.
- Create, list and delete server administrators with the
admin
commands. - Modify database-level administrators and members with the
security
commands. - Use the
passwd
command to change passwords.
Note that no client-side password generation is performed so you must be using couchdb 1.2.0
or later to be able to generate hashed passwords on the server.
Server API
- View server statistics with the
stats
command. - View server logs with the
log
command. - Restart a server with the
restart
command. - View active tasks with the
tasks
command. - Generate uuids with the
uuids
command. - View server version with the
version
command.
Configuration API
- View server configuration with the
config get
command. - Edit server configuration keys with the
config set
command. - Delete server configuration keys with the
config rm
command.
Database API
- Select a database with the
db
command. - List databases with the
db ls
command. - Add databases with the
db add
command. - Delete databases with the
db rm
command. - View database information with the
db info
command. - Compact a database with the
db compact
command. - Perform view cleanup with the
db cleanup
command. - Synchronize uncommitted changes with the
db commit
command. - View changes with the
db changes
command. - Get and set the revisions limit with the
db revslimit
command.
Document API
- List document with the
doc ls
command. - Create documents with the
doc add
command. - Edit documents with the
doc edit
command. - Delete documents with the
doc rm
command. - View documents with the
doc get
command. - Inspect HTTP headers with the
doc head
command. - Retrieve the revision with the
doc etag
command. - Copy documents with the
doc copy
command. - Add, update and delete documents in bulk using the
bulk
commands. - Include more information about documents using the
revs
,revsinfo
,conflicts
andseq
sub-commands of thedoc
command.
Attachments API
- Attach a file with the
attach
command. - Attach multiple files with the
attach files
command, supports simple directory globbing. - Delete multiple attachments with the
attach rm
command. - Download multiple attachments with the
attach get
command.
Note that only standalone attachments are supported, there are no plans to support inline attachments.
Replication API
- Use the
repl
sub-commandsadd
,ls
,edit
,rm
andget
to manipulate replications. - Determines replication database name from the server configuration and verifies the database exists.
- Use
repl filter
to create a replication document that represents a filtered replication. - Use
repl docs
to create a replication document that only replicates specific documents.
Note that only the modern replication API that operates on the replicator database is supported, there are no plans to support the previous replication API.
Alias
- Use the
alias
commands to create, update and delete aliases for frequently used servers (and databases). - Use alias references with the
cd
command to connect to a server by alias. - Use alias references with the
repl
commands to replicate by alias.
Settings
- Configure settings at runtime with the
settings set
command. - Save and load settings with the
settings save
andsettings load
commands. - Restore to default settings with the
settings reset
command. - Shortcut commands for frequently used settings.
Templates
- Write document templates using
perl
,python
,node
andruby
or just write JSON if you prefer. - Test templates with the
tpl parse
command. - Modify and inspect template environment variables with the
tpl set
,tpl get
,tpl clean
andtpl print
commands. - Generate a user template set from the system templates using
tpl copy
. - Configure the language used for template parsing with the
templatelang
setting. - Configure the default templates used with the
tpl*
settings.
Syntax Highlight
- Switch between the default settings using the
hilite
andpygments
commands. - Configure a different highlighter using the
hilite
andhiliteopts
settings. - Use different style and language files for
source-highlight
with theshstyle
andshlang
settings.
Note that the default (and recommended) highlighter is source-highlight
as it is significantly faster than pygmentize
and easier to customize.
Bugs
Bug reports are welcome, please raise an issue if you encounter a bug.
Dependencies
Optional Dependencies
These dependencies are optional as rlx(1) works without them but some functionality will not work as expected.
- vim for document creation and editing
- perl, python, node or ruby for pretty printing JSON documents
- less for displaying large documents
- source highlight or pygmentize for highlighting JSON documents
- w3m The default browser for launching HTML pages, configurable with the
browser
setting.
Database Version
- Initially tested with couchdb
1.2.1
and subsequently migrated to using1.3.0
.
Languages
These are the language versions used for testing external JSON interpreters:
perl >= 5.16.3
withURI::Escape
(runcpan URI::Escape
to install)python >= 2.7.3
, untested with python 3.x.xruby >= 1.9.3
is required to enable JSON quirks mode so that primitive types are available for parsing and generationnode >= 0.8.21