open-index/open-npm huggingface dataset:
npm package: @jutsuai/jssm-cli
Description: CLI for JSSM - Simple environment variable manager
Author: Zahidul Islam
Latest version: 1.1.2

# JSSM CLI

Command-line interface for JSSM - Simple environment variable manager backed by AWS SSM.

## Installation

### From npm (recommended)

```bash
npm install -g @jssm/cli
```

### From source

```bash
# Clone the repository
git clone https://github.com/yourusername/jssm.git
cd jssm/cli

# Install dependencies
npm install

# Build
npm run build

# Link globally
npm link
```

## Quick Start

### 1. Configure Global Settings

Set your API host and key once (stored in `~/.jssm/config`):

```bash
jssm config set host http://localhost:3000
jssm config set apiKey jssm_your_api_key_here
```

### 2. Initialize a Project

Navigate to your project directory and initialize:

```bash
cd my-app
jssm init -p my-app -e development
```

This creates a `.jssm` file in your project directory.

### 3. Pull Variables

```bash
# Pull to .env file
jssm pull

# Or sync (same as pull but always outputs to .env)
jssm sync
```

## Commands

### `jssm config` - Manage Global Configuration

```bash
# Set values
jssm config set host http://localhost:3000
jssm config set apiKey jssm_xxx

# Get values
jssm config get host

# List all config
jssm config list

# Delete a value
jssm config delete apiKey
```

### `jssm init` - Initialize Project

```bash
# Basic (uses global config for host/apiKey)
jssm init -p my-project -e production

# With overrides
jssm init -p my-project -e production --host http://api.example.com -k jssm_xxx
```

### `jssm status` - Show Configuration

```bash
jssm status
```

Shows both global and project configuration with resolved values.

### `jssm pull` - Pull Variables

```bash
# Pull to .env (default)
jssm pull

# Pull to custom file
jssm pull --out .env.local

# Pull in different format
jssm pull --format json
jssm pull --format shell

# Pull from different project/env
jssm pull -p other-project -e staging
```

### `jssm sync` - Sync to .env

```bash
jssm sync
```

Equivalent to `jssm pull --out .env`.

### `jssm project` - Manage Projects

```bash
# Create a project
jssm project create my-app

# List projects
jssm project list
```

### `jssm env` - Manage Environments

```bash
# Create environment
jssm env create staging -p my-app
jssm env create production -p my-app

# List environments
jssm env list -p my-app
```

## Configuration Files

### Global Config (`~/.jssm/config`)

Stores shared settings:
- `host` - API server URL
- `apiKey` - Authentication key
- `namespace` - SSM namespace prefix (default: "jssm")
- `authMethod` - Authentication method (default: "apiKey")

### Project Config (`.jssm`)

Stores project-specific settings:
- `project` - Project name
- `environment` - Environment name
- Optional overrides for host, apiKey, namespace

**Add `.jssm` to your `.gitignore`** if it contains sensitive overrides.

## Testing Locally

```bash
# From the cli directory
cd cli

# Run directly with bun
bun src/index.ts help
bun src/index.ts config list
bun src/index.ts init -p test -e dev

# Or build and run
npm run build
./dist/index.js help
```

## License

MIT