github.com/criteo/command-launcher@v0.0.0-20230407142452-fb616f546e98/gh-pages/content/en/docs/overview/introduction.md (about)

     1  ---
     2  title: "Introduction"
     3  description: "Overall introduction of command launcher"
     4  lead: "Overall introduction of command launcher"
     5  date: 2022-10-02T17:15:37+02:00
     6  lastmod: 2022-10-02T17:15:37+02:00
     7  draft: false
     8  images: []
     9  menu:
    10    docs:
    11      parent: "Overview"
    12      identifier: "intro-7bb54696d0a61c0b18319f6b3e32f884"
    13  weight: 210
    14  toc: true
    15  mermaid: true
    16  ---
    17  
    18  ## What is command launcher?
    19  
    20  Command launcher is a small footprint, rich feature CLI management tool for both enterprise and individual CLI developers. It eases the command line tool development by providing built-in common functionalities like: monitoring, progressive rollout, auto-completion, credential management, and more to your commands.
    21  
    22  ## Why a command launcher?
    23  
    24  At Criteo, we have many teams who provides command line applications for developers. These CLI providers repeatly handle the same features and functionalities for their CLI apps, such as auto-completion, credential management, release, delivery, monitoring, etc.
    25  
    26  On developer side, they have to manually download these tools to keep them up-to-date, it is difficult for them to discover available new tools. On the other hand, different developers have developed lots of similar handy scripts/tools by themselves without an easy way to share with others to avoid "re-inventing" the wheel.
    27  
    28  To improve both developer and CLI provider's experience, we developed a command launcher to solve the above issues. It has built-in features like auto-completion, credential management, progressive roll-out, and monitoring, so that the CLI app provider can focus on the functionality of their CLI app. Developers only need to download the command launcher to access all these CLI apps. The command launcher will keep their CLI application up-to-date. The dropin feature allows developers to integrate their own scripts/tools into command launcher and share with others. These scripts and tools can also benefits from built-in features like auto-completion, and monitoring.
    29  
    30  ## How it works?
    31  
    32  Command launcher is a small binary downloaded by developer in their development environment. CLI provider packages new commands or new version of command into a package, upload it to a remote repository, and update the package index of the repository. This process can be automated. More details about the remote repository, see [CLI Provider Guide](../provider-guide)
    33  
    34  Developers can integrate their own commands into command launcher as a "dropin" package. These dropin package will be only accessible from the developers themselves. To share such commands see [Dropin Package](../dropin)
    35  
    36  Developers run command launcher to access these commands, for example, you have a command called `toto`, instead of run it directly from command line, you use `cl toto`, where `cl` is the binary name of the command launcher, you can name it anything suits you. Every time you execute command launcher, it will synchronize with the remote command, and propose available updates if exists.
    37  
    38  ```text
    39  
    40                             ┌──────────────────┐    Synch    ┌───────────────────────────┐
    41              ┌──────────────│ command launcher │◄────────────│ Remote Command Repository │
    42              │              └──────────────────┘             └───────────────────────────┘
    43              │                       │                                      │
    44              │            ┌──────────┼──────────┐              ┌────────────┼────────────┐
    45              ▼            ▼          ▼          ▼              ▼            ▼            ▼
    46         ┌─────────┐   ┌───────┐  ┌───────┐  ┌───────┐     ┌─────────┐  ┌─────────┐  ┌─────────┐
    47         │ dropins │   │ cmd A │  │ cmd B │  │ cmd C │     │  cmd A  │  │  cmd B  │  │  cmd C  │
    48         └────┬────┘   └───────┘  └───────┘  └───────┘     └─────────┘  └─────────┘  └─────────┘
    49       ┌──────┴──────┐
    50       ▼             ▼
    51   ┌────────┐   ┌────────┐
    52   │  cmd D │   │ cmd E  │
    53   └────────┘   └────────┘
    54  ```
    55  
    56  ## Features
    57  
    58  - **Small footprint**. Command launcher is around 10M, with no dependency to your OS.
    59  - **Technology agnostic**. It can launch commands implemented in any technology, and integrate to it with a simple manifest file.
    60  - **Auto-completion**. It supports auto-completion for all your commands installed by it.
    61  - **Auto-update**. Not only keeps itself but all its commands up-to-date.
    62  - **Credential management**. With the built-in login command, it securely passes user credential to your command.
    63  - **Progressive rollout**. Target a new version of command to a group of beta test users, and rollout progressively to all your users.
    64  - **Monitoring**. Built-in monitoring feature to monitor the usage your commands.
    65  - **Dropins**. Easy to intergrate your own command line scripts/tools by dropping your manifest in the "dropins" folder.
    66  
    67  ## Installation
    68  
    69  Pre-built binary can be downloaded from the release page. Unzip it, copy the binary into your PATH.
    70  
    71  The two pre-built binaries are named `cola` (**Co**mmand **La**uncher) and `cdt` (**C**riteo **D**ev **T**oolkit), if you want to use a different name, you can pass your prefered name in the build. See build section below.
    72  
    73  ## Build
    74  
    75  Requirements: golang >= 1.17
    76  
    77  You can build the command launcher with your prefered name (in the example: `Criteo Developer Toolkit`, a.k.a `cdt`).
    78  
    79  ```shell
    80  go build -o cdt -ldflags='-X main.version=dev -X main.appName=cdt -X "main.appLongName=Criteo Dev Toolkit"' main.go
    81  ```
    82  
    83  Or simply call the `build.sh` scripts
    84  
    85  ```shell
    86  ./build.sh [version] [app name] [app long name]
    87  ```
    88  
    89  ## Run tests
    90  
    91  Run unit tests
    92  
    93  ```shell
    94  go test -v ./...
    95  ```
    96  
    97  Run all integration tests
    98  
    99  ```shell
   100  ./test/integration.sh
   101  ```
   102  
   103  You can run one integration test by specify the name of the integration test file (without the .sh extension). The integration tests can be found in [`test/integration`](https://github.com/criteo/command-launcher/tree/main/test/integration) folder, for example:
   104  
   105  ```shell
   106  ./test/integration.sh test-remote
   107  ```
   108  
   109  ## Release
   110  
   111  Simply tag a commit with format 'x.y.z', and push it.
   112  
   113  ```shell
   114  git tag x.y.z
   115  git push origin x.y.z
   116  ```
   117  
   118  The supported release tag format:
   119  
   120  - \*.\*.\*
   121  - \*.\*.\*-\*
   122  
   123  Example: `1.0.0`, `1.0.1-preview`