Skip to main content

Overview

NikCLI provides sophisticated project operation capabilities that enable comprehensive project analysis, dependency management, code structure evaluation, and automated project setup. These operations are designed to understand your codebase deeply and provide intelligent assistance throughout the development lifecycle.

Project Analysis

Deep codebase analysis and structure detection

Dependency Management

Package and dependency tracking across technologies

Code Intelligence

AST parsing and semantic code understanding

Automated Setup

Intelligent project initialization and scaffolding

Project Analysis Commands

/analyze - Project Analysis

Perform comprehensive project analysis including technology detection, dependency mapping, and code structure evaluation.
  • Basic Analysis
  • Technology Detection
  • Deep Analysis
# Analyze current directory
/analyze

# Analyze specific directory
/analyze src/
/analyze components/
/analyze backend/

# Quick analysis summary
/analyze --summary
/analyze --quick

/structure - Code Structure Analysis

Analyze and visualize project structure and architecture patterns.
# Show project tree
/structure tree
/structure --tree --depth 3

# Analyze directory organization
/structure dirs
/structure --directories --patterns

# Component structure (React/Vue)
/structure components
/structure --components --depth 2
Output Example:
src/
├── components/
│   ├── ui/           # UI primitives
│   ├── forms/        # Form components
│   └── layout/       # Layout components
├── hooks/            # Custom React hooks
├── utils/            # Utility functions
└── types/            # TypeScript definitions
# File type distribution
/structure files
/structure --file-types --statistics

# Large file analysis
/structure --large-files --threshold 1000

# File relationships
/structure dependencies
/structure --imports --exports
# Detect architecture patterns
/structure patterns
/structure --mvc --mvvm --clean

# Monorepo analysis
/structure monorepo
/structure --workspaces --packages

# Microservices detection
/structure microservices
/structure --services --apis

/dependencies - Dependency Analysis

Comprehensive dependency analysis and management across all supported package managers.
  • Dependency Overview
  • Package Manager Support
  • Dependency Health
  • Cross-Language Dependencies
# Show all dependencies
/dependencies
/dependencies list

# Production vs development
/dependencies --prod
/dependencies --dev
/dependencies --peer

# Show dependency tree
/dependencies tree
/dependencies --tree --depth 3

/metrics - Code Metrics

Generate comprehensive code quality metrics and complexity analysis.
# Cyclomatic complexity
/metrics complexity
/metrics --complexity --threshold 10

# Cognitive complexity
/metrics cognitive
/metrics --cognitive-load

# Maintainability index
/metrics maintainability
/metrics --maintainability --files
# Lines of code
/metrics loc
/metrics --lines-of-code --by-language

# Function/class metrics
/metrics functions
/metrics --functions --methods --classes

# Test coverage analysis
/metrics coverage
/metrics --coverage --test-files
# Code duplication
/metrics duplication
/metrics --duplicates --threshold 5

# Technical debt
/metrics debt
/metrics --technical-debt --todo --fixme

# Documentation coverage
/metrics documentation
/metrics --docs --comments --coverage

Project Initialization Commands

/init - Project Initialization

Initialize new projects with intelligent scaffolding and best practices.
  • Framework Initialization
  • Backend Initialization
  • Full-Stack Initialization
  • Specialized Projects
# React projects
/init react my-react-app
/init react --typescript --tailwind

# Vue projects
/init vue my-vue-app
/init vue --composition-api --pinia

# Angular projects
/init angular my-angular-app
/init angular --standalone --material

# Next.js projects
/init nextjs my-next-app
/init nextjs --app-router --typescript

/scaffold - Code Scaffolding

Generate code scaffolding for common patterns and components.
# React components
/scaffold react-component UserProfile
/scaffold react-component --hooks --typescript

# Vue components
/scaffold vue-component ProductCard
/scaffold vue-component --composition --script-setup

# Angular components
/scaffold angular-component user-list
/scaffold angular-component --standalone --signals
# REST API endpoints
/scaffold api users
/scaffold api --crud --validation --auth

# GraphQL schema
/scaffold graphql User
/scaffold graphql --resolvers --mutations

# Database models
/scaffold model User
/scaffold model --prisma --relations --validation
# Unit tests
/scaffold test UserService
/scaffold test --jest --mocks --coverage

# Integration tests
/scaffold integration-test api/users
/scaffold integration-test --supertest --database

# E2E tests
/scaffold e2e-test login-flow
/scaffold e2e-test --playwright --cypress
# Development configuration
/scaffold config development
/scaffold config --eslint --prettier --husky

# CI/CD pipelines
/scaffold ci github-actions
/scaffold ci --build --test --deploy

# Docker configuration
/scaffold docker
/scaffold docker --multi-stage --compose --production

Code Intelligence Commands

Advanced code search with semantic understanding and pattern matching.

/refactor - Code Refactoring

Intelligent code refactoring with AST-based transformations.
# Rename symbols
/refactor rename "oldFunctionName" "newFunctionName"
/refactor rename --symbol "UserService" "AccountService"

# Move symbols
/refactor move --function "utility" --to "utils/helpers.ts"
/refactor move --class "User" --to "models/user.ts"

# Extract symbols
/refactor extract --function --from "longFunction" --name "helper"
/refactor extract --component --from "App.tsx" --name "Header"
# Convert function syntax
/refactor convert --arrow-functions
/refactor convert --class-to-hooks
/refactor convert --promises-to-async

# Modernize code
/refactor modernize --es6-imports
/refactor modernize --optional-chaining
/refactor modernize --nullish-coalescing

# Framework migration
/refactor migrate --class-components-to-hooks
/refactor migrate --vue2-to-vue3
/refactor migrate --js-to-ts
# Reorganize imports
/refactor imports --sort --group --remove-unused
/refactor imports --absolute-to-relative

# Split files
/refactor split --file "largeComponent.tsx"
/refactor split --by-functionality --threshold 200

# Merge files
/refactor merge --files "util1.ts,util2.ts" --output "utils.ts"

/lint - Code Quality Analysis

Comprehensive code quality analysis with multiple linting tools.
  • JavaScript/TypeScript
  • Multi-Language
  • Custom Rules
# ESLint analysis
/lint eslint
/lint --eslint --fix --typescript

# TypeScript compiler check
/lint tsc
/lint --typescript-check --strict

# Prettier formatting
/lint prettier
/lint --format --check --write

Build and Testing Commands

/build - Project Building

Intelligent build system integration with optimization and analysis.
# React builds
/build react
/build --react --production --analyze

# Vue builds
/build vue
/build --vue --mode production --report

# Angular builds
/build angular
/build --angular --prod --aot --build-optimizer

# Next.js builds
/build nextjs
/build --nextjs --production --static-export
# TypeScript compilation
/build typescript
/build --tsc --declaration --source-maps

# Go builds
/build go
/build --go --ldflags --race-detection

# Docker builds
/build docker
/build --docker --multi-platform --cache
# Bundle analysis
/build analyze
/build --bundle-analyzer --size-report

# Performance analysis
/build performance
/build --lighthouse --web-vitals

# Build optimization
/build optimize
/build --tree-shake --code-split --compress

/test - Testing Operations

Comprehensive testing operations with intelligent test discovery and execution.
  • Unit Testing
  • Integration Testing
  • End-to-End Testing
  • Test Analysis
# Run all tests
/test
/test --coverage --watch

# Run specific tests
/test UserService
/test --pattern "auth.*"
/test --file user.test.ts

# Test with options
/test --verbose --bail --parallel

Real-World Examples

Project Analysis Workflow

# Complete project analysis
/analyze --deep --recursive --include-tests

# Technology stack detection
/analyze tech --frameworks --languages --tools

# Architecture analysis
/structure patterns --mvc --mvvm --clean
/structure microservices --services --apis

# Dependency health check
/dependencies audit --security-scan
/dependencies outdated --check-updates

Code Quality Assessment

# Comprehensive code metrics
/metrics complexity --threshold 10
/metrics duplication --threshold 5
/metrics maintainability --files

# Code quality analysis
/lint eslint --fix --typescript
/lint prettier --format --write

# Security and performance analysis
/analyze security --vulnerabilities
/analyze performance --metrics

Project Initialization

# Full-stack project setup
/init t3 my-fullstack-app --nextjs --typescript --tailwind --prisma

# Component library setup
/scaffold react-component Button --hooks --typescript --storybook
/scaffold react-component Input --hooks --typescript --validation

# API development setup
/scaffold api users --crud --validation --auth
/scaffold api products --crud --validation --pagination

Next Steps

Use /analyze as your first command in any new project to get a comprehensive understanding of the codebase structure, technologies, and potential optimization opportunities.