npm package: @mayur7685/airkit-cli
Description: CLI tool for AIR Kit credential application development
Author: Moca Network
Latest version: 1.0.1

# AIR Kit CLI

A comprehensive command-line interface for AIR Kit credential application development.

## Features

- 🚀 **Project Scaffolding**: Initialize new AIR Kit projects with interactive setup
- ⚙️ **Configuration Management**: Manage environment variables and settings
- 🔐 **Key Management**: Generate and manage cryptographic keys
- 🌍 **Environment Management**: Switch between sandbox, staging, and production
- 🧪 **Testing Tools**: Test credential flows and API connectivity
- 🚀 **Deployment Tools**: Validate and deploy to multiple platforms
- 📚 **Comprehensive Help**: Built-in documentation and troubleshooting guides

## Installation

### Global Installation (Recommended)

```bash
npm install -g @mayur7685/airkit-cli
```

### Local Development

```bash
git clone https://github.com/mayur7685/airkit-cli.git
cd airkit-cli
npm install
npm run build
npm link
```

## Quick Start

1. **Create a new project**:
   ```bash
   airkit init
   ```

2. **Follow the interactive setup wizard** to configure your project

3. **Start development**:
   ```bash
   cd your-project-name
   airkit dev start
   ```

## Commands

### Project Management
- `airkit init [type] [name]` - Initialize a new AIR Kit project
- `airkit validate` - Validate CLI installation and functionality

### Configuration
- `airkit config init` - Initialize configuration files
- `airkit config validate` - Validate current configuration
- `airkit config export` - Export configuration for deployment

### Environment Management
- `airkit env list` - List available environments
- `airkit env set <env>` - Switch to specified environment
- `airkit env validate` - Validate environment configuration

### Key Management
- `airkit keys generate` - Generate new cryptographic keys
- `airkit keys validate` - Validate existing keys
- `airkit keys rotate` - Rotate private keys

### Testing
- `airkit test issuance` - Test credential issuance flow
- `airkit test verification` - Test credential verification flow
- `airkit test connectivity` - Test API connectivity

### Development
- `airkit dev start` - Start development server with AIR Kit integration

### Deployment
- `airkit deploy validate` - Validate production readiness
- `airkit deploy platform --platform <name>` - Generate platform-specific configurations
- `airkit deploy guide` - Generate comprehensive deployment guide

### Help & Documentation
- `airkit help` - Show general help
- `airkit help <command>` - Show command-specific help
- `airkit help workflow <name>` - Show workflow guides
- `airkit help faq` - Show frequently asked questions

## Project Types

### Demo Project
Full-featured application with both credential issuance and verification capabilities.
```bash
airkit init demo my-demo-app
```

### Issuer Project
Credential issuance-only application.
```bash
airkit init issuer my-issuer-app
```

### Verifier Project
Credential verification-only application.
```bash
airkit init verifier my-verifier-app
```

### Custom Project
Minimal setup with manual configuration options.
```bash
airkit init custom my-custom-app
```

## Supported Frameworks

- **React + Vite**: Fast development with hot reload
- **Next.js**: Full-stack React framework with SSR
- **Vanilla JavaScript**: Pure JavaScript without frameworks

## Deployment Platforms

The CLI supports deployment to multiple platforms:

- **Vercel**: Optimized for frontend applications
- **Netlify**: JAMstack deployments
- **Docker**: Containerized deployments
- **Railway**: Simple cloud deployments
- **Render**: Full-stack cloud platform
- **AWS**: Amazon Web Services
- **Google Cloud**: Google Cloud Platform

## Configuration

The CLI uses environment variables for configuration:

```bash
# Core AIR Kit Configuration
PARTNER_PRIVATE_KEY="your-private-key"
SIGNING_ALGORITHM="ES256"
NEXT_PUBLIC_BUILD_ENV="sandbox"
NEXT_PUBLIC_PARTNER_ID="your-partner-id"

# Feature-specific variables
NEXT_PUBLIC_ISSUER_DID="your-issuer-did"
NEXT_PUBLIC_ISSUE_PROGRAM_ID="your-program-id"
NEXT_PUBLIC_VERIFIER_PROGRAM_ID="your-verifier-id"
```

## Development

### Building

```bash
# Clean build
npm run build

# Development with watch mode
npm run dev

# Production build
npm run build:prod
```

**Important**: Always run `npm run build` after making changes to TypeScript files before testing the CLI.

### Testing

```bash
npm test
npm run test:coverage
```

### Linting

```bash
npm run lint
npm run lint:fix
```

### Validation

```bash
npm run build
airkit validate --full
```

## Troubleshooting

### Common Issues

1. **Command not found**: Ensure the CLI is properly installed globally
2. **Permission errors**: Check file permissions and try with elevated privileges
3. **Network errors**: Verify internet connection and AIR Kit service status
4. **Configuration errors**: Run `airkit config validate` to check settings

### Getting Help

- Run `airkit help troubleshooting` for detailed troubleshooting guide
- Check the [documentation](https://docs.moca.network/airkit/)
- Report issues on [GitHub](https://github.com/mayur7685/airkit-cli/issues)

## Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests for new functionality
5. Run `npm run lint` and `npm test`
6. Submit a pull request

## License

MIT License - see [LICENSE](LICENSE) file for details.

## Support

- 📚 [Documentation](https://docs.moca.network/airkit/)
- 🐛 [Issues](https://github.com/mayur7685/airkit-cli/issues)
- 💬 [Discussions](https://github.com/mayur7685/airkit-cli/discussions)