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

@dccxx/auggiegw

v1.0.32

Published

A Node.js TypeScript package

Readme

@dccxx/auggiegw

A CLI tool for managing Augment Gateway authentication, proxy configuration, and custom prompts. This tool simplifies the workflow of authenticating with Augment Gateway, fetching proxy configurations, and managing custom prompts for the Augment AI assistant.

Features

  • 🔐 Authentication Management: Login/logout with secure credential storage
  • 🌐 Proxy Configuration: Automatic proxy setup and authentication
  • 📝 Custom Prompts: Fetch and save custom prompts to ~/.augment/commands/
  • 🔄 Auggie Integration: Seamlessly forward commands to the Auggie CLI
  • Command Execution: Execute any command with automatic session setup
  • 🔀 Account Switching: Automatically switch between purchased accounts

Installation

npm install -g @dccxx/auggiegw

or with Bun:

bun install -g @dccxx/auggiegw

Quick Start

  1. Login to Augment Gateway:

    auggiegw login

    You'll be prompted for your username and password.

  2. Fetch Configuration:

    auggiegw fetch

    This fetches proxy configuration, authenticates, and downloads custom prompts.

Global Options

The following options can be used with any command that triggers session management (fetch, auggie, exec):

  • --preserve-session: Preserve Auggie session and chat history when switching accounts
  • --delete-session: Explicitly delete Auggie session and chat history (default behavior)

Examples:

# Preserve chat history when fetching
auggiegw --preserve-session fetch

# Preserve chat history when running auggie
auggiegw --preserve-session auggie --help

# Explicitly delete session (same as default)
auggiegw --delete-session fetch

Precedence Order (highest to lowest):

  1. Command-line flags (--preserve-session or --delete-session)
  2. Environment variable (AUGGIEGW_DELETE_SESSION)
  3. Default behavior (delete session)

Commands

auggiegw login [username] [password]

Login and store credentials securely.

Interactive Mode (Recommended):

auggiegw login

You'll be prompted to enter your username and password. The password input is hidden for security.

Direct Mode:

auggiegw login myusername mypassword

What it does:

  • Authenticates with the Augment Gateway API
  • Stores credentials in ~/.auggiegw/auth.json
  • Token is used for subsequent commands

auggiegw logout

Logout and remove stored credentials.

auggiegw logout

What it does:

  • Deletes the authentication file (~/.auggiegw/auth.json)
  • Removes stored credentials from your system

auggiegw fetch

Fetch proxy configuration, authenticate, and download custom prompts.

Basic Usage:

auggiegw fetch

With Session Control:

# Preserve chat history
auggiegw --preserve-session fetch

# Explicitly delete session (default)
auggiegw --delete-session fetch

What it does:

  1. Retrieves proxy configuration from Augment Gateway
  2. Authenticates the proxy
  3. Saves Augment session to ~/.augment/session.json
  4. Deletes Auggie session (unless --preserve-session is used)
  5. Fetches all custom prompts from the server
  6. Saves prompts as markdown files in ~/.augment/commands/

Output Example:

✔ Successfully saved 15 prompts

auggiegw auggie [args...]

Forward commands to the Auggie CLI with automatic configuration.

Basic Usage:

auggiegw auggie [auggie-arguments]

Examples:

# Run Auggie with help
auggiegw auggie --help

# Run Auggie and preserve chat history
auggiegw --preserve-session auggie

# Run Auggie with a specific prompt
auggiegw --preserve-session auggie --print "Hello, world!"

What it does:

  1. Runs auggiegw fetch to ensure configuration is up-to-date
  2. Deletes Auggie session (unless --preserve-session is used)
  3. Forwards all arguments to the auggie command
  4. Inherits stdio for interactive sessions

auggiegw exec <command> [args...]

Execute any custom command with automatic session setup.

Basic Usage:

auggiegw exec <command> [arguments]

Examples:

# Execute auggie with help
auggiegw exec auggie --help

# Execute with preserved session
auggiegw --preserve-session exec auggie --help

# Execute custom command
auggiegw --preserve-session exec node script.js

What it does:

  1. Runs auggiegw fetch to ensure configuration is up-to-date
  2. Deletes Auggie session (unless --preserve-session is used)
  3. Executes the specified command with provided arguments
  4. Inherits stdio for interactive sessions

auggiegw switch-account

Automatically switch to a newer account from your purchased account list.

Basic Usage:

auggiegw switch-account

What it does:

  1. Fetches the list of purchased accounts from the API
  2. Identifies the current account (status "in-use")
  3. Switches to the next newer account (the account before the current one in the descending list)
  4. Activates the new account via the API
  5. Refreshes authentication with the new account (auth only, skips prompts)

Example Output:

✔ Successfully switched to account: [email protected]
Refreshing authentication...
✔ Authentication successful (prompts skipped)

Notes:

  • The account list is sorted by purchase date in descending order (newest first)
  • The command will fail if there are no newer accounts available
  • After switching, the authentication session is automatically refreshed
  • The old session is preserved - chat history and session data are not deleted when switching accounts
  • Custom prompts are not re-fetched during the switch (use auggiegw fetch if needed)

Authentication Methods

Method 1: Login Command (Recommended for Local Development)

auggiegw login

Credentials are stored in ~/.auggiegw/auth.json and automatically used for subsequent commands.

Method 2: Environment Variable (Recommended for CI/CD)

Set the AUGGIEGW_AUTH_TOKEN environment variable:

export AUGGIEGW_AUTH_TOKEN=your_token_here

When this environment variable is set, the CLI uses it directly without requiring the login command or auth.json file.

Example in CI/CD:

# GitHub Actions example
env:
  AUGGIEGW_AUTH_TOKEN: ${{ secrets.AUGGIEGW_AUTH_TOKEN }}

Configuration

Session Management

The CLI provides multiple ways to control session deletion behavior when switching accounts:

1. Command-Line Flags (Highest Priority)

Use global options with any command:

# Preserve session for a single command
auggiegw --preserve-session fetch

# Explicitly delete session (default behavior)
auggiegw --delete-session fetch

2. Environment Variable

Set AUGGIEGW_DELETE_SESSION to control default behavior:

# Preserve sessions by default
export AUGGIEGW_DELETE_SESSION=false
auggiegw fetch

# Delete sessions by default (same as built-in default)
export AUGGIEGW_DELETE_SESSION=true
auggiegw fetch

3. Default Behavior (Lowest Priority)

By default, the CLI deletes the Auggie session (including chat history) when fetching configuration to ensure a clean state for each account.

Precedence Order:

  1. Command-line flags (--preserve-session or --delete-session) - Always takes precedence
  2. Environment variable (AUGGIEGW_DELETE_SESSION) - Used if no CLI flag is provided
  3. Default behavior (delete session) - Used if neither flag nor environment variable is set

Examples:

# CLI flag overrides environment variable
export AUGGIEGW_DELETE_SESSION=false
auggiegw --delete-session fetch  # Session WILL be deleted

# Environment variable is used when no flag is provided
export AUGGIEGW_DELETE_SESSION=false
auggiegw fetch  # Session will NOT be deleted

# Default behavior when nothing is set
unset AUGGIEGW_DELETE_SESSION
auggiegw fetch  # Session WILL be deleted (default)

Environment Variables

  • AUGGIEGW_AUTH_TOKEN: Authentication token for API access (alternative to login command)
  • AUGGIEGW_DELETE_SESSION: Control Auggie session deletion behavior
    • Set to false to preserve chat history when switching accounts
    • Set to true or leave unset for default behavior (delete session)
    • Can be overridden by command-line flags

File Locations

  • Auth Data: ~/.auggiegw/auth.json
  • Augment Session: ~/.augment/session.json
  • Custom Prompts: ~/.augment/commands/*.md

Custom Prompts

Custom prompts are fetched from the Augment Gateway and saved as markdown files in ~/.augment/commands/. Each prompt file follows this format:

---
description: Prompt Name
---

Prompt content goes here...

The filename corresponds to the command name (e.g., my-command.md).


Usage Examples

Switching Accounts with Preserved Chat History

# Method 1: Using command-line flag
auggiegw login user1
auggiegw --preserve-session fetch
auggiegw --preserve-session auggie

# Switch to another account
auggiegw login user2
auggiegw --preserve-session fetch
auggiegw --preserve-session auggie

Switching Accounts with Clean Sessions (Default)

# Default behavior - session is deleted
auggiegw login user1
auggiegw fetch
auggiegw auggie

# Switch to another account - previous session is cleared
auggiegw login user2
auggiegw fetch
auggiegw auggie

Using Environment Variable for Multiple Commands

# Set environment variable once
export AUGGIEGW_DELETE_SESSION=false

# All subsequent commands preserve session
auggiegw login user1
auggiegw fetch
auggiegw auggie

# Switch accounts without losing history
auggiegw login user2
auggiegw fetch
auggiegw auggie

Override Environment Variable with CLI Flag

# Set default to preserve
export AUGGIEGW_DELETE_SESSION=false

# This preserves session (follows env var)
auggiegw fetch

# This deletes session (CLI flag overrides env var)
auggiegw --delete-session fetch

CI/CD Pipeline Example

# GitHub Actions workflow
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Setup authentication
        env:
          AUGGIEGW_AUTH_TOKEN: ${{ secrets.AUGGIEGW_AUTH_TOKEN }}
          AUGGIEGW_DELETE_SESSION: true
        run: |
          auggiegw fetch
          auggiegw exec npm run deploy

Requirements

  • Node.js: >= 18.0.0
  • Bun: For package management and running scripts (development)
  • Auggie CLI: Required for auggiegw auggie command

Troubleshooting

"Not logged in" Error

Error: Not logged in. Please run "auggiegw login" first.

Solution: Run auggiegw login to authenticate.

"Failed to get proxy" Error

Possible causes:

  • Invalid credentials
  • Network connectivity issues
  • API endpoint unavailable

Solution:

  1. Verify your credentials with auggiegw logout then auggiegw login
  2. Check your network connection
  3. Verify the API URL is correct

"No proxy data available" Error

Solution: Contact your administrator to ensure your account has proxy access configured.

Chat History Lost When Switching Accounts

By default, the CLI deletes the Auggie session (including chat history) when fetching configuration. This ensures a clean state for each account.

Solution 1: Use Command-Line Flag (Recommended)

Preserve session for specific commands:

# Login to new account
auggiegw login newuser

# Fetch with preserved session
auggiegw --preserve-session fetch

# Or use with auggie command
auggiegw --preserve-session auggie

Solution 2: Use Environment Variable

Set a persistent default behavior:

# Set the environment variable to disable session deletion
export AUGGIEGW_DELETE_SESSION=false

# Then run your commands as usual
auggiegw login newuser
auggiegw fetch

Solution 3: Mixed Approach

Combine both methods for flexibility:

# Set default to preserve
export AUGGIEGW_DELETE_SESSION=false

# Most commands will preserve session
auggiegw fetch

# But you can override for specific commands
auggiegw --delete-session fetch  # This will delete the session

Note: Disabling session deletion may cause conflicts if different accounts have incompatible session data. Use this option only if you need to preserve chat history across account switches.


License

See LICENSE file for details.

Support

For issues and questions, please open an issue on the GitHub repository.