:target: https://travis-ci.org/noqqe/cmddocs
.. image:: https://codecov.io/gh/noqqe/cmddocs/branch/master/graph/badge.svg
:target: https://codecov.io/gh/noqqe/cmddocs
cmddocs
=======
``cmddocs`` is an interactive commandline wiki. It
lets you easily maintain your docs/cheetsheets/notes using:
- Plain Text Files
- Write ``markdown`` in your local Editor
- View in your local Pager
- Versioning with ``git``
cmddocs is like a framework around your plaintext files.
Why ?
-----
I kind of started ``cmddocs`` because I couldn't find something like
this on the internet. Here's my usecase. Im working as a DevOps guy
being in touch with various types of software, languages, tools,
operating systems and databases. To remember all those things I need a
place to store commands, workflows and short howtos.
Most of the software I use (and love) runs on a OpenBSD Box on the
internet and are commandline-based. These are
`mutt <http://www.mutt.org>`__,
`taskwarrior <http://taskwarrior.org>`__,
`jrnl <http://maebert.github.io/jrnl/>`__,
`weechat <http://weechat.org>`__ and so on...But i was missing a tool
for documentation.
After switching to just plaintext files using
``vim`` and ``git`` it was also a bit annoying. So I wrote
``cmddocs`` to make it easier for me to handle my plaintext files.
Markdown Rendering
------------------
``cmddocs`` uses the `mistune <https://github.com/lepture/mistune>`__ lexer to
wrap markdown with ansi control sequences instead of html tags.
It looks something like this.
.. image:: https://raw.github.com/noqqe/cmddocs/master/cmddocs-md2ascii.png
Demo
----
To give you an idea what it looks/feels like I created a short terminal
recording.
`asciinema cmddocs demo <https://asciinema.org/a/15168>`__
Installation
------------
::
pip install cmddocs
Also make sure you have `tree` installed.
Configuration
-------------
Create ``.cmddocsrc`` file in your $HOME with the following content
(adjust to your needs):
::
[General]
Datadir = /home/noqqe/Docs
Default_Commit_Message = small changes
Excludedir = .git/
Editor = /usr/local/bin/vim
# EditorFlags = -C
Pager = /usr/bin/less
PagerFlags = -fr
Prompt = cmddocs>
Promptcolor = 37
Intro_Message = cmddocs - press ? for help
Mail = mail@example.org
Default_Extension = md
[Colors]
Header12 = 37
Header345 = 37
Codeblock = 92
The only required option is "Datadir", everything else will be guessed
or defaults to a sane default value. Once you start cmddocs.py the CLI
will be shown. Use ``help`` for commands.
Quick Start
-----------
At first, create a very minimal config, like
::
[General]
Datadir = /home/noqqe/Docs
Editor = /usr/local/bin/vim
Pager = /usr/bin/less
Then you can start using cmddocs.
::
$ cmddocs
cmddocs - press ? for help
cmddocs> help
Documented commands (type help <topic>):
========================================
EOF delete e help list mail pwd search undo
cd diff edit info log move revert stats version
d dirs exit l ls mv rm status view
cmddocs> help l
Show files in current working dir
cmddocs> help log
Show git logs of your docs.
Usage: log # default loglines: 10)
log 20 # show 20 loglines
log 20 article # show log for specific article
log databases/mongodb 3 # same
Command Documentation
---------------------
``cd``
------
Change directory
::
Usage:
cd Programming/
cd
``delete``, ``rm``
------------------
Delete an article
::
Usage:
delete databases/mongodb
rm databases/mssql
``dirs``, ``d``
---------------
Show directories in current working dir
::
Usage:
dirs
d
dirs Databases/
``e``, ``edit``
---------------
Edit or create new article.
::
Usage:
edit databases/mongodb
edit intro
``list``, ``l``, ``ls``
-----------------------
Show files in current working dir
::
Usage:
list
l
list Databases/
``move``, ``mv``
----------------
Move an article to a new location
::
Usage:
move databases/mongodb databases/MongoDB
move life/foo notes/foo
mv life/foo notes/foo
``view``
--------
View an article. Creates temporary file with converted markdown to
ansi colored output. Opens your PAGER. (Only less supported atm)
::
Usage:
view databases/mongodb
view intro
``mail``
--------
Mail an article to a friend
::
Usage:
mail databases/mongodb
Recipient: mail@example.net
mail programming/r/loops
mail intro
``pwd``
-------
Show current directory
::
Usage:
pwd
``search``
----------
Search for keyword in current directory
::
Usage:
search mongodb
search foo
``undo``, ``revert``
-------------------
You can revert your changes (use revert from git)
::
Usage:
undo HEAD
undo 355f375
Will ask for confirmation.
``diff``
--------
Show git diffs between files and commits
::
Usage:
diff 7 # show diff for last 7 changes
diff 1 article # show diff for last change to article
diff # show last 5 diffs
``info``
--------
Show infos for an article
::
Usage:
info article
info Databases/mongodb
Created: 2014-01-18 11:18:03 +0100
Updated: 2015-10-23 14:14:44 +0200
Commits: 26
Lines: 116
Words: 356
Characters: 2438
``log``
--------
Show git logs of your docs.
::
Usage:
log # default loglines: 10)
log 20 # show 20 loglines
log 20 article # show log for specific article
log databases/mongodb 3 # same
``status``
----------
Show git repo status of your docs
::
Usage:
status
``stats``
---------
Calculate some statistics on your docs
::
Usage:
stats
``exit``, ``EOF``
-----------------
Exit cmddocs
::
Usage:
exit
``help``
--------
List available commands with "help" or detailed help with "help cmd".
``version``
-----------
Show version of cmddocs
::
Usage:
version
Changelog
---------
See Changelog_.
.. _Changelog: https://github.com/noqqe/cmddocs/blob/master/CHANGELOG.rst
License
-------
See License_.
.. _License: https://github.com/noqqe/cmddocs/blob/master/License.txt
Metadata
Release files for cmddocs 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cmddocs-1.0.3.tar.gz | 12.0 kB | Without provenance | Details |
Release files / cmddocs-1.0.3.tar.gz
| Download URL | cmddocs-1.0.3.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61e65507889c061506c51e9235f44f23162bf93c87a0d2694495ce4d1645d49e
|
|
BLAKE2b-256 checksum How to use checksums |
d283f37c1889086311829a325fc71ad07520ff6b986ab3de1a5253fa25b5d56d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for cmddocs 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.