Metadata-Version: 2.4
Name: gsx-cli
Version: 0.1.2
Summary: GSX CLI - GoSentrix Application Security CLI. Authenticate once, use everywhere.
Author: GoSentrix
Author-email: GoSentrix <engineering@gosentrix.com>
License-Expression: MIT
Project-URL: Homepage, https://gosentrix.com
Project-URL: Documentation, https://docs.gosentrix.com/cli
Project-URL: Repository, https://github.com/gosentrix/gsx-cli
Project-URL: Issues, https://github.com/gosentrix/gsx-cli/issues
Keywords: security,aspm,mcp,claude,cli,gosentrix
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: click>=8.0.0
Requires-Dist: keyring>=23.0.0
Requires-Dist: requests>=2.25.0
Requires-Dist: PyJWT>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Dynamic: author
Dynamic: requires-python

# GSX CLI

GoSentrix CLI for Application Security. Authenticate once, use everywhere: Claude Code, Cursor, Codex, and more.

## Installation

### via pip (recommended)

```bash
pip install gsx-cli
```

### via npm

```bash
npm install -g @gosentrix/gsx
```

### From source

```bash
git clone https://github.com/gosentrix/gsx-cli.git
cd gsx-cli
pip install -e .
```

## Quick Start

```bash
# 1. Authenticate with GoSentrix (opens browser)
gsx auth login

# 2. Verify setup
gsx doctor

# 3. Configure your IDE
gsx mcp config claude   # For Claude Code
gsx mcp config cursor   # For Cursor
gsx mcp config codex    # For Codex
```

## Commands

### Authentication

```bash
gsx auth login              # Authenticate via browser (device code flow)
gsx auth status             # Check authentication status
gsx auth logout             # Clear stored credentials
gsx auth print-access-token # Print current access token
```

### MCP Configuration

```bash
gsx mcp config <ide>   # Generate MCP config (claude, cursor, codex, generic)
gsx mcp url            # Print MCP endpoint URL
gsx mcp tools          # List available MCP tools
gsx mcp test           # Test MCP connection
gsx mcp call <tool>    # Call an MCP tool directly
```

### Context Management

```bash
gsx context show       # Show current workspace/project context
gsx context set        # Set workspace/project scope
gsx context init       # Initialize context for current directory
gsx context clear      # Remove context files
```

### Diagnostics

```bash
gsx doctor             # Verify setup and diagnose issues
```

## Claude Code Setup

After authenticating, set up Claude Code with:

```bash
# Generate and run the setup command
gsx mcp config claude
```

This outputs:

```bash
claude mcp add --transport http gsx https://mcp.gosentrix.io/mcp \
  --header "Authorization: Bearer $(gsx auth print-access-token)"

claude mcp enable gsx
```

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `GSX_GATEWAY_URL` | MCP Gateway URL | `https://mcp.gosentrix.io` |
| `GSX_CLIENT_ID` | OAuth client ID | `gsx-cli` |

## Security

- **Device code flow**: Secure OAuth authentication via browser
- **OS keychain storage**: Credentials stored in macOS Keychain, Windows Credential Manager, or Linux Secret Service
- **Short-lived tokens**: Access tokens expire in 15 minutes
- **Automatic refresh**: Tokens are refreshed automatically
- **Zero credentials in files**: Only scope stored in `.gsx.json`

## Requirements

- Python 3.8+
- Node.js 16+ (for npm installation)

## License

MIT
