SDKs / CLI

>_

passninja CLI

New Agentic-AI ready

A single-binary command-line interface for PassNinja that mirrors the full /v1 surface — pass templates, passes, and webhooks. Designed to drop straight into agentic AI tools like Claude Code, Codex, and other terminal-driven workflows, so an LLM can create passes on command: “use passninja to create a pass”.

macOS / Linux

brew tap flomio/passninja brew install passninja passninja auth

Windows (PowerShell)

irm https://github.com/flomio/passninja-cli/releases/latest/download/install.ps1 | iex passninja auth

Source: github.com/flomio/passninja-cli

We also maintain libraries in popular scripting languages to make it easy to build on top of PassNinja. You can find the source code for these here:

  1. PassNinja Python library
  2. PassNinja Ruby gem
  3. PassNinja NPM package
  4. PassNinja Swift library
  5. PassNinja Java package
  6. PassNinja C# package
  7. PassNinja PHP Composer package

Installation

You can find the installation commands for each of these below.

macOS / Linux

brew tap flomio/passninja brew install passninja # Verify the install passninja version

Windows (PowerShell)

irm https://github.com/flomio/passninja-cli/releases/latest/download/install.ps1 | iex # Verify the install passninja version

Authentication

Initialize the PassNinja client with your API credentials. You can find your API key and Account ID in your account dashboard.

# Interactive — prompts for API key + account id, verifies, writes ~/.passninja-auth.json (0600) passninja auth # Or pass them inline (handy in CI / scripts) passninja auth \ --api-key '<YOUR_API_KEY>' \ --account-id '<YOUR_ACCOUNT_ID>' # Confirm who you're talking to passninja whoami

List Pass Templates

Retrieve a list of all pass templates for your account. (for more information check the API Reference)

passninja pass-template list # JSON for piping into jq / your tooling passninja pass-template list --output json

Get Pass Template

Retrieve a specific pass template by its ID. (for more information check the API Reference)

passninja pass-template get <YOUR_TEMPLATE_ID> # Show the required fields for new passes on this template passninja pass-template required-fields <YOUR_TEMPLATE_ID>

Create a Pass

Create a new pass for a given pass template with specified field values. (for more information check the API Reference)

# Repeatable --field k=v pairs passninja pass create <YOUR_TEMPLATE_ID> \ --field member.level=silver \ --field discount=50% \ --field member.name=John # Or hand it a JSON body passninja pass create <YOUR_TEMPLATE_ID> \ --data '{"member.level":"silver","discount":"50%","member.name":"John"}'

List Passes

Retrieve a list of passes for a given pass template. (for more information check the API Reference)

passninja pass list <YOUR_TEMPLATE_ID>

Get a Pass

Retrieve a specific pass by its pass template and serial number. (for more information check the API Reference)

passninja pass get <YOUR_TEMPLATE_ID> <SERIAL_NUMBER> # Dump the raw API response (handy for debugging) passninja pass raw <YOUR_TEMPLATE_ID> <SERIAL_NUMBER>

Decrypt a Pass

Decrypt a pass payload using its pass template and encrypted payload. (for more information check the API Reference)

passninja pass decrypt <YOUR_TEMPLATE_ID> \ 55166a9700250a8c51382dd16822b0c7...

Patch a Pass

Partially update a pass. Only the fields provided will be updated; other fields retain their existing values. (for more information check the API Reference)

# PATCH is the default — only the named fields change passninja pass update <YOUR_TEMPLATE_ID> <SERIAL_NUMBER> \ --field member.name=Ted

Update a Pass

Fully update a pass with new field values. All fields must be provided. (for more information check the API Reference)

# --replace switches to PUT (full replace) passninja pass update <YOUR_TEMPLATE_ID> <SERIAL_NUMBER> --replace \ --field member.level=gold \ --field discount=100% \ --field member.name=John

Delete a Pass

Delete a pass by its pass template and serial number. (for more information check the API Reference)

# Interactive y/N confirm by default passninja pass delete <YOUR_TEMPLATE_ID> <SERIAL_NUMBER> # Skip the prompt in scripts passninja pass delete <YOUR_TEMPLATE_ID> <SERIAL_NUMBER> --yes