1.1.3 • Published 10 months ago

ellah v1.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

Ellah: CLI for syncing developer resources and alias

Table of Contents

Introduction

Ellah is a powerful command line interface (CLI) tool designed to synchronize scripts and aliases across multiple devices. It allows users to add, remove, execute, and manage files via a simple and intuitive set of commands. With Ellah, you can make your development setup consistent across all your machines, simplifying your workflow and boosting your productivity.

Upcoming

Since this tool was specifically created for a specific need of mine, I'm still looking into supporting further file providers such as Dropbox etc. With ease you could configure Ellah to use your Dropbox API key instead of AWS IAM.

Backlog

  • Support Dropbox
  • Improve sync functionality

Why Ellah

Developers often deal with repetitive setup processes across different operating systems, which can be tedious and time-consuming. Ellah was designed to address this problem, offering a streamlined solution for developers.

With Ellah, you can:

  • Sync your scripts and aliases all devices, regardless of the OS.
  • Automatically add scripts and aliases to your OS-specific profile or maintain default aliases across all platforms.
  • Run cloud-stored scripts directly from your command line, including bash scripts on a Windows machine.
  • Easily manage resources with quick commands.
  • Maintain a consistent, efficient workflow, whether you're coding on MacOS or Windows.
  • Furthermore, Ellah allows you to export, import, and encrypt your config file, making it effortless to sync up a new computer. It's an essential tool for developers seeking simplicity and efficiency across multiple platforms.

Installation

npm install -g ellah

Set default editor when editing files in ellah CLI. Default for unix is nano. If you're on windows and doesn't have nano or vim installed it defaults to notepad. Supported editors:

  • nano
  • vi
  • notepad (default windows fallback)
ellah config set editor [myEdtior]

Step 1

Option 1 - Configure by using your local AWS IAM profile credentials (recommended for first time users with AWS configured)

Set your accessKeyId and secretAccessKey using your local ~/.aws configuration

Run Ellah to view your profiles in ~/.aws

ellah aws iam profile ls

View credentials of selected profile

ellah aws iam profile get <profileName>

Configure Ellah to use your profile credentials

ellah aws iam profile use <profileName>

View your current config, all keys should be defined.

ellah config ls

Option 2 - Setup using export and import (recommended to use this step if you're configuring for another computer)

After running export you'll be prompted to enter a password to encrypt the contents of your configuration file.

ellah config export ./path/to/export

After runnig import you'll be prompted to enter your password in order to decrypt the contents.

ellah config import ./path/to/export/config.enc

View your imported config

ellah config ls

Option 3 - Manually set your accessKeyId and secretAccessKey

Set your file provider. At the moment only Amazon S3 is supported.

ellah config set provider s3

Configure your S3 credentials

Setup AWS access keys

ellah aws set accessKeyId [myAccessKeyId]
ellah aws set secretAccessKey [mySecretAccessKey]

Step 2

Option 1 - Manually configure your S3 bucket

ellah config set provider s3

Once logged in with IAM you can list your buckets

ellah aws bucket ls
ellah aws bucket ls --region eu-north-1

Set a bucket name

ellah aws set bucketName [myBucket]

Set a region for Ellah to always use

ellah aws set region [myRegion]

Option 2 - Create and use a new S3 bucket

With Ellah you can use your IAM configuration to create a bucket with ease.

Create a new bucket Use the --use argument to configure Ellah to use your new bucket and region, if provided.

ellah aws bucket create [bucketName] --use --region [region]

View your current config, all keys should be defined.

ellah config ls

How to Use

Here's the basic command structure of Ellah:

ellah [entity] [action] [file] [args]

General examples

Here are some examples:

  • To list all aliases

     ellah alias ls
  • To list OS specific aliases (win or unix)

     ellah alias ls --os win
    • To create a new alias
     ellah alias new mySharedBashFile.sh
     ellah alias new myMacFile.sh --os unix
     ellah alias new myWinFile.sh --os win
  • To add an alias

     ellah alias add mySharedBashFile.sh
     ellah alias add myMacFile.sh --os unix
     ellah alias add myWinFile.sh --os win
  • To remove an alias

     ellah alias rm mySharedBashFile.sh
  • To list all scripts:

    ellah script ls
  • To execute a script:

    ellah script exec script.sh
  • To move a script:

    ellah script mv script.sh destinationPath/script.sh
    ellah script mv script.sh newscriptname.sh
  • To remove a script:

    ellah script rm script.sh
  • To open the original source of a script:

    ellah script origin script.sh

For a complete list of commands and their explanations, please refer to the Commands section.

You can expect to find the same actions for all entities. Actions include but are not limited to:

  • add (add a file or object)
  • rm (remove a file or object)
  • mv (move a file or object)
  • open (open a file, link or object)
  • origin (open origin file hosted on your file provider)
  • cp (copy file or object)
  • edit (edit file)

Alias

With alias you can add bash scripts to be automatically synced between your devices .bash_profile. Get easy access to your personal aliases, functions and workflows.

example

nano git_alias.sh
# git_alias.sh
#!/bin/bash

alias gp="git push"
alias gpf="git push --force"
alias gadd="git add ."
gcom() {
  git commit -m "$1"
}
grebase() {
  git rebase -i HEAD~$1
}

Add for all your devices OS

ellah alias add git_alias.sh

Add this alias only for devices with Windows OS

ellah alias add git_alias.sh --os win

Add this alias only for devices with Mac OS

ellah alias add git_alias.sh --os unix

Listing your alises should now include git_alias.sh

ellah alias ls

Your .bash_profile now includes:

--- ELLAH START ---
source ./path/to/user/.ellah-cli/alias/git_alias.sh
--- ELLAH END ---

Your S3 bucket includes a folder with your alias file as alias/git_alias.sh.

Remove an alias

ellah alias rm git_alias.sh

Contribution

Ellah is an open-source project, and we welcome contributions of all sorts. Whether you're fixing bugs, improving documentation, or proposing new features, your efforts are greatly appreciated. Please check out our Contribution Guidelines for detailed instructions.

License

Ellah is licensed under the MIT license.

Contact

For any questions, suggestions, or just to say hello, feel free to reach out at hej@jimmiem.se.

1.1.1

11 months ago

1.1.3

10 months ago

1.1.2

10 months ago

1.1.0

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago