1.3.1 • Published 3 years ago

clei v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Environments CLI

Important

  • Just tested in MacOS
  • Using crypto
    • Just tested with the aes-256-ctr algorithm for file encryption. Must use AES algorithms
      • Cipher key must be 32 chars for the 256 algorithms
  • A users-projects.json is used as our database.
    • It's encrypted in S3, so we can't edit it directly
    • It should contain all users, admins, projects and user permissions in projects.
  • Install the project locally with npm install -g

Requirements

  • Single Folder for all Projects
    • Ex: /Users/user1/Developer/
  • AWS Private Bucket
  • Tested with Node Versions >= 12.x.x

User Usage

command clei stands for Command Line Environment Interface

Config

clei config

  • Configures the environment for a non-admin user

    Asks forDescription
    Your emailYour email
    Your KeyKey provided by admin
    DataData provided by admin
    Your Projects PathPath containing all your projects in your computer

Re-configure

clei path

  • Sets you local path for your projects in your computer

    Asks forDescription
    Your Projects PathA valid path in your computer

clei email

  • Sets you email to authorization your projects environments

    Asks forDescription
    Your EmailA valid email

clei key

  • Sets you key to authorization your projects environments

    Asks forDescription
    Your KeyA valid key

Download environment

clei download

  • Downloads the environment file for a project, decrypts it and overwrites it on the disk if exists.
  • The project needs to exist in your computer.

    Asks forDescription
    Project NameA valid Project Name
    StageThe stage(s) of the environment to be downloaded
  • This command could be inlined with clei download PROJECT STAGE

    • Multiple stages should be separated by commas
    • For multiple json files the first stage will be applied to the file

Output environment

clei output

  • Downloads the environment file for a project, decrypts it and outputs it in process.stdout.write
  • The project needs to exist in your computer.

    Asks forDescription
    Project NameA valid Project Name
    StageThe stage(s) of the environment to be downloaded
  • This command could be inlined with clei download PROJECT STAGE

    • Multiple stages should be separated by commas
    • For multiple json files the first stage will be applied to the file

Admin Usage

command clei stands for Command Line Environment Interface

Initialize

clei init

  • Setups the environment for the admin and Creates the users-projects.json Encrypted JSON file in S3.

    Asks forDescription
    Encryption AlgorithmAlgorithm to encrypt files. Defaults to aes-256-ctr
    File KeyKey to encrypt and decrypt files. Must be 32 characters in length
    AWS Access Key IDYour AWS Access Key ID
    AWS Secret Access KeyYour AWS Secret Access Key
    AWS Bucket NameThe name of the bucket where the credentials will be stored. It's recommended to make it private and use AWS encryption
    Admin EmailFirst email to be configured as admin
    Admin NameName of the admin
    Projects PathPath containing all projects in your computer

Share environment variables

clei share

  • Generates an encrypted string with the target user key

    Asks forDescription
    User Emailemail from the target user

CRUD Credentials

clei get credential

  • Gets the credential value for a project

    Asks forDescription
    Project nameThe name of the folder where the project is stored
    StageThe stage from the credential
    KeyThe key for the credential. Case Sensitive
  • This command could be inlined with clei get credential PROJECT STAGE KEY

clei create credential

  • creates a credential value for a project

    Asks forDescription
    Project NameThe name of the folder where the project is stored. It should match with the same name in the users-projects.json file
    StagesThe stages for the environments files to add the credential to. It takes the stages configured in the users-projects.json file as inputs.
    Credential typeOnly if project type is not .env. Value Type of the credential that will be added (string, boolean, int, float)
    Credential KeyThe Key for your credential. For nested credentials you can separate it using a dot. (ex: the keys for { DB_HOST: { MYSQL: 'local' } should be specified as DB_HOST.MYSQL})
    Credential ValueThe Value for your credential.
  • This command could be inlined with clei create credential PROJECT STAGE KEY TYPE VALUE

    • STAGE could be multiple stages separated by commas
    • TYPE is only necessary on .json files
    • VALUE should match type (only on .json files)

clei update credential

  • updates a credential value for a project stage or stages

    Asks forDescription
    Project NameThe name of the folder where the project is stored. It should match with the same name in the users-projects.json file
    StagesThe stages for the environments files to add the credential to. It takes the stages configured in the users-projects.json file as inputs.
    Credential typeOnly if project type is not .env. Value Type of the credential that will be added (string, boolean, int, float)
    Credential KeyThe Key for your credential. For nested credentials you can separate it using a dot. (ex: the keys for { DB_HOST: { MYSQL: 'local' } should be specified as DB_HOST.MYSQL})
    Credential ValueThe Value for your credential.
  • This command could be inlined with clei update credential PROJECT STAGE KEY TYPE VALUE

    • STAGE could be multiple stages separated by commas
    • TYPE is only necessary on .json files
    • VALUE should match type (only on .json files)

CRUD Users

clei get user

  • Gets the user details in users-projects.json

    Asks forDescription
    User Emailemail from the user. Leave blank for all users

clei create user

  • Creates a user in the users-projects.json file. Generates a random string with 16 characters as key

    Asks forDescription
    User Email to searchUser Email corresponding to the user that we want to edit
    New NameNew User Name
    New EmailNew User Email
    Generate new key?If yes it generates a new key for the user

clei update user

  • Updates an existing user in the users-projects.json file.

    Asks forDescription
    NameUser Name
    EmailUser Email

clei delete user

  • Deletes the user from users-projects.json

    Asks forDescription
    User Emailemail from the user to be deleted

CRUD Projects

clei get project

  • Gets the project details in users-projects.json

    Asks forDescription
    Project NameProject Name. Leave blank for all projects

clei create project

  • Creates a project in the users-projects.json file.

    Asks forDescription
    Project NameThe name of the folder where the project will be stored
    Environment File pathThe internal path for the environment files in the project
    Environment File FormatThe name format for the environment files. STAGE will be replaced accordingly
    StagesThe stages for the project separated by commas

clei update project

  • Updates an existing project in the users-projects.json file.

    Asks forDescription
    Project NameThe name of the folder to search to update the project
    New Project Name to searchThe new name of the folder where the project will be stored
    New Environment File pathThe new internal path for the environment files in the project
    New Environment File FormatThe new name format for the environment files. STAGE will be replaced accordingly
    New StagesThe new stages for the project separated by commas

clei delete project

  • delete the project from users-projects.json

    Asks forDescription
    Project NameProject Name of the project to be deleted

Credentials File

clei add file

  • Uploads a local environment file to the S3 bucket.
  • The Project needs to exist in the users-projects.json file and in your computer.
  • This action overwrites the file in the bucket so use it carefully

    Asks forDescription
    Project NameThe name of the folder where the project is stored. It should match with the same name in the users-projects.json file
    StageThe stage for the environment file that will be uploaded. It takes the stages configured in the users-projects.json file as inputs. (If the file is multiple-json then we should check all the stages that we want to make available)
    Environment File FormatThe name format for the environment files. STAGE will be replaced accordingly
    StagesThe stages for the project separated by commas

clei delete file

  • Deletes a file from a project on the S3 bucket.
  • The Project needs to exist in the users-projects.json

    Asks forDescription
    Project NameThe name of the folder where the project is stored. It should match with the same name in the users-projects.json file
    FilesSelect the files that you wish to delete from s3

Manage User Access to Projects

clei access

  • Manage a user stages authorization to a project

    Asks forDescription
    User EmailThe user email that will be authorized
    Project NameThe name of the folder where the project is stored.
    Stages grantedThe stages to give permissions to the user

Manage admins

clei auth

  • Manage a user admin permissions

    Asks forDescription
    User EmailThe user email that will be authorized
    ActionsThe actions that this admin can perform
1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago