# SPS Digital CLI

A CLI tool to create SPS Digital Tech template projects or add components to existing projects.

## Installation

```bash
npm install -g create-sps-project
```

## Usage

### Creating a new project:

```bash
create-sps-project my-project --token sps_your_token
```

### Adding a component to an existing project:

```bash
create-sps-project singleComponent --token sps_c_your_component_token
```

or simply:

```bash
create-sps-project --token sps_c_your_component_token
```

### Options

- `--token`, `-t` - Purchase token (required)
- `--dev`, `-d` - Development mode, uses localhost:3000 instead of production URL

## Project Structure

The CLI has been refactored to follow SOLID principles with a clear separation of concerns:

```
src/
├── cli/
│   ├── arg-parser.js      # Command line argument parsing
│   └── project-creator.js # Orchestrates the project creation process
├── services/
│   ├── downloader.js      # Handles HTTP requests and file downloads
│   └── template-installer.js # Handles template/component installation
├── utils/
│   ├── file-system.js     # File system operations
│   └── logger.js          # Logging utilities
└── index.js               # Main entry point
```

## Development

1. Clone the repository
2. Install dependencies with `npm install`
3. Make changes
4. Test locally with `node src/index.js my-project --token your_token`

## License

MIT 