@take-out/cli
v0.1.21
Published
CLI tools for Takeout starter kit - interactive onboarding and project setup
Downloads
8,886
Readme
@take-out/cli
CLI tools for Takeout starter kit - interactive onboarding, project setup, scripts and script running.
Features
- 🚀 Interactive onboarding wizard
- ✅ Prerequisite checking (Bun, Docker, Node, Git)
- 🔧 Environment file setup with secret generation
- 📦 Project identity customization
- 🐳 Docker service orchestration
- 🗄️ Database migration automation
- 📚 Documentation management with Claude Code Skills support
- 🎨 Beautiful CLI interface with @clack/prompts
Installation
npm install @take-out/cli
# or
bun add @take-out/cli
# or
pnpm add @take-out/cliUsage
CLI Commands
takeout onboard
Interactive onboarding for new Takeout projects:
takeout onboardThis will guide you through:
- Prerequisites verification (Bun, Docker, Node, Git)
- Environment file setup (.env from .env.development)
- Secret generation (BETTER_AUTH_SECRET)
- Project identity customization (name, bundle ID, domain)
- Docker service startup (PostgreSQL, Zero, MinIO)
- Database migrations
Options:
--skip- Skip interactive prompts
takeout check
Quick prerequisite check (used in postinstall):
takeout checkOptions:
--silent- Run silently with no output
takeout docs
Manage and retrieve documentation files:
# list available docs
takeout docs list
# get doc content (for hooks)
takeout docs get zero tamagui
# get path to docs directory
takeout docs path
# eject docs to local ./docs folder
takeout docs eject
# generate Claude Code skills from docs
takeout skills generate
takeout skills generate --clean # clean and regenerateClaude Code Skills
The skills generate command generates Claude Code skills from your documentation:
- scans docs from both
./docs/(local) and package docs - for docs with YAML frontmatter, creates symlinks to
.claude/skills/ - for docs without frontmatter, generates skill files with auto-extracted metadata
adding frontmatter to docs (recommended):
---
name: my-skill
description: What this skill does. Keywords for when Claude should use it.
---
# my skill
content here...docs with frontmatter get symlinked directly - edit the source and the skill updates automatically. docs without frontmatter get generated copies.
regenerating skills:
# regenerate after doc changes
bun tko skills generate
# clean and regenerate all
bun tko skills generate --cleanskills are gitignored by default (.claude/skills).
API
Prerequisites
checkAllPrerequisites(): PrerequisiteCheck[]
checkBun(): PrerequisiteCheck
checkNode(): PrerequisiteCheck
checkDocker(): PrerequisiteCheck
checkGit(): PrerequisiteCheck
hasRequiredPrerequisites(checks: PrerequisiteCheck[]): booleanPorts
checkAllPorts(): PortCheck[]
checkPort(port: number, name: string): PortCheck
hasPortConflicts(checks: PortCheck[]): boolean
getConflictingPorts(checks: PortCheck[]): PortCheck[]
TAKEOUT_PORTS = {
postgres: 5432,
zero: 4848,
web: 8081,
minio: 9090,
minioConsole: 9091,
}Environment
generateSecret(length?: number): string
envFileExists(cwd: string, filename?: string): boolean
copyEnvFile(cwd: string, source: string, target: string): Result
updateEnvVariable(cwd: string, key: string, value: string, filename?: string): Result
createEnvLocal(cwd: string): Result
readEnvVariable(cwd: string, key: string, filename?: string): string | nullFiles
updatePackageJson(cwd: string, updates: { name?: string; description?: string }): Result
updateAppConfig(cwd: string, updates: { name?: string; slug?: string; bundleId?: string }): Result
checkOnboarded(cwd: string): boolean
markOnboarded(cwd: string): ResultPrompts
displayWelcome(projectName?: string): void
displayOutro(message: string): void
displayPrerequisites(checks: PrerequisiteCheck[]): void
displayPortConflicts(conflicts: PortCheck[]): void
confirmContinue(message: string, defaultValue?: boolean): Promise<boolean>
promptText(message: string, defaultValue?: string, placeholder?: string): Promise<string>
promptPassword(message: string, placeholder?: string): Promise<string>
promptSelect<T>(message: string, options: Array<{value: T; label: string; hint?: string}>): Promise<T>
showSpinner(message: string): Spinner
showError(message: string): void
showWarning(message: string): void
showSuccess(message: string): void
showInfo(message: string): void
showStep(message: string): voidIntegration with Takeout
Add to your package.json:
{
"scripts": {
"onboard": "takeout onboard",
"postinstall": "takeout check"
},
"dependencies": {
"@take-out/cli": "^0.0.1"
}
}Then users can run:
bun install
bun onboardDevelopment
# Install dependencies
bun install
# Build
bun run build
# Watch mode
bun run watch
# Lint
bun run lint
# Lint and fix
bun run lint:fix
# Test locally (from this directory)
bun src/cli.ts onboard
bun src/cli.ts check
# Test built version
bun dist/esm/cli.mjs onboardLicense
MIT
