npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hesed/ssh

v0.5.0

Published

CLI for SSH access to Kubernetes pods

Readme

ssh

CLI for SSH access to Kubernetes pods

Version Downloads/week

Install

sdkck plugins install @hesed/ssh

SSH to Kubernetes pods

This plugin reaches application pods via an SSH chain. By default it uses a bastion jump host (local → bastion → kubectl host → kubectl exec), but the bastion is optional — omit it to SSH directly to the kubectl host. Every connection detail (bastion host, kubectl host, namespace, pod labels, container, SSH user) lives in a server profile stored in ssh-servers.json under oclif's config dir.

# 1. Add a server profile (interactive, or pass the flags below)
# With a bastion (two-hop chain):
ssh ssh servers add -p prod --bastionHost sglogin.example.com \
  --sshHost k8s.example.com -u allen -n sa-prod

# Without a bastion (direct to kubectl host):
ssh ssh servers add -p dev --sshHost k8s-dev.example.com -u allen -n sa-dev

# 2. Run a bash command in the first running pod
ssh ssh exec pwd -p prod

# 3. Fan out across ALL pods (labelled output — useful for log scanning)
ssh ssh exec --all "tail -20 storage/logs/laravel-$(date +%Y-%m-%d).log" -p prod

# 4. Laravel artisan
ssh ssh artisan cache:clear -p prod
# Artisan subcommand flags need `--` to separate them from oclif flags:
ssh ssh artisan -- queue:work --timeout=60

# 5. PHP tinker (no escaping needed — pass raw PHP)
ssh ssh tinker "App\\Models\\User::count()" -p prod

Migration safety: ssh artisan blocks nothing by default — each profile has its own opt-in artisan blacklist (empty until you configure it). Migrations are destructive, so lock them down per profile:

ssh ssh artisan block -p prod --add migrate --add migrate:fresh \
  --add "migrate:fresh --seed" --add migrate:rollback --add migrate:reset \
  --add migrate:refresh --add migrate:install --add migrate:status \
  --add migrate:change
ssh ssh artisan block -p prod  # view the current blacklist

Exec allowlist: ssh exec runs any command by default. To restrict a profile to a set of command prefixes, use ssh exec allow:

ssh ssh exec allow -p prod --add tail --add grep --add "php artisan cache:clear"
ssh ssh exec allow -p prod  # view the current allowlist

An empty (or unset) allowlist disables the guard — every command may run.

Usage

$ npm install -g @hesed/ssh
$ ssh COMMAND
running command...
$ ssh (--version)
@hesed/ssh/0.5.0 linux-x64 node-v24.18.0
$ ssh --help [COMMAND]
USAGE
  $ ssh COMMAND
...

Commands

ssh ssh artisan COMMAND

Run a Laravel artisan command

USAGE
  $ ssh ssh artisan COMMAND [--json] [--all] [--component <value>] [--container <value>] [--namespace <value>]
    [-p <value>] [--role <value>]

ARGUMENTS
  COMMAND  Artisan command to run (e.g. cache:clear, route:list, queue:restart)

FLAGS
  -p, --profile=<value>    SSH server profile name from config
      --all                Run on ALL running pods; output is labelled per pod
      --component=<value>  Override pod component label (default: from profile)
      --container=<value>  Override container name (default: from profile)
      --namespace=<value>  Override Kubernetes namespace (default: from profile)
      --role=<value>       Override pod role label (default: from profile)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Run a Laravel artisan command

EXAMPLES
  $ ssh ssh artisan cache:clear

  $ ssh ssh artisan route:list -p prod

  $ ssh ssh artisan queue:restart --namespace sa-testqa

See code: src/commands/ssh/artisan/index.ts

ssh ssh artisan block

View or edit a server profile's artisan blacklist

USAGE
  $ ssh ssh artisan block [--json] [--add <value>...] [--clear] [-p <value>] [--remove <value>...]

FLAGS
  -p, --profile=<value>    SSH server profile name from config
      --add=<value>...     Add a command prefix to the blacklist (repeatable)
      --clear              Remove every entry from the profile's blacklist
      --remove=<value>...  Remove a command prefix from the blacklist (repeatable)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  View or edit a server profile's artisan blacklist

EXAMPLES
  $ ssh ssh artisan block

  $ ssh ssh artisan block -p prod

  $ ssh ssh artisan block -p prod --add migrate --add migrate:fresh

  $ ssh ssh artisan block -p prod --remove migrate:fresh

  $ ssh ssh artisan block -p prod --clear

See code: src/commands/ssh/artisan/block.ts

ssh ssh exec COMMAND

Execute a bash command

USAGE
  $ ssh ssh exec COMMAND [--json] [--all] [--component <value>] [--container <value>] [--namespace <value>]
    [-p <value>] [--role <value>]

ARGUMENTS
  COMMAND  Command to execute

FLAGS
  -p, --profile=<value>    SSH server profile name from config
      --all                Run on ALL running pods; output is labelled per pod
      --component=<value>  Override pod component label (default: from profile)
      --container=<value>  Override container name (default: from profile)
      --namespace=<value>  Override Kubernetes namespace (default: from profile)
      --role=<value>       Override pod role label (default: from profile)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Execute a bash command

EXAMPLES
  $ ssh ssh exec pwd

  $ ssh ssh exec "tail -20 storage/logs/laravel-$(date +%Y-%m-%d).log" --all

  $ ssh ssh exec "grep ERROR storage/logs/laravel.log" --namespace sa-testqa

See code: src/commands/ssh/exec/index.ts

ssh ssh exec allow

View or edit a server profile's exec allowlist

USAGE
  $ ssh ssh exec allow [--json] [--add <value>...] [--clear] [-p <value>] [--remove <value>...]

FLAGS
  -p, --profile=<value>    SSH server profile name from config
      --add=<value>...     Add a command prefix to the allowlist (repeatable)
      --clear              Remove every entry from the profile's allowlist
      --remove=<value>...  Remove a command prefix from the allowlist (repeatable)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  View or edit a server profile's exec allowlist

EXAMPLES
  $ ssh ssh exec allow

  $ ssh ssh exec allow -p prod

  $ ssh ssh exec allow -p prod --add tail --add grep

  $ ssh ssh exec allow -p prod --remove grep

  $ ssh ssh exec allow -p prod --clear

See code: src/commands/ssh/exec/allow.ts

ssh ssh servers add

Add SSH Server authentication

USAGE
  $ ssh ssh servers add -p <value> --bastionHost <value> --sshHost <value> -u <value> -n <value> --component <value>
    --role <value> --container <value> [--json]

FLAGS
  -n, --namespace=<value>    (required) Kubernetes namespace
  -p, --profile=<value>      (required) Profile name
  -u, --sshUser=<value>      (required) SSH username for both hops
      --bastionHost=<value>  (required) Bastion host
      --component=<value>    (required) Pod component label
      --container=<value>    (required) Container name within the pod
      --role=<value>         (required) Pod role label
      --sshHost=<value>      (required) Kubernetes host

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Add SSH Server authentication

EXAMPLES
  $ ssh ssh servers add

  $ ssh ssh servers add -p prod

See code: src/commands/ssh/servers/add.ts

ssh ssh servers delete

Delete an authentication profile

USAGE
  $ ssh ssh servers delete [--json] [-p <value>]

FLAGS
  -p, --profile=<value>  Profile to delete

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Delete an authentication profile

EXAMPLES
  $ ssh ssh servers delete

  $ ssh ssh servers delete -p prod

See code: src/commands/ssh/servers/delete.ts

ssh ssh servers discover

Discover the component/role label values on a namespace's running pods (valid --component/--role targets)

USAGE
  $ ssh ssh servers discover [--json] [--namespace <value>] [-p <value>]

FLAGS
  -p, --profile=<value>    SSH server profile name from config
      --namespace=<value>  Override Kubernetes namespace (default: from profile)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Discover the component/role label values on a namespace's running pods (valid --component/--role targets)

EXAMPLES
  $ ssh ssh servers discover

  $ ssh ssh servers discover -p prod

  $ ssh ssh servers discover --namespace sa-testqa

See code: src/commands/ssh/servers/discover.ts

ssh ssh servers list

List authentication profiles

USAGE
  $ ssh ssh servers list [--json]

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List authentication profiles

EXAMPLES
  $ ssh ssh servers list

See code: src/commands/ssh/servers/list.ts

ssh ssh servers profile

Set or show the default authentication profile

USAGE
  $ ssh ssh servers profile [--json] [--default <value>]

FLAGS
  --default=<value>  Profile to set as default

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Set or show the default authentication profile

EXAMPLES
  $ ssh ssh servers profile

  $ ssh ssh servers profile --default test

See code: src/commands/ssh/servers/profile.ts

ssh ssh servers test

Test authentication and connection

USAGE
  $ ssh ssh servers test [--json] [-p <value>]

FLAGS
  -p, --profile=<value>  Authentication profile name

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Test authentication and connection

EXAMPLES
  $ ssh ssh servers test

  $ ssh ssh servers test -p prod

See code: src/commands/ssh/servers/test.ts

ssh ssh servers update

Update SSH Server authentication

USAGE
  $ ssh ssh servers update -p <value> --bastionHost <value> --sshHost <value> -u <value> -n <value> --component <value>
    --role <value> --container <value> [--json]

FLAGS
  -n, --namespace=<value>    (required) Kubernetes namespace
  -p, --profile=<value>      (required) Profile name
  -u, --sshUser=<value>      (required) SSH username for both hops
      --bastionHost=<value>  (required) Bastion host
      --component=<value>    (required) Pod component label
      --container=<value>    (required) Container name within the pod
      --role=<value>         (required) Pod role label
      --sshHost=<value>      (required) Kubernetes host

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Update SSH Server authentication

EXAMPLES
  $ ssh ssh servers update

  $ ssh ssh servers update -p test

See code: src/commands/ssh/servers/update.ts

ssh ssh tinker PHP

Execute PHP code in Laravel tinker

USAGE
  $ ssh ssh tinker PHP [--json] [--all] [--component <value>] [--container <value>] [--namespace <value>] [-p
    <value>] [--role <value>]

ARGUMENTS
  PHP  PHP code to execute via tinker

FLAGS
  -p, --profile=<value>    SSH server profile name from config
      --all                Run on ALL running pods; output is labelled per pod
      --component=<value>  Override pod component label (default: from profile)
      --container=<value>  Override container name (default: from profile)
      --namespace=<value>  Override Kubernetes namespace (default: from profile)
      --role=<value>       Override pod role label (default: from profile)

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Execute PHP code in Laravel tinker

EXAMPLES
  $ ssh ssh tinker "App\\Models\\User::count()"

  $ ssh ssh tinker "echo User::first()->email;" -p prod

  $ ssh ssh tinker "Cache::forget('some_key')"

See code: src/commands/ssh/tinker.ts