All Projects → Ja-sonYun → sequence-diagram-cli

Ja-sonYun / sequence-diagram-cli

Licence: Apache-2.0 license
Draw sequence diagram in text from terminal.

Programming Languages

c
50402 projects - #5 most used programming language
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to sequence-diagram-cli

ZenUml
ZenUml is an online tool turning TEXT into UML sequence diagrams. This repository is used to track defects, suggestions and feature request.
Stars: ✭ 23 (-45.24%)
Mutual labels:  sequence-diagram
Mermaid
Provides a parser function to generate diagrams and flowcharts with the help of the mermaid script language
Stars: ✭ 27 (-35.71%)
Mutual labels:  sequence-diagram
diagwiz
Diagrams as code
Stars: ✭ 41 (-2.38%)
Mutual labels:  sequence-diagram
mscgenjs-cli
Render sequence charts from the command line
Stars: ✭ 22 (-47.62%)
Mutual labels:  sequence-diagram
Editor.md
The open source embeddable online markdown editor (component).
Stars: ✭ 11,741 (+27854.76%)
Mutual labels:  sequence-diagram

sequence-diagram-cli

Draw seqence diagram from terminal.

Korean and Japanese(which takes two spaces by character in terminal) will looks like above image only in terminal.

You can also customize styles by editing style.h.

Use from python

git clone --recurse-submodules https://github.com/Ja-sonYun/sequence-diagram-cli.git
cd sequence-diagram-cli/seqdia-python-binding
python setup.py build
python setup.py install
python -c "import seqdia"

more details

Installation

wget -qO - https://github.com/Ja-sonYun/sequence-diagram-cli/raw/main/install.sh | bash

Usage

$ ~/sequence-diagram-cli > seqdia 'YOUR_SEQUENCE_DIAGRAM_FILE'
$ ~/sequence-diagram-cli > seqdia 'YOUR_SEQUENCE_DIAGRAM_FILE' prefix='// ' suffix='|' al raw

v1.1
// with ' al ' option will draw sequence diagram in pure character not utf-8.

// with ' raw ' the surrounding lines will not be printed

//example
$ ~/sequence-diagram-cli > seqdia tests/test.txt

Example ouput

./tests/test.txt
------------------
; participants
participant User
participant " * TODO
 - clean living room  " as todo
participant Dev

; connections
User->User: default arrow
User-->Dev: styled arrow
todo->todo : "self connecting
with
new line"
User->Dev : yes? sd
User<--Dev : no
todo<--Dev: reverse arrow
S->todo: "EEEE
E
EEEE
E
EEEE"
-------------------

$ ~/sequence-diagram-cli > seqdia tests/test.txt prefix="<-- " suffix=" -->"
===========================================================
<--         ╭────────────────────────╮                  -->
<-- ╭──────╮│  * TODO                │   ╭─────╮╭───╮   -->
<--User ││  - clean living room   │   │ Dev ││ S-->
<-- ╰───┬──╯╰────────────┬───────────╯   ╰──┬──╯╰─┬─╯   -->
<--     │                │                  │     │     -->
<--     │                │                  │     │     -->
<--     │ default arrow  │                  │     │     -->
<--     ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮ │                  │     │     -->
<--     │              │ │                  │     │     -->
<--     │◀╌╌╌╌╌╌╌╌╌╌╌╌╌╯ │                  │     │     -->
<--     │                │                  │     │     -->
<--     │           styled arrow            │     │     -->
<--     ├╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶≻│     │     -->
<--     │                │                  │     │     -->
<--     │                │ self connecting  │     │     -->
<--     │                │ with             │     │     -->
<--     │                │ new line         │     │     -->
<--     │                ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮ │     │     -->
<--     │                │                │ │     │     -->
<--     │                │◀╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯ │     │     -->
<--     │                │                  │     │     -->
<--     │              yes? sd              │     │     -->
<--     ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌▶│     │     -->
<--     │                │                  │     │     -->
<--     │                no                 │     │     -->
<--     │≺╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴┤     │     -->
<--     │                │                  │     │     -->
<--     │                │  reverse arrow   │     │     -->
<--     │                │≺╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴┤     │     -->
<--     │                │                  │     │     -->
<--     │                │         EEEE     │     │     -->
<--     │                │         E        │     │     -->
<--     │                │         EEEE     │     │     -->
<--     │                │         E        │     │     -->
<--     │                │         EEEE     │     │     -->
<--     │                │◀╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤     -->
<--     │                │                  │     │     -->
<--     │                │                  │     │     -->
<--     │                │                  │     │     -->
<--     │                │                  │     │     -->
<--     │                │                  │     │     -->
<--     │                │                  │     │     -->
===========================================================

**** with al option ****

$ ~/sequence-diagram-cli > seqdia tests/test.txt al prefix='<--'
=====================================================
//        +------------------------+
//+------+|  * TODO                |   +-----++---+
//| User ||  - clean living room   |   | Dev || S |
//+---+--++------------+-----------+   +--+--++-+-+
//    |                |                  |     |
//    |                |                  |     |
//    | default arrow  |                  |     |
//    +--------------+ |                  |     |
//    |              | |                  |     |
//    |<-------------+ |                  |     |
//    |                |                  |     |
//    |           styled arrow            |     |
//    +..................................>|     |
//    |                |                  |     |
//    |                | self connecting  |     |
//    |                | with             |     |
//    |                | new line         |     |
//    |                +----------------+ |     |
//    |                |                | |     |
//    |                |<---------------+ |     |
//    |                |                  |     |
//    |              yes? sd              |     |
//    +---------------------------------->|     |
//    |                |                  |     |
//    |                no                 |     |
//    |<..................................+     |
//    |                |                  |     |
//    |                |  reverse arrow   |     |
//    |                |<.................+     |
//    |                |                  |     |
//    |                |         EEEE     |     |
//    |                |         E        |     |
//    |                |         EEEE     |     |
//    |                |         E        |     |
//    |                |         EEEE     |     |
//    |                |<-----------------------+
//    |                |                  |     |
//    |                |                  |     |
//    |                |                  |     |
//    |                |                  |     |
//    |                |                  |     |
//    |                |                  |     |
=====================================================

Syntax

participant

You don't need to define participant, but for alignment, you should.

participant User // this will be front
; or
participant "with a2a!@#!$" as A // you can use this like 'A -> User: ***'
; or
participant "new
line" as nl // this will be last

arrow

User->New: message // participant 'New' will defined automatically at here
; or
User-->New: message
; or
User<-A: message
; or
User<--A: message
; or
nl -> nl: " realllly // with multiple lines
looooooong
messageee"
; or
ee <- ee: "
  you can't use like this" // when using new line, you should add 1 character to first line at least. I'll fix this soon.

TODO

  • note
  • more arrow design
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].