Draw sequence diagram in text from terminal.

sequence-diagram-cli

Draw seqence diagram from terminal.

Installation

$ ~/sequence-diagram-cli > sh ./install.sh
$ ~/sequence-diagram-cli > seqdia 'YOUR_SEQUENCE_DIAGRAM_FILE'
$ ~/sequence-diagram-cli > seqdia 'YOUR_SEQUENCE_DIAGRAM_FILE' prefix='// ' suffix='|'

//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
participant S

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

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

Syntax

participant

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

participant User // this will be front
; or
participant "with [email protected]#!$" 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.

You can also customize styles by editing style.h.

TODO

  • note
  • more arrow design
Owner
Foreign student who live in Japan
null
Similar Resources

Graphs the activity of a chia harvester in a linux terminal.

Graphs the activity of a chia harvester in a linux terminal.

Chia Harvest Graph Monitor for Chia Harvesting Introduction The chiaharvestgraph tool will graph Chia Harvesting activity in a linux terminal. Use a 2

Nov 10, 2022

a simple to use linux terminal

a simple to use linux terminal

Feb 17, 2022

Collection of human friendly terminal interface for git.

Collection of human friendly terminal interface for git.

A collection of human friendly terminal user interface for git.

Nov 25, 2022

Simple benchmark for terminal output

TermBench This is a simple timing utility you can use to see how slow your terminal program is at parsing escape-sequence-coded color output. It can b

Oct 19, 2022

tinytetris - 80x23 terminal tetris

tinytetris - 80x23 terminal tetris

tinytetris - 80x23 terminal tetris

Dec 1, 2022

Contour - A modern C++ Terminal Emulator

 Contour - A modern C++ Terminal Emulator

contour is a modern terminal emulator, for everyday use. It is aiming for power users with a modern feature mindset.

Nov 24, 2022

📺🗿 Terminal graphics for the 21st century.

📺🗿 Terminal graphics for the 21st century.

📺🗿 Chafa is a command-line utility that converts all kinds of images, including animated GIFs, into sixel or ANSI/Unicode character output that can be displayed in a terminal.

Nov 29, 2022

Simple Unix Terminal Football Manager-like game.

Superleage 2020/2021 It is a "work in progress" simple game based on some mechanics of Football Manager. The game is in a very early stage of Developm

Oct 14, 2021

timg - Terminal Image and Video Viewer

 timg - Terminal Image and Video Viewer

timg - Terminal Image and Video Viewer

Nov 29, 2022
Comments
  • Add option to not print the surrounding === lines

    Add option to not print the surrounding === lines

    The lines surrounding the generated diagrams (========) are inconvenient when seqdia is used in scripts (or e.g. slides) to generate diagrams on the fly, especially because they are colour coded.

    This PR introduces the raw option which when specified, makes the renderer not print those lines.

  • Error compiling: multiple definition of `style`

    Error compiling: multiple definition of `style`

    I think you've got a header include loop or something. (main.h includes renderer.h which includes style.h -- and style.c -> style.h)

    gcc main.o arrow_connection.o participant.o renderer.o parser.o scanner.o style.o fetch.o -o seqdia -I/usr/local/opt/curl/include -L/usr/local/opt/curl/lib -lcurl
    /usr/bin/ld: renderer.o:(.bss+0x0): multiple definition of `style'; main.o:(.bss+0x0): first defined here
    /usr/bin/ld: style.o:(.bss+0x0): multiple definition of `style'; main.o:(.bss+0x0): first defined here
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:22: seqdia] Error 1
    
  • Add support for piping commands in CLI

    Add support for piping commands in CLI

    Here is a commit that allows seqdia to use pipes like this! echo "Alice -> Bob: hello world" | seqdia

    This also makes it possible to call it from vim using :h filter.

A terminal emulator that runs in your terminal. Powered by Turbo Vision.
A terminal emulator that runs in your terminal. Powered by Turbo Vision.

tvterm A terminal emulator that runs in your terminal. Powered by Turbo Vision. tvterm is an experimental terminal emulator widget and application bas

Aug 8, 2022
Spitfire is a basic terminal language that can exicute code via the terminal.

Spitfire is a basic terminal language that can exicute code via the terminal. It is easy to learn and runs fast, considering that its just a 300 line c++ file.

Nov 18, 2021
Library for creating terminal applications with text-based widgets
Library for creating terminal applications with text-based widgets

Library for creating terminal applications with text-based widgets FINAL CUT is a C++ class library and widget toolkit with full mouse support for cre

Dec 1, 2022
Small header only C++ library for writing multiplatform terminal applications

Terminal Terminal is small header only library for writing terminal applications. It works on Linux, macOS and Windows (in the native cmd.exe console)

Dec 1, 2022
:computer: C++ Functional Terminal User Interface. :heart:
:computer: C++ Functional Terminal User Interface. :heart:

FTXUI Functional Terminal (X) User interface A simple C++ library for terminal based user interface. Demo: Feature Functional style. Inspired by [1] a

Nov 30, 2022
A little UNIX-inspired terminal application for the Numworks Calculator (not using escher).
A little UNIX-inspired terminal application for the Numworks Calculator (not using escher).

L.E. Terminal (let for short) is a little UNIX-inspired terminal for the Numworks Calculator.

Aug 31, 2022
Terminal calculator made for programmers working with multiple number representations, sizes, and overall close to the bits
Terminal calculator made for programmers working with multiple number representations, sizes, and overall close to the bits

Programmer calculator The programmer calculator is a simple terminal tool designed to give maximum efficiency and flexibility to the programmer workin

Nov 22, 2022
X terminal emulator rendering through OpenGL ES Compute Shaders

Zutty is a terminal emulator for the X Window System, functionally similar to several other X terminal emulators such as xterm, rxvt and countless others

Dec 3, 2022
The new Windows Terminal and the original Windows console host, all in the same place!

The new Windows Terminal and the original Windows console host, all in the same place!

Nov 28, 2022
n³ The unorthodox terminal file manager
n³ The unorthodox terminal file manager

n³ The unorthodox terminal file manager

Nov 30, 2022