Giter VIP home page Giter VIP logo

core-cli-go's Introduction

CLI for datarhei Core

A CLI for connection to instances of datarhei Core. Currently only Core versions 16+ are supported.

Installation

go install github.com/datarhei/core-cli-go@latest

This will the CLI binary to $GOPATH/bin/core-cli-go. You can rename that file (until the -o option is allowed for go install) to a more consice name:

mv $GOPATH/bin/core-cli-go $GOPATH/bin/corecli

Usage

You see all commands when you call the binary without any arguments:

$ corecli                                                                                                                                git:main cmd:0
A CLI for the datarhei Core.

Usage:
  corecli [command]

Available Commands:
  config      Config related commands
  core        Core related commands
  editor      Editor related commands
  fs          Filesystem related commands
  help        Help about any command
  log         Logging related commands
  metadata    Metadata related commands
  metrics     Metrics related commands
  process     Process related commands
  skills      FFmpeg skills related commands
  srt         SRT related commands

Flags:
      --config string   config file (default is $HOME/.corecli.json)
  -h, --help            help for corecli

Use "corecli [command] --help" for more information about a command.

Quick start

You first have to add a core to the list of known cores and give it the name mycore:

corecli core add mycore http://127.0.0.1:8080 --username admin --password datarhei

Now you can list all known cores:

$ corecli core list
┌───────-─┬────────────────────────────┬─────────┬──────┬────┐
│ NAME    │ HOST                       │ VERSION │ NAME │ ID │
├───────-─┼────────────────────────────┼─────────┼──────┼────┤
│ *mycore │ http://127.0.0.1:8080      │         │      │    │
└──────-──┴────────────────────────────┴─────────┴──────┴──-─┘

The star denotes the currently selected core that all other commands refer to.

Try to connect to the core by issuing any command, e.g.

$ corecli core about
raspy-lake-6361 16.11.0 (darwin/amd64) 51c6f26c-2352-4403-95d3-a008d9edd81d @ http://127.0.0.1:8080
{
  "app": "datarhei-core",
  "auths": [],
  "created_at": "2022-12-22T07:17:28+01:00",
  "id": "51c6f26c-2352-4403-95d3-a008d9edd81d",
  "name": "raspy-lake-6361",
  "uptime_seconds": 11,
  "version": {
    "arch": "darwin/amd64",
    "build_date": "",
    "compiler": "go1.19.4",
    "number": "16.11.0",
    "repository_branch": "",
    "repository_commit": ""
  }
}

Adding a process

Print out a template for the process configuration:

corecli process template > process.json

Now modify the process configuration to your needs and create to the process on the core:

corecli process add < process.json

The moment the process is created on the core you can edit it on-the-fly (assume that the process has the ID example):

corecli process edit example

This will open the process config in the system's default editor. If you want to use a different editor, specify it with e.g. core editor set /usr/bin/nano). After saving the process config, it will replace the one currently on the core.

Use the process commands in order to control the process:

corecli process start example

List all processes on the core:

corecli process list

Get details for one specific process:

corecli process show example

Remove the process:

corecli process delete example

core-cli-go's People

Contributors

ioppermann avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.