hckr env

Environment commands

hckr env [OPTIONS] COMMAND [ARGS]...

get

This command returns value for an environment variable from all available environment variables

Example Usage:

  • Getting a value for GITHUB_USER env variable

Tip

If your environment variable is not set you will get an error message.

$ hckr env get GITHUB_USER

Command Reference:

hckr env get [OPTIONS] VARIABLE

Arguments

VARIABLE

Required argument

list

This command show list all environment variables, we can also filter them by regex pattern using -p/--pattern option and we can also apply to ignore cases of a pattern using -i/--ignore-case option

Example Usage:

  • Listing all Environment variables

$ hckr env list
  • Similarly, We can filter the environment vars with -p/--pattern option

$ hckr env list -p 'PYENV'
  • Additionally, We can also allow ignoring case filters using -i/--ignore-case option

$ hckr config list --all

Command Reference:

hckr env list [OPTIONS]

Options

-p, --pattern <pattern>
-i, --ignore-case

Ignore case distinctions.

set

This command adds a new entry to your environment variables by updating your profile ( ~/.zshrc or ~/.bashrc etc.)

Example Usage:

  • Setting an environment variable in your current shell profile ( ~/.zshrc or ~/.bashrc )

$ hckr env set GITHUB_USER pateash

Tip

By default when we run this command it will infer shell type from current shell. for writing it inside different shell profile either you can pass it as an option using -s / --shell as shown below.

  • If We want to provide shell type explicitly, we can use -s/--shell option

$ hckr env set GITHUB_USER pateash --shell bash

Command Reference:

hckr env set [OPTIONS] VARIABLE_NAME VARIABLE_VALUE

Options

--shell <shell>

Shell type

Options:

bash | zsh

Arguments

VARIABLE_NAME

Required argument

VARIABLE_VALUE

Required argument