JSPM

ev-setup

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 51
  • Score
    100M100P100Q6484F
  • License MIT

CLI tool for managing environment files and authentication with Firebase and Hasura

Package Exports

  • ev-setup
  • ev-setup/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ev-setup) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Environment CLI Tool

A command-line tool for managing environment files and authentication with Firebase and Hasura.

Installation

# Install dependencies
yarn install

# Build the CLI tool
yarn build

# Link the CLI tool to make it globally available
yarn link

Commands

Authentication

Login

Authenticate with GitHub:

esu login

This command will initiate a GitHub device flow authentication process. Follow the instructions to complete the authentication.

Logout

Sign out of the current session:

esu logout

Status

Check the current authentication status:

esu status

User ID

Get the current authenticated user's ID:

esu user-id

Environment Management

Restore

Fetch environment files from Hasura and save them to the local filesystem:

esu restore

Options:

  • -d, --directory <dir>: Target directory to save files (default: current directory)
  • -v, --verbose: Show detailed information about the restore process

Example:

# Restore files to a specific directory with verbose output
esu restore -d ./config -v

Configuration

The CLI tool uses Firebase authentication with JWT to authenticate with Hasura. Authentication state is persisted between sessions using file-based storage at .appwrapsrc.

Development

# Run the CLI in development mode
yarn dev <command>

# For example, to run the login command
yarn dev login

Bundling for Arch Linux

The CLI tool can be bundled into a standalone executable for Arch Linux using Node.js 18:

# Install pkg as a development dependency
yarn add --dev pkg

# Build the TypeScript code
yarn build

# Create the standalone executable
yarn pkg

This will create a standalone executable at bin/esu that can be distributed and run without Node.js dependencies.

Creating an Arch Linux Package

  1. Create a PKGBUILD file:
# PKGBUILD
pkgname=esu
pkgver=1.0.0
pkgrel=1
pkgdesc="Environment Setup CLI Tool"
arch=('x86_64')
url="https://github.com/yourusername/env-setup"
license=('MIT')
depends=()
makedepends=()
source=("$pkgname-$pkgver.tar.gz")
sha256sums=('SKIP')

package() {
  install -Dm755 "$srcdir/esu" "$pkgdir/usr/bin/esu"
}
  1. Build the package:
# Build the standalone executable
cd cli && yarn pkg

# Create a tarball containing the executable
mkdir -p dist/pkg
cp bin/esu dist/pkg/
cd dist/pkg
tar -czf esu-1.0.0.tar.gz esu
cd ../..

# Build the Arch package
makepkg -si
  1. Install the package:
sudo pacman -U esu-1.0.0-1-x86_64.pkg.tar.zst

License

MIT