@akashic-devkit/cli
v0.0.3
Published
Akashic DevKit CLI
Downloads
223
Readme
@akashic-devkit/cli
Akashic DevKit CLI - Your personal component registry
Installation
# Using pnpm
pnpm dlx @akashic-devkit/cli
# Using npx
npx @akashic-devkit/cli
# Global install
pnpm add -g @akashic-devkit/cliUsage
Display help
akashic --help
akashic -hCheck version
akashic --version
akashic -vShow CLI info
akashic infoInitialize config
akashic initCreates akashic.json in the current directory:
{
"aliases": {
"components": "@/components",
"hooks": "@/hooks"
},
"registry": ""
}Add component or hook
akashic add button
akashic add use-toastDevelopment
Install dependencies
pnpm installBuild
pnpm buildDevelopment mode (watch)
pnpm devType check
pnpm type-checkLint
pnpm lintTesting locally
# Build the CLI
pnpm build
# Link globally
pnpm link --global
# Test the CLI
akashic --version
akashic init
akashic add button
# Or test with pack
pnpm pack
pnpm add -g ./akashic-devkit-cli-0.0.1.tgzProject Structure
packages/cli/
├── src/
│ ├── index.ts # CLI entry point
│ ├── commands/ # Command implementations
│ │ ├── index.ts # Command registry
│ │ ├── info.ts # Info command
│ │ ├── init.ts # Init command
│ │ └── add.ts # Add command
│ └── utils/ # Utility functions
│ ├── config.ts # Config file management
│ ├── registry.ts # Registry operations
│ └── prompts.ts # Interactive prompts
├── dist/ # Built files (generated)
├── package.json
├── tsconfig.json
├── eslint.config.js
└── tsup.config.tsHow it works
- init: Creates
akashic.jsonconfig file - add: Fetches component/hook from registry using degit
- Automatically detects if it's a hook (starts with "use") or component
- Places files in the configured alias path
- Prompts for confirmation if file already exists
