This guide provides step-by-step instructions for deploying the MongoDB Agent to GitHub and publishing it as a Python package.
Before you begin, ensure you have:
- Git installed and configured
- GitHub account with access to
cisco-it-supply-chainorganization - Python 3.8+ installed
- PyPI account (for package publishing)
- Co-authors' names and email addresses
- Go to https://github.com/organizations/cisco-open/repositories/new
- Repository name:
mongodb-nl-query-ai-agent - Description: "AI-powered agent for querying MongoDB databases using natural language"
- Visibility: Choose Public or Private based on your requirements
- DO NOT initialize with README, .gitignore, or license (we already have these)
- Click Create repository
gh repo create cisco-open/mongodb-nl-query-ai-agent \
--public \
--description "AI-powered agent for querying MongoDB databases using natural language"Run these commands in your terminal:
# Navigate to your project directory
cd /Users/prakalam/mongodb-agent-public
# Remove old remote (if exists)
git remote remove origin
# Add new remote
git remote add origin https://github.com/cisco-open/mongodb-nl-query-ai-agent.git
# Stage all new files
git add -A
# Commit with co-authors
git commit -m "Initial commit: MongoDB Agent AI v1.0.0
This release includes:
- Natural language MongoDB query support
- Multi-LLM provider support (OpenAI, Anthropic, AWS Bedrock)
- Semantic model templates
- Complete documentation and examples
- Package distribution setup
Co-authored-by: [Co-Author Name 1] <email1@cisco.com>
Co-authored-by: [Co-Author Name 2] <email2@cisco.com>
Co-authored-by: [Co-Author Name 3] <email3@cisco.com>"
# Push to GitHub
git push -u origin main[Co-Author Name] and <email@cisco.com> with actual names and emails of your co-authors.
Before publishing, test the package build:
# Install build tools
pip install build twine
# Build the package
python -m build
# This creates:
# - dist/mongodb_agent_ai-1.0.0-py3-none-any.whl
# - dist/mongodb_agent_ai-1.0.0.tar.gz
# Check the package
twine check dist/*
# Test installation locally
pip install dist/mongodb_agent_ai-1.0.0-py3-none-any.whl- Go to https://pypi.org/account/register/
- Register an account
- Verify your email
- Log in to PyPI
- Go to Account Settings → API tokens
- Click "Add API token"
- Token name:
mongodb-agent-ci - Scope: Choose "Entire account" or specific project
- Copy the token (starts with
pypi-)
- Go to https://github.com/cisco-open/mongodb-nl-query-ai-agent/settings/secrets/actions
- Click "New repository secret"
- Name:
PYPI_API_TOKEN - Value: Paste your PyPI token
- Click "Add secret"
# Upload to PyPI
twine upload dist/*
# You'll be prompted for:
# Username: __token__
# Password: <your-pypi-token>The package will automatically publish when you:
-
Create a new release on GitHub:
# Tag the release git tag -a v1.0.0 -m "Release version 1.0.0" git push origin v1.0.0
-
Or manually trigger the workflow:
- Go to Actions tab in GitHub
- Select "Publish to PyPI" workflow
- Click "Run workflow"
# Set up commit template
git config commit.template .gitmessage
# Now when you commit:
git commit
# Edit the message and add co-authors at the bottomgit commit -m "Your commit message
Co-authored-by: Name1 <email1@cisco.com>
Co-authored-by: Name2 <email2@cisco.com>"# Add to ~/.gitconfig
git config --global alias.cocommit '!f() { git commit -m "$1" -m "Co-authored-by: Name1 <email1@cisco.com>" -m "Co-authored-by: Name2 <email2@cisco.com>"; }; f'
# Usage
git cocommit "Your commit message"- Go to Settings → Branches
- Add rule for
mainbranch:- Require pull request reviews
- Require status checks to pass
- Require branches to be up to date
The CODEOWNERS file has been created. To activate it:
- Go to Settings → Code security and analysis
- Enable "Code owners"
After publishing, verify users can install:
# Install from PyPI
pip install mongodb-agent-ai
# Or with extras
pip install mongodb-agent-ai[openai,anthropic]
# Verify installation
mongodb-agent --version- Repository created and code pushed
- All co-authors credited in initial commit
- Package built and tested locally
- PyPI account created and token generated
- Package published to PyPI
- GitHub Actions secrets configured
- CODEOWNERS file activated
- Branch protection rules set
- Installation verified from PyPI
- Documentation reviewed and accessible
- Team members have access to repository
To release new versions:
- Update version in
setup.pyandpyproject.toml - Update CHANGELOG (if exists)
- Commit changes with co-authors
- Create and push a new tag:
git tag -a v1.1.0 -m "Release version 1.1.0" git push origin v1.1.0 - GitHub Actions will automatically publish to PyPI
For issues or questions:
- GitHub Issues: https://github.com/cisco-open/mongodb-nl-query-ai-agent/issues
- Documentation: See
/docsfolder
# Push code
git remote add origin https://github.com/cisco-open/mongodb-nl-query-ai-agent.git
git push -u origin main
# Build package
python -m build
# Publish to PyPI
twine upload dist/*
# Create release
git tag -a v1.0.0 -m "Release version 1.0.0"
git push origin v1.0.0Happy Deploying! 🚀