Skip to main content

Smart CLI tool for shell template

Project description

glow

The glow command line interface.

PyPI version 📦 pypi

   ________    ____ _       __
  / ____/ /   / __ \ |     / /
 / / __/ /   / / / / | /| / /
/ /_/ / /___/ /_/ /| |/ |/ /
\____/_____/\____/ |__/|__/
____________________________
__________________________________
________________________________________

📦 Installation

pip install glow-cli

You can set up configuration in ~/.glow/commands/<task>.yml

🚀 Usage

g list

🦋 Templating

Say you set up a config at "./commands/pod-shell.yml"

description: |
  Entering the shell of the 1st pod that matches the keyword
command: |
  kubectl exec -it $(kubectl get pods | grep { kw } | head -n 1 | awk '{print $1}') -- /bin/bash
inputs:
  kw:
    description: keyword to match
    type: str

you can run the command with:

g ./commands/pod-shell.yml --kw "app1"

Or you can store the configuration by

g install ./commands/pod-shell.yml

Then you can run the command with:

g pod-shell --kw "app1"

Setup Configs and Secrets

Setup(CRUD) secrets

# to make secret token accessible to g command line
g secrets add SOME_TOKEN

g secrets list
g secrets remove SOME_TOKEN

Setup(CRUD) configs

g config add SOME_CONFIG "us-east-1"
g config list
g config remove SOME_CONFIG

🦙 LLM in CLI 💻

Why memorize commands when you can just ask?

Then you can try:

g llm "redub a.mp4 file with b.mp3, save to c.mp4 with fps 12"

Or you can ask other things in general:

g llm "explain btree to me"

Or with certain flavor to the robot role

g llm "explain btree to me" "you are a poet return everything in homer style"

✨ combine with other commands

Here's some good use cases to combine with other commands

g llm "shell into one of the pods: $(kubectl get pods) with keyword app1"
g llm "please summarize the commit message for $(git diff)"
g llm "can you explain the structure of this folder: $(ls -l)"

Choose other model

Use the following to choose other model

g configs add GLOW_LLM

Glow hub

Setup a hub on github to manage your glow commands. Say if the hub is at https://github.com/repo_owner/hub

Example structure of a hub:

./
├── README.md
├── glow
│   ├── README.md
│   ├── script-1.yml
│   ├── build-image.yml
│   ├── deploy-abc.yml

Setup

g secrets add GH_PATH
g configs add GLOW_HUB_OWNER repo_owner
g configs add GLOW_HUB_REPO hub

Install script

g glowhub script-1.yml

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glow_cli-0.3.6.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glow_cli-0.3.6-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file glow_cli-0.3.6.tar.gz.

File metadata

  • Download URL: glow_cli-0.3.6.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for glow_cli-0.3.6.tar.gz
Algorithm Hash digest
SHA256 b46e99ed8d03a94e9eb36ceb4891c9ee7d758e1bfffb6e8890d6cc32d2b41582
MD5 a39a74574485e3d07d46354185bb303a
BLAKE2b-256 55cdd760223cdb1b2b7a5a966721a11e325adc771444906873ae96230b0e91a7

See more details on using hashes here.

File details

Details for the file glow_cli-0.3.6-py3-none-any.whl.

File metadata

  • Download URL: glow_cli-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for glow_cli-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 57f677ffb7434c054e69f33ab9d1c2824079c4a1fe8b3a1e3756fd1c0ad3ce70
MD5 efce8066f4e107afee2b4eee5fdc2ce6
BLAKE2b-256 17ddd6b024fb61ff512b5ed6db42e7f3516b8eebf1c20edfd148bb48404ceb8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page