# openscript

Openscript allows users to maintain a linux-based operations system without a deep terminal familiarity.

[Website](http://openscript.run)

# Backend

The backend of openscript is written using the serverless framework and is maintained by the AWS ecosystem. It exposes a graphql endpoint which is used from the clients to interact with the platform.

[GraphQL IDE](https://openscript.run/graphql)

# NPM CLI client

Use the CLI client to execute and publish your own scripts.

[NPM Package](https://www.npmjs.com/package/openscript)

## Installation

```
npm install -g openscript
// OR
yarn global install openscript
```

## Register to the platform

```
// SIGNUP AND ACTIVATE YOU ACCOUNT
XXXXXX:~$ openscript signup

> Username (E-Mail): xxxxx@mail.com
> Password: 
> LOG: A confirmation code has been sent to xxxxx@mail.com.
> Enter verification code: 099615
> LOG: Account confirmed.

// LOGIN TO YOUR ACTIVATED ACCOUNT
XXXXXX:~$ openscript login

> Username (E-Mail): xxxxx@mail.com   
> Password: 
> LOG: Successfully logged in.
```

after your successful login you are able to use the additional commands to publish OR update your own scripts.

## Publish a script


Here is an example of a simple script:

`./foo.yml`
```yml
# Name of the package
name: foobar

# The script version
version: 0.0.1

# The package description (what kind of problem does it solve ?)
description: This is the foo script assigned to the bar namespace

# The name space of the package. (if not reserved)
namespace: bar # optional

# The commands will be executed as superuser after a user-warning
superuser: false # optional

# Array of scripts which represents to executed command on the users system
execute:
    - echo "hello foo"
```

use now the following command to test your script on the local system:

```
XXXXXX:~$ openscript execute ./foo.yml

> hello foo
> LOG: Execution was successful.
```

finally publish the package using your logged in session:

```
XXXXXX:~$ openscript publish ./foo.yml

> LOG: Update subscription token...
> Subscription connection closed
> LOG: Script bar/foobar@0.0.1 successfully published.
```

# Feature UI client

The UI client for normal desktop users is not implemented yet, but the UI client is the final goal of the project.
