@microfox/cli
Version:
Universal CLI tool for creating modern TypeScript packages with npm availability checking
114 lines (87 loc) • 3.61 kB
Markdown
Universal CLI tool for creating modern TypeScript packages with comprehensive SDK templates, npm availability checking, and professional tooling setup.
```bash
npx @microfox/cli kickstart
```
```bash
npm install -g @microfox/cli
microfox kickstart
```
```bash
npx @microfox/cli kickstart
```
This command will:
- **Ask for a package name** interactively
- **Check npm availability** for the package name
- **Prompt for a new name** if the package already exists
- Create a complete package directory structure
- Set up modern TypeScript configuration
- Generate minimal code templates with examples
- Create a basic test suite with Vitest
- Set up ESLint and Prettier for code quality
- Configure modern build system with tsup
The CLI accepts any valid npm package name:
- Simple names: `my-awesome-package`
- Scoped packages: `@myorg/my-awesome-package`
✅ **Interactive Package Creation** - Asks for package name during setup
✅ **NPM Availability Checking** - Automatically checks if your package name is available
✅ **Interactive Name Selection** - Prompts for alternatives if name is taken
✅ **Modern TypeScript Setup** - Full TypeScript configuration with strict mode
✅ **Minimal Code Templates** - Simple SDK structure with commented examples
✅ **Basic Test Suite** - Vitest configuration with example tests
✅ **Code Quality Tools** - ESLint and Prettier pre-configured
✅ **Professional Structure** - Based on popular open-source packages
✅ **Simple Documentation** - Auto-generated README with minimal examples
✅ **Modern Build System** - tsup for fast, modern bundling
✅ **Git Ready** - Includes .gitignore and proper file structure
- `kickstart` - Kickstart a new TypeScript SDK package with modern tooling
When you run the CLI, it creates a complete package with:
```
my-package/
├── src/
│ ├── index.ts
│ ├── myPackageSdk.ts
│ ├── types/
│ │ └── index.ts
│ ├── schemas/
│ │ └── index.ts
│ └── __tests__/
│ └── myPackage.test.ts
├── docs/
├── package.json
├── package-info.json
├── tsconfig.json
├── tsup.config.ts
├── vitest.config.ts
├── .eslintrc.js
├── .prettierrc
├── .gitignore
├── README.md
└── CHANGELOG.md
```
After creating a package:
```typescript
import { MyPackageSdk } from 'my-package';
const sdk = new MyPackageSdk({
apiKey: 'your-api-key',
baseUrl: 'https://api.example.com'
});
// Example hello method (replace with your own methods)
const result = await sdk.hello('World');
console.log(result.data); // "Hello, World! Welcome to my-package SDK."
// TODO: Add your own SDK methods
// const data = await sdk.getData('123');
// const created = await sdk.createItem({ name: 'Example' });
```
MIT