Project Management
Learn how Gemini CLI manages its packages, releases, and development workflow using NPM workspaces, Lerna, and automated CI/CD processes.
NPM Workspaces
Understanding the monorepo structure and package organization
Workspace Structure
gemini-cli/
βββ packages/
β βββ cli/ # Main CLI package
β β βββ package.json
β β βββ src/
β β βββ dist/
β βββ core/ # Core functionality
β β βββ package.json
β β βββ src/
β β βββ dist/
β βββ tools/ # Built-in tools
β β βββ package.json
β β βββ src/
β β βββ dist/
β βββ extensions/ # Extension system
β βββ package.json
β βββ src/
β βββ dist/
βββ package.json # Root workspace config
βββ lerna.json # Lerna configuration
βββ tsconfig.json # TypeScript config
βββ .github/ # CI/CD workflows
βββ workflows/
βββ test.yml
βββ build.yml
βββ release.yml
Root Package.json
{
"name": "gemini-cli-workspace",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"build": "lerna run build",
"test": "lerna run test",
"lint": "lerna run lint",
"clean": "lerna clean",
"bootstrap": "lerna bootstrap",
"version": "lerna version",
"publish": "lerna publish"
},
"devDependencies": {
"lerna": "^6.0.0",
"typescript": "^5.0.0",
"@types/node": "^18.0.0"
}
}
Package Management
Commands and workflows for managing packages
Development Commands
npm run bootstrap
Install and link all package dependencies
npm run build
Build all packages in dependency order
npm run test
Run tests across all packages
npm run clean
Clean node_modules and build artifacts
Lerna Commands
lerna run build --scope @gemini/cli
Build specific package
lerna add lodash packages/core
Add dependency to specific package
lerna version --conventional-commits
Version packages using conventional commits
lerna publish --registry https://registry.npmjs.org
Publish packages to npm registry
Release Process
Automated release workflow using GitHub Actions
GitHub Actions Workflow
name: Release
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run test
- run: npm run lint
release:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Version and Publish
run: |
npm run version -- --conventional-commits --yes
npm run publish -- --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Development Workflow
Best practices for contributing to the project
Fork and Clone
Fork the repository and clone it locally for development.
git clone https://github.com/your-username/gemini-cli.git
Setup Development Environment
Install dependencies and set up the development environment.
npm install && npm run bootstrap
Create Feature Branch
Create a new branch for your feature or bug fix.
git checkout -b feature/my-new-feature
Develop and Test
Make your changes and ensure all tests pass.
npm run build && npm run test && npm run lint
Submit Pull Request
Push your changes and create a pull request with a clear description.
git push origin feature/my-new-feature
Best Practices
Guidelines for effective project management
Code Quality
- Follow conventional commit messages
- Maintain test coverage above 80%
- Use TypeScript for type safety
- Run linting and formatting checks
Release Management
- Use semantic versioning
- Generate changelogs automatically
- Test releases in staging environment
- Monitor post-release metrics
Related Resources
Learn more about contributing and development