Full Code of rauchg/wifi-password for AI

master d17a0dd80846 cached
5 files
3.7 KB
1.3k tokens
2 requests
Download .txt
Repository: rauchg/wifi-password
Branch: master
Commit: d17a0dd80846
Files: 5
Total size: 3.7 KB

Directory structure:
gitextract_t8lccz_i/

├── History.md
├── Readme.md
├── package.json
├── wifi-password.plugin.zsh
└── wifi-password.sh

================================================
FILE CONTENTS
================================================

================================================
FILE: History.md
================================================

0.1.0 / 2015-02-14
==================

 * default to `quiet` when piping (non-tty)

0.0.1 / 2015-02-14
==================

 * initial release


================================================
FILE: Readme.md
================================================

# wifi-password

People ask you for the Wi-Fi password. Answer quickly. **macOS only**.
[Windows version](https://github.com/RReverser/WiFi-Password).

![](https://i.cloudup.com/uUo8iSbKXRh/km6iJT.gif)

## How to use

**1. Install it**

With [bpkg](https://github.com/bpkg/bpkg):

```
$ bpkg install rauchg/wifi-password
```

With [Homebrew](https://github.com/Homebrew/homebrew):

```
$ brew install wifi-password
```

With [Antigen](https://github.com/zsh-users/antigen):

Add `antigen bundle rauchg/wifi-password` to your `.zshrc` with your other antigen commands

With [Zgen](https://github.com/tarjoilija/zgen)

Add `zgen load rauchg/wifi-password` to your `.zshrc` with your other zgen commands

or with `curl`:

```
curl -L https://raw.github.com/rauchg/wifi-password/master/wifi-password.sh -o ~/bin/wifi-password && chmod +x ~/bin/wifi-password
```

If you don't have `~/bin` in your `$PATH`, replace it with `/usr/local/bin` or
similar.

**2. Use it:**

To get the password for the WiFi you're currently logged onto:

```
$ wifi-password
```

To get it for a specific SSID:

```
$ wifi-password <ssid>
```

To put it straight in your clipboard for pasting elsewhere (OS X only):

```
$ wifi-password | pbcopy
```

## License

MIT


================================================
FILE: package.json
================================================
{
  "name": "wifi-password",
  "version": "0.1.0",
  "description": "People ask you for the Wi-Fi password. Answer quickly.",
  "global": "1",
  "install": "install -b wifi-password.sh ${PREFIX:-/usr/local}/bin/wifi-password",
  "scripts": [ "wifi-password.sh" ]
}



================================================
FILE: wifi-password.plugin.zsh
================================================
# This plugin is MIT licensed.
#
# Make git-open easy to install and keep up to date if you're using a
# ZSH framework like Zgen or Antigen

export PATH=$(dirname $0):${PATH}


================================================
FILE: wifi-password.sh
================================================
#!/usr/bin/env sh

version="0.1.0"

# locate airport(1)
airport="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport"
if [ ! -f $airport ]; then
  echo "ERROR: Can't find \`airport\` CLI program at \"$airport\"."
  exit 1
fi

# by default we are verbose (unless non-tty)
if [ -t 1 ]; then
  verbose=1
else
  verbose=
fi

# usage info
usage() {
  cat <<EOF

  Usage: wifi-password [options] [ssid]

  Options:
    -q, --quiet      Only output the password.
    -V, --version    Output version
    -h, --help       This message.
    --               End of options

EOF
}

# parse options
while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do
  case $1 in
    -V | --version )
      echo $version
      exit
      ;;
    -q | --quiet )
      verbose=
      ;;
    -h | --help )
      usage
      exit
      ;;
  esac
  shift
done
if [[ "$1" == "--" ]]; then shift; fi

# merge args for SSIDs with spaces
args="$@"

# check for user-provided ssid 
if [ "" != "$args" ]; then
  ssid="$@"
else
  # get current ssid
  ssid="`$airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'`"
  if [ "$ssid" = "" ]; then
    echo "ERROR: Could not retrieve current SSID. Are you connected?" >&2
    exit 1
  fi
fi

# warn user about keychain dialog
if [ $verbose ]; then
  echo ""
  echo "\033[90m … getting password for \"$ssid\". \033[39m"
  echo "\033[90m … keychain prompt incoming. \033[39m"
fi

sleep 2

# source: http://blog.macromates.com/2006/keychain-access-from-shell/
pwd="`security find-generic-password -D 'AirPort network password' -ga \"$ssid\" 2>&1 >/dev/null`"

if [[ $pwd =~ "could" ]]; then
  echo "ERROR: Could not find SSID \"$ssid\"" >&2
  exit 1
fi

# clean up password
pwd=$(echo "$pwd" | sed -e "s/^.*\"\(.*\)\".*$/\1/")

if [ "" == "$pwd" ]; then
  echo "ERROR: Could not get password. Did you enter your Keychain credentials?" >&2
  exit 1
fi

# print
if [ $verbose ]; then
  echo "\033[96m ✓ \"$pwd\" \033[39m"
  echo ""
else
  echo $pwd
fi
Download .txt
gitextract_t8lccz_i/

├── History.md
├── Readme.md
├── package.json
├── wifi-password.plugin.zsh
└── wifi-password.sh
Condensed preview — 5 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4K chars).
[
  {
    "path": "History.md",
    "chars": 143,
    "preview": "\n0.1.0 / 2015-02-14\n==================\n\n * default to `quiet` when piping (non-tty)\n\n0.0.1 / 2015-02-14\n================"
  },
  {
    "path": "Readme.md",
    "chars": 1241,
    "preview": "\n# wifi-password\n\nPeople ask you for the Wi-Fi password. Answer quickly. **macOS only**.\n[Windows version](https://githu"
  },
  {
    "path": "package.json",
    "chars": 266,
    "preview": "{\n  \"name\": \"wifi-password\",\n  \"version\": \"0.1.0\",\n  \"description\": \"People ask you for the Wi-Fi password. Answer quick"
  },
  {
    "path": "wifi-password.plugin.zsh",
    "chars": 175,
    "preview": "# This plugin is MIT licensed.\n#\n# Make git-open easy to install and keep up to date if you're using a\n# ZSH framework l"
  },
  {
    "path": "wifi-password.sh",
    "chars": 1989,
    "preview": "#!/usr/bin/env sh\n\nversion=\"0.1.0\"\n\n# locate airport(1)\nairport=\"/System/Library/PrivateFrameworks/Apple80211.framework/"
  }
]

About this extraction

This page contains the full source code of the rauchg/wifi-password GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 5 files (3.7 KB), approximately 1.3k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!