Skip to content

CLI to manage Eclipse Che server and workspaces

License

Notifications You must be signed in to change notification settings

aishwaryabk/chectl

 
 

Repository files navigation

chectl

Eclipse Che CLI

oclif Build Status

asciicast

Report issues

Issues are tracked on the main Eclipse Che Repository: https://github.com/eclipse/che/issues

New questions New bug

Table Of Contents

Installation

There are two channels of chectl: stable and next

Stable is for all tagged versions of Eclipse Che. Next is updated after each commit/Pull Request being merged in master branch of the Chectl repository.

If you're using Windows x64, here is how to install chectl by using one single PowerShell command:

  • For stable channel:
C:\Users> Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://www.eclipse.org/che/chectl/win/'))
  • For next channel:
C:\Users> $CHANNEL="next"; Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://www.eclipse.org/che/chectl/win/'))

If you're using linux or macOS, here is how to install chectl by using one single command:

  • For stable channel:
$ bash <(curl -sL  https://www.eclipse.org/che/chectl/)
  • For next channel:
$ bash <(curl -sL  https://www.eclipse.org/che/chectl/) --channel=next

Assemblies of chectl are available at https://github.com/che-incubator/chectl/releases

Manual install:

  1. Download a .tgz file based on your Operating System / Arch
  2. Unpack the assembly
  3. move chectl folder into a folder like $HOME/chectl
  4. add $HOME/chectl/bin to `$PATH``

Usage

$ chectl server:start
running command...

$ chectl server:stop
running command...

$ chectl workspace:start --devfile
running command...

$ chectl --help [COMMAND]
USAGE
  $ chectl COMMAND
...

Commands

chectl autocomplete [SHELL]

display autocomplete installation instructions

USAGE
  $ chectl autocomplete [SHELL]

ARGUMENTS
  SHELL  shell type

OPTIONS
  -r, --refresh-cache  Refresh cache (ignores displaying instructions)

EXAMPLES
  $ chectl autocomplete
  $ chectl autocomplete bash
  $ chectl autocomplete zsh
  $ chectl autocomplete --refresh-cache

See code: @oclif/plugin-autocomplete

chectl dashboard:open

Open Eclipse Che dashboard

USAGE
  $ chectl dashboard:open

OPTIONS
  -h, --help                       show CLI help

  -n, --chenamespace=chenamespace  [default: che] Kubernetes namespace where Eclipse Che server is supposed to be
                                   deployed

See code: src/commands/dashboard/open.ts

chectl devfile:generate

generate and print a devfile to stdout given some Kubernetes resources and other workspaces features (project, language-support, commands etc...)

USAGE
  $ chectl devfile:generate

OPTIONS
  -h, --help                 show CLI help
  --command=command          Command to include in the workspace
  --dockerimage=dockerimage  dockerimage component to include in the Devfile
  --editor=editor            Specify the editor component. Currently supported editors: theia-next,theia-1.0.0
  --git-repo=git-repo        Source code git repository to include in the workspace

  --language=language        Add support for a particular language. Currently supported languages:
                             java,typescript,go,python,c#

  --name=name                Workspace name

  --namespace=namespace      Kubernetes namespace where the resources are defined

  --plugin=plugin            Eclipse Che plugin to include in the workspace. The format is JSON. For example this is a
                             valid Eclipse Che plugin specification: {"type": "TheEndpointName.ChePlugin", "alias":
                             "java-ls", "id": "redhat/java/0.38.0"}

  --selector=selector        label selector to filter the Kubernetes resources. For example
                             --selector="app.kubernetes.io/name=employee-manager"

See code: src/commands/devfile/generate.ts

chectl help [COMMAND]

display help for chectl

USAGE
  $ chectl help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

chectl server:debug

Enable local debug of Eclipse Che server

USAGE
  $ chectl server:debug

OPTIONS
  -h, --help                               show CLI help

  -n, --chenamespace=chenamespace          [default: che] Kubernetes namespace where Eclipse Che server is supposed to
                                           be deployed

  --debug-port=debug-port                  [default: 8000] Eclipse Che server debug port

  --listr-renderer=default|silent|verbose  [default: default] Listr renderer

See code: src/commands/server/debug.ts

chectl server:delete

delete any Eclipse Che related resource: Kubernetes/OpenShift/Helm

USAGE
  $ chectl server:delete

OPTIONS
  -h, --help                               show CLI help

  -n, --chenamespace=chenamespace          [default: che] Kubernetes namespace where Eclipse Che server is supposed to
                                           be deployed

  --listr-renderer=default|silent|verbose  [default: default] Listr renderer

  --skip-deletion-check                    Skip user confirmation on deletion check

See code: src/commands/server/delete.ts

chectl server:logs

Collect Eclipse Che logs

USAGE
  $ chectl server:logs

OPTIONS
  -d, --directory=directory                Directory to store logs into
  -h, --help                               show CLI help

  -n, --chenamespace=chenamespace          [default: che] Kubernetes namespace where Eclipse Che server is supposed to
                                           be deployed

  --deployment-name=deployment-name        [default: che] Eclipse Che deployment name

  --listr-renderer=default|silent|verbose  [default: default] Listr renderer

See code: src/commands/server/logs.ts

chectl server:start

start Eclipse Che server

USAGE
  $ chectl server:start

OPTIONS
  -a, --installer=helm|operator|olm|minishift-addon
      Installer type

  -b, --domain=domain
      Domain of the Kubernetes cluster (e.g. example.k8s-cluster.com or <local-ip>.nip.io)
                           This flag makes sense only for Kubernetes family infrastructures and will be autodetected for 
      Minikube and MicroK8s in most cases.
                           However, for Kubernetes cluster it is required to specify.
                           Please note, that just setting this flag will not likely work out of the box.
                           According changes should be done in Kubernetes cluster configuration as well.
                           In case of Openshift, domain adjustment should be done on the cluster configuration level.

  -d, --directory=directory
      Directory to store logs into

  -h, --help
      show CLI help

  -i, --cheimage=cheimage
      [default: quay.io/eclipse/che-server:nightly] Eclipse Che server container image

  -m, --multiuser
      Starts Eclipse Che in multi-user mode

  -n, --chenamespace=chenamespace
      [default: che] Kubernetes namespace where Eclipse Che server is supposed to be deployed

  -o, --cheboottimeout=cheboottimeout
      (required) [default: 40000] Eclipse Che server bootstrap timeout (in milliseconds)

  -p, --platform=minikube|minishift|k8s|openshift|microk8s|docker-desktop|crc
      Type of Kubernetes platform. Valid values are "minikube", "minishift", "k8s (for kubernetes)", "openshift", "crc 
      (for CodeReady Containers)", "microk8s".

  -s, --tls
      Enable TLS encryption.
                           Note, this option is turned on by default.
                           For Kubernetes infrastructure, it is required to provide own certificate: 'che-tls' secret with 
      TLS certificate must be pre-created in the configured namespace.
                           The only exception is Helm installer. In that case the secret will be generated automatically.
                           For OpenShift, router will use default cluster certificates.
                           If the certificate is self-signed, '--self-signed-cert' option should be provided, otherwise 
      Che won't be able to start.
                           Please see docs for more details: 
      https://www.eclipse.org/che/docs/che-7/installing-che-in-tls-mode-with-self-signed-certificates/

  -t, --templates=templates
      Path to the templates folder

  --auto-update
      Auto update approval strategy for installation Eclipse Che.
                           With this strategy will be provided auto-update Eclipse Che without any human interaction.
                           By default strategy this flag is false. It requires approval from user.
                           To approve installation newer version Eclipse Che user should execute 'chectl server:update' 
      command.
                           This parameter is used only when the installer is 'olm'.

  --catalog-source-yaml=catalog-source-yaml
      Path to a yaml file that describes custom catalog source for installation Eclipse Che operator.
                           Catalog source will be applied to the namespace with Che operator.
                           This parameter is used only when the installer is the 'olm'.

  --che-operator-cr-patch-yaml=che-operator-cr-patch-yaml
      Path to a yaml file that overrides the default values in CheCluster CR used by the operator. This parameter is used 
      only when the installer is the operator.

  --che-operator-cr-yaml=che-operator-cr-yaml
      Path to a yaml file that defines a CheCluster used by the operator. This parameter is used only when the installer 
      is the operator.

  --che-operator-image=che-operator-image
      [default: quay.io/eclipse/che-operator:nightly] Container image of the operator. This parameter is used only when 
      the installer is the operator

  --debug
      Enables the debug mode for Eclipse Che server. To debug Eclipse Che server from localhost use 'server:debug' 
      command.

  --deployment-name=deployment-name
      [default: che] Eclipse Che deployment name

  --devfile-registry-url=devfile-registry-url
      The URL of the external Devfile registry.

  --k8spodreadytimeout=k8spodreadytimeout
      [default: 130000] Waiting time for Pod Ready Kubernetes (in milliseconds)

  --k8spodwaittimeout=k8spodwaittimeout
      [default: 300000] Waiting time for Pod Wait Timeout Kubernetes (in milliseconds)

  --listr-renderer=default|silent|verbose
      [default: default] Listr renderer

  --olm-channel=olm-channel
      Olm channel to install Eclipse Che, f.e. stable.
                           If options was not set, will be used default version for package manifest.
                           This parameter is used only when the installer is the 'olm'.

  --os-oauth
      Enable use of OpenShift credentials to log into Eclipse Che

  --package-manifest-name=package-manifest-name
      Package manifest name to subscribe to Eclipse Che OLM package manifest.
                           This parameter is used only when the installer is the 'olm'.

  --plugin-registry-url=plugin-registry-url
      The URL of the external plugin registry.

  --postgres-pvc-storage-class-name=postgres-pvc-storage-class-name
      persistent volume storage class name to use to store Eclipse Che postgres database

  --self-signed-cert
      Authorize usage of self signed certificates for encryption.
                           This is the flag for Eclipse Che to propagate the certificate to components, so they will trust 
      it.
                           Note that `che-tls` secret with CA certificate must be created in the configured namespace.

  --skip-cluster-availability-check
      Skip cluster availability check. The check is a simple request to ensure the cluster is reachable.

  --skip-version-check
      Skip minimal versions check.

  --starting-csv=starting-csv
      Starting cluster service version(CSV) for installation Eclipse Che.
                           Flags uses to set up start installation version Che.
                           For example: 'starting-csv' provided with value 'eclipse-che.v7.10.0' for stable channel.
                           Then OLM will install Eclipse Che with version 7.10.0.
                           Notice: this flag will be ignored with 'auto-update' flag. OLM with auto-update mode installs 
      the latest known version.
                           This parameter is used only when the installer is 'olm'.

  --workspace-pvc-storage-class-name=workspace-pvc-storage-class-name
      persistent volume(s) storage class name to use to store Eclipse Che workspaces data

See code: src/commands/server/start.ts

chectl server:stop

stop Eclipse Che server

USAGE
  $ chectl server:stop

OPTIONS
  -h, --help                               show CLI help

  -n, --chenamespace=chenamespace          [default: che] Kubernetes namespace where Eclipse Che server is supposed to
                                           be deployed

  --access-token=access-token              Eclipse Che OIDC Access Token

  --che-selector=che-selector              [default: app=che,component=che] Selector for Eclipse Che server resources

  --deployment-name=deployment-name        [default: che] Eclipse Che deployment name

  --listr-renderer=default|silent|verbose  [default: default] Listr renderer

See code: src/commands/server/stop.ts

chectl server:update

update Eclipse Che server

USAGE
  $ chectl server:update

OPTIONS
  -a, --installer=helm|operator|minishift-addon|olm                            Installer type
  -h, --help                                                                   show CLI help

  -n, --chenamespace=chenamespace                                              [default: che] Kubernetes namespace where
                                                                               Eclipse Che server is supposed to be
                                                                               deployed

  -p, --platform=minikube|minishift|k8s|openshift|microk8s|docker-desktop|crc  Type of Kubernetes platform. Valid values
                                                                               are "minikube", "minishift", "k8s (for
                                                                               kubernetes)", "openshift", "crc (for
                                                                               CodeReady Containers)", "microk8s".

  -t, --templates=templates                                                    [default: templates] Path to the
                                                                               templates folder

  --che-operator-image=che-operator-image                                      [default:
                                                                               quay.io/eclipse/che-operator:nightly]
                                                                               Container image of the operator. This
                                                                               parameter is used only when the installer
                                                                               is the operator

  --deployment-name=deployment-name                                            [default: che] Eclipse Che deployment
                                                                               name

  --listr-renderer=default|silent|verbose                                      [default: default] Listr renderer

  --skip-version-check                                                         Skip user confirmation on version check

See code: src/commands/server/update.ts

chectl update [CHANNEL]

update the chectl CLI

USAGE
  $ chectl update [CHANNEL]

See code: @oclif/plugin-update

chectl workspace:create

Creates a workspace from a devfile

USAGE
  $ chectl workspace:create

OPTIONS
  -d, --debug                      Debug workspace start. It is useful when workspace start fails and it is needed to
                                   print more logs on startup. This flag is used in conjunction with --start flag.

  -f, --devfile=devfile            Path or URL to a valid devfile

  -h, --help                       show CLI help

  -n, --chenamespace=chenamespace  [default: che] Kubernetes namespace where Eclipse Che server is supposed to be
                                   deployed

  -s, --start                      Starts the workspace after creation

  --access-token=access-token      Eclipse Che OIDC Access Token

  --name=name                      Workspace name: overrides the workspace name to use instead of the one defined in the
                                   devfile.

See code: src/commands/workspace/create.ts

chectl workspace:delete WORKSPACE

delete a user's workspace

USAGE
  $ chectl workspace:delete WORKSPACE

ARGUMENTS
  WORKSPACE  The workspace id to delete

OPTIONS
  -h, --help                       show CLI help

  -n, --chenamespace=chenamespace  [default: che] Kubernetes namespace where Eclipse Che server is supposed to be
                                   deployed

  --access-token=access-token      Eclipse Che OIDC Access Token

  --delete-namespace               Indicates that a Kubernetes namespace where workspace was created will be deleted as
                                   well

See code: src/commands/workspace/delete.ts

chectl workspace:inject

inject configurations and tokens in a workspace

USAGE
  $ chectl workspace:inject

OPTIONS
  -c, --container=container        The container name. If not specified, configuration files will be injected in all
                                   containers of the workspace pod

  -h, --help                       show CLI help

  -k, --kubeconfig                 (required) Inject the local Kubernetes configuration

  -n, --chenamespace=chenamespace  [default: che] Kubernetes namespace where Eclipse Che server is supposed to be
                                   deployed

  -w, --workspace=workspace        The workspace id to inject configuration into. It can be omitted if the only one
                                   running workspace exists.
                                   Use workspace:list command to get all workspaces and their
                                   statuses.

  --access-token=access-token      Eclipse Che OIDC Access Token

  --kube-context=kube-context      Kubeconfig context to inject

See code: src/commands/workspace/inject.ts

chectl workspace:list

list workspaces

USAGE
  $ chectl workspace:list

OPTIONS
  -h, --help                       show CLI help

  -n, --chenamespace=chenamespace  [default: che] Kubernetes namespace where Eclipse Che server is supposed to be
                                   deployed

  --access-token=access-token      Eclipse Che OIDC Access Token

See code: src/commands/workspace/list.ts

chectl workspace:logs

Collect workspace(s) logs

USAGE
  $ chectl workspace:logs

OPTIONS
  -d, --directory=directory                Directory to store logs into
  -h, --help                               show CLI help

  -n, --namespace=namespace                (required) The namespace where workspace is located. Can be found in
                                           workspace configuration 'attributes.infrastructureNamespace' field.

  -w, --workspace=workspace                (required) Target workspace id. Can be found in workspace configuration 'id'
                                           field.

  --listr-renderer=default|silent|verbose  [default: default] Listr renderer

See code: src/commands/workspace/logs.ts

chectl workspace:start WORKSPACE

Starts a workspace

USAGE
  $ chectl workspace:start WORKSPACE

ARGUMENTS
  WORKSPACE  The workspace id to start

OPTIONS
  -d, --debug                      Debug workspace start. It is useful when workspace start fails and it is needed to
                                   print more logs on startup.

  -h, --help                       show CLI help

  -n, --chenamespace=chenamespace  [default: che] Kubernetes namespace where Eclipse Che server is supposed to be
                                   deployed

  --access-token=access-token      Eclipse Che OIDC Access Token

See code: src/commands/workspace/start.ts

chectl workspace:stop WORKSPACE

Stop a running workspace

USAGE
  $ chectl workspace:stop WORKSPACE

ARGUMENTS
  WORKSPACE  The workspace id to stop

OPTIONS
  -h, --help                       show CLI help

  -n, --chenamespace=chenamespace  [default: che] Kubernetes namespace where Eclipse Che server is supposed to be
                                   deployed

  --access-token=access-token      Eclipse Che OIDC Access Token

See code: src/commands/workspace/stop.ts

Contributing

Contributing to chectl is covered in CONTRIBUTING.md

About

CLI to manage Eclipse Che server and workspaces

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 95.7%
  • Shell 4.3%