A powerful command-line tool for creating and managing modern TypeScript monorepos with best practices built-in.
- Zero-config setup - Initialize a complete monorepo with one command
- Multiple app types - CLI, Express API, Vite React, Next.js
- Library management - Create reusable packages with proper TypeScript setup
- Modern tooling - PNPM workspaces, Vitest, ESLint, Prettier, Changesets
- CI/CD ready - GitHub Actions workflows included
- Dependency switching - Toggle between local workspace and remote dependencies
- TypeScript first - Full TypeScript support with proper configurations
my-monorepo/
βββ apps/ # Deployable applications
β βββ cli-app/ # Command-line tools
β βββ api-app/ # Express.js APIs
β βββ web-app/ # Vite + React apps
β βββ next-app/ # Next.js applications
βββ packages/ # Reusable libraries
β βββ core/ # Shared utilities
β βββ ui/ # UI components
β βββ config/ # Configuration packages
βββ .github/ # GitHub Actions & templates
βββ package.json # Root workspace config
# Install globally via npm
npm install -g monokit
# Or use npx without installation
npx monokit init my-project# Download the monokit script
curl -fsSL https://raw.githubusercontent.com/logimos/monokit/main/monokit -o monokit
# Make it executable
chmod +x monokit
# Move to a directory in your PATH (optional)
sudo mv monokit /usr/local/bin/# Clone the repository
git clone https://github.com/logimos/monokit.git
cd monokit
# Make executable
chmod +x monokit
# Create a symlink (optional)
sudo ln -s $(pwd)/monokit /usr/local/bin/monokit# Initialize a new monorepo
monokit init my-awesome-project
# Navigate to the project
cd my-awesome-project
# Add a library
monokit add lib utils
# Add a CLI application
monokit add app cli-tool
# Add a web application
monokit add app web-appmonokit init <project-name>This creates a complete monorepo with:
- PNPM workspace configuration
- TypeScript base configuration
- ESLint and Prettier setup
- Vitest testing framework
- Changesets for versioning
- GitHub Actions CI/CD
- Comprehensive README
monokit add lib <library-name>Creates a reusable library with:
- TypeScript configuration
- Build setup with tsup
- Test configuration with Vitest
- Proper package.json structure
- Example source code and tests
monokit add app <app-name>Interactive app creation with 4 options:
- CLI Application - Command-line tools with chalk for styling
- Express API - REST API with Express.js
- Vite React - Modern React app with Vite
- Next.js - Full-stack React framework
Switch between local workspace and remote dependencies:
# Switch to local workspace dependencies
monokit switch <package-name> <app|lib> local
# Switch to remote dependencies
monokit switch <package-name> <app|lib> remote| Command | Description |
|---|---|
pnpm build |
Build all packages |
pnpm dev |
Run dev mode for all packages |
pnpm test |
Run tests across the monorepo |
pnpm test:ui |
Run tests with Vitest UI |
pnpm lint |
Lint all packages |
pnpm format |
Format all packages |
pnpm clean |
Clean all dist folders |
pnpm type-check |
Type check all packages |
For a package named @myorg/my-package:
| Command | Description |
|---|---|
pnpm @myorg/my-package:build |
Build specific package |
pnpm @myorg/my-package:dev |
Run dev mode for specific package |
pnpm @myorg/my-package:test |
Test specific package |
pnpm @myorg/my-package:lint |
Lint specific package |
pnpm @myorg/my-package:format |
Format specific package |
pnpm @myorg/my-package:clean |
Clean specific package |
pnpm @myorg/my-package:type-check |
Type check specific package |
- Built with TypeScript and chalk for styling
- Includes example utilities and tests
- Ready for command-line argument parsing
- Proper error handling setup
- REST API with Express.js
- JSON middleware configured
- Health check endpoint
- Example calculation endpoint
- Comprehensive testing setup
- Modern React with TypeScript
- Vite for fast development
- Testing with React Testing Library
- Hot module replacement
- Build optimization
- Latest Next.js with App Router
- Tailwind CSS v4 integration
- Geist fonts included
- Server-side rendering ready
- API routes support
Monokit uses Changesets for versioning:
# Create a changeset
pnpm changeset
# Version packages
pnpm version-packages
# Create and push a tag
git tag v1.0.0
git push origin v1.0.0GitHub Actions will automatically publish changed packages to npm.
- Node.js 18+
- PNPM 8+
- Git
- Fork and clone the repository
- Install dependencies:
pnpm install - Make changes to the scripts in
monokit-files/ - Test your changes by running the monokit script locally
- Submit a pull request with a clear description
To add a new app type (e.g., Svelte, Vue):
- Create a new script file:
monokit-files/svelte-app.sh - Implement the
create_svelte_app()function - Add the option to the interactive menu in
monokit - Update this README with the new app type
- Modify the main script (
monokit) to add new commands - Create helper scripts in
monokit-files/for complex operations - Update documentation in this README
- Add tests if applicable
- Use consistent bash scripting patterns
- Add proper error handling
- Include helpful success/error messages
- Follow the existing naming conventions
Edit the ORG_NAME variable in the monokit script:
# Change from @myorg to your organization
ORG_NAME="@yourorg"Modify the dependency installation in each app type script:
# In monokit-files/cli-app.sh
pnpm add --filter "$PKG_NAME" your-preferred-cli-lib"Not in a workspace" error
- Ensure you're running commands from within a monorepo directory
- Check that
pnpm-workspace.yamlexists
Permission denied
- Make sure the monokit script is executable:
chmod +x monokit
Package not found
- Run
pnpm installto install dependencies - Check that the package name is correct
Build failures
- Run
pnpm cleanto clear build artifacts - Check TypeScript errors with
pnpm type-check
- Check the Issues page
- Create a new issue with:
- Your operating system
- Node.js and PNPM versions
- The exact command that failed
- Error messages and stack traces
MIT License - see LICENSE file for details.
- PNPM for fast, disk space efficient package management
- Vitest for blazing fast unit testing
- Changesets for versioning and releases
- Tsup for zero-config TypeScript bundling
Made with β€οΈ for the TypeScript community