create-iaso-analysis
v1.0.1
Published
iaso analysis project scaffold
Readme
create-iaso-analysis
A CLI scaffold tool for quickly creating IASO analysis projects from GitHub template repositories.
Features
- Clone projects from GitHub template repositories
- Offline mode with local template support
- Interactive command-line prompts
- File conflict detection and overwrite confirmation
- Automatic Git repository initialization
- Automatic dependency installation (npm, pnpm, bun)
- Colorful terminal output
Quick Start
Online Mode (Recommended)
npx create-iaso-analysisSpecify a project directory:
npx create-iaso-analysis my-projectClone a GitHub repo and apply template:
npx create-iaso-analysis owner/repoOffline Mode
npx create-iaso-analysis --offline --template /path/to/local/templateCLI Options
Usage: create-iaso-analysis [options] [target]
Arguments:
target project directory or GitHub repo (owner/repo format)
Options:
-V, --version output the version number
--offline use local template directory instead of cloning from GitHub
--template <path> local template directory path (used with --offline)
-h, --help display help for commandTarget Formats
| Input | Interpreted As |
|-------|----------------|
| my-project | Local path ./my-project |
| . | Current directory |
| ./path/to/dir | Relative local path |
| /absolute/path | Absolute local path |
| owner/repo | GitHub SSH: [email protected]:owner/repo.git |
| [email protected]:owner/repo.git | GitHub SSH URL |
| https://github.com/owner/repo | GitHub HTTPS URL |
Usage Examples
Create in current directory
mkdir my-project && cd my-project
npx create-iaso-analysisCreate in a new directory
npx create-iaso-analysis my-project
cd my-projectCreate from GitHub repository
npx create-iaso-analysis IASO-AI/iaso-analysis-templateUse local template (offline mode)
npx create-iaso-analysis --offline --template ~/templates/iaso-analysisExample Output
$ npx create-iaso-analysis <your-repo-url>
create-iaso-analysis
✔ Template repository URL: … <template-repo-url>
✔ Package manager: › bun
○ Cloning <your-repo-url>...
✓ Repository cloned.
○ Cloning template from <template-repo-url>...
✓ Template cloned.
⚠ The following files/folders already exist: .gitignore
✔ Overwrite existing files? … yes
○ Copying template files...
✓ Template files copied.
⚠ No package.json found, skipping dependency installation.
✓ Project created successfully!
$ cd <your-project-name>
$ bun devInteractive Prompts
After running the command, the CLI guides you through:
- Template repository URL - Enter GitHub template repo address (default:
[email protected]:IASO-AI/iaso-analysis-template.git) - Package manager - Choose from npm, pnpm, or bun
Workflow
┌─────────────────────────────────────────────────────────┐
│ create-iaso-analysis │
├─────────────────────────────────────────────────────────┤
│ 1. Parse CLI arguments │
│ 2. Check Git availability (online mode) │
│ 3. Interactive prompts (template repo, package manager)│
│ 4. Determine target directory │
│ 5. Clone template to temp dir / use local template │
│ 6. Detect file conflicts and prompt for overwrite │
│ 7. Copy template files to target directory │
│ 8. Initialize Git repository │
│ 9. Install dependencies │
│ 10. Output success message and next steps │
└─────────────────────────────────────────────────────────┘Requirements
- Node.js >= 18
- Git (required for online mode)
- npm / pnpm / bun (any package manager)
Global Installation
npm install -g create-iaso-analysis
create-iaso-analysis my-projectDevelopment
Install dependencies
npm installRun in development mode
npm run devBuild
npm run buildPublish
npm run releaseProject Structure
src/
├── index.ts # Entry point, main workflow
├── cli.ts # CLI argument parsing
├── prompts.ts # Interactive prompts
├── types.ts # TypeScript type definitions
├── actions/
│ ├── clone.ts # Git clone operations
│ ├── copy.ts # File copy and conflict detection
│ ├── init.ts # Git initialization
│ └── install.ts # Dependency installation
└── utils/
├── git.ts # Git utility functions
├── logger.ts # Terminal logging
└── path.ts # Path handling utilitiesTech Stack
| Library | Purpose | |---------|---------| | commander | CLI argument parsing | | prompts | Interactive CLI prompts | | execa | Subprocess execution | | fs-extra | Enhanced file system operations | | picocolors | Terminal color output |
License
ISC
