Skip to content

edobry/snaplock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snaplock

CLI tool for SNAP card freeze/unfreeze automation using Playwright browser automation.

🚀 Quick Start

If you have your .env file configured, you can start using the CLI immediately:

# Check your card status
bun run status

# Freeze your card
bun run freeze

# Unfreeze your card
bun run unfreeze

Installation

Install dependencies:

bun install

Configuration

Create a .env file in the project root with your EBT card credentials:

# Copy the example file
cp .env.example .env

# Edit .env with your credentials

The .env file should contain:

EBT_USER=your_user_id_here
EBT_PASSWORD=your_password_here
EBT_CARD_ID=your_card_id_selector

Note: The .env file is gitignored for security. Never commit credentials to version control.

Documentation

Usage

Using bun scripts (with dotenvx)

The easiest way to run commands with automatic credential loading:

# Check card status
bun run status

# Freeze your SNAP card
bun run freeze

# Unfreeze your SNAP card
bun run unfreeze

Direct CLI usage

# Show help
dotenvx run -- bun run src/index.ts --help

# Check card status
dotenvx run -- bun run src/index.ts status

# Freeze card
dotenvx run -- bun run src/index.ts freeze

# Unfreeze card
dotenvx run -- bun run src/index.ts unfreeze

# Run with visible browser (not headless)
dotenvx run -- bun run src/index.ts freeze --headless false

Using command-line options (without .env file)

You can also pass credentials directly as command-line options:

bun run src/index.ts status --user YOUR_USER --password YOUR_PASSWORD --card-id YOUR_CARD_ID

bun run src/index.ts freeze --user YOUR_USER --password YOUR_PASSWORD --card-id YOUR_CARD_ID

bun run src/index.ts unfreeze --user YOUR_USER --password YOUR_PASSWORD --card-id YOUR_CARD_ID

CLI Options

status command

Checks the current status of your SNAP card (active or frozen).

dotenvx run -- bun run src/index.ts status [options]

This command logs into your account, checks which buttons are available (freeze/unfreeze), and reports the current state of your card. It will not make any changes to your card.

Options:

  • --headless <boolean> - Run browser in headless mode (default: true)
  • --user <user> - EBT user ID (overrides EBT_USER env var)
  • --password <password> - EBT password (overrides EBT_PASSWORD env var)
  • --card-id <cardId> - Card ID selector (overrides EBT_CARD_ID env var)

freeze command

Freezes your SNAP card to prevent unauthorized transactions.

dotenvx run -- bun run src/index.ts freeze [options]

The command automatically checks if the card is already frozen before attempting to freeze it.

Options:

  • --headless <boolean> - Run browser in headless mode (default: true)
  • --user <user> - EBT user ID (overrides EBT_USER env var)
  • --password <password> - EBT password (overrides EBT_PASSWORD env var)
  • --card-id <cardId> - Card ID selector (overrides EBT_CARD_ID env var)

unfreeze command

Unfreezes your SNAP card to allow transactions.

dotenvx run -- bun run src/index.ts unfreeze [options]

The command automatically checks if the card is already unfrozen before attempting to unfreeze it.

Options: Same as freeze command.

Security

This project uses dotenvx for secure credential management:

  • Credentials are stored in .env file (gitignored)
  • Never commit credentials to version control
  • Use environment variables in production
  • Consider using dotenvx encryption for additional security

Development

This project was created using bun init in bun v1.2.21. Bun is a fast all-in-one JavaScript runtime.

Project Structure

  • src/index.ts - CLI entry point using Commander.js
  • src/ebt.ts - Core automation logic using Playwright
  • .env - Credentials (gitignored, create from .env.example)
  • tests/ - Playwright tests

License

Private project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors