{"id":51053404,"url":"https://github.com/moltinginstar/mongoctl","last_synced_at":"2026-06-22T19:03:52.637Z","repository":{"id":334562390,"uuid":"1074920697","full_name":"moltinginstar/mongoctl","owner":"moltinginstar","description":"A mongosh connection manager.","archived":false,"fork":false,"pushed_at":"2026-01-25T15:52:49.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-26T08:05:36.005Z","etag":null,"topics":["cli","connection-manager","database-management","mongo","mongodb","mongosh","password-manager"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moltinginstar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-12T18:16:28.000Z","updated_at":"2026-01-25T15:52:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/moltinginstar/mongoctl","commit_stats":null,"previous_names":["moltinginstar/mongoctl"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/moltinginstar/mongoctl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moltinginstar%2Fmongoctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moltinginstar%2Fmongoctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moltinginstar%2Fmongoctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moltinginstar%2Fmongoctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moltinginstar","download_url":"https://codeload.github.com/moltinginstar/mongoctl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moltinginstar%2Fmongoctl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34661709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","connection-manager","database-management","mongo","mongodb","mongosh","password-manager"],"created_at":"2026-06-22T19:03:46.820Z","updated_at":"2026-06-22T19:03:52.632Z","avatar_url":"https://github.com/moltinginstar.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mongoctl\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA simple command-line tool for managing MongoDB connection profiles.\n\n## Features\n\n- **Profile-based connection management:** Store MongoDB connection strings as named profiles\n- **OS keychain integration:** Secure password storage\n- **Quick shell and query execution:** Fast access to your MongoDB instances\n\n## Installation\n\nMake sure `mongosh` is in your PATH.\n\n### Using Homebrew\n\n```bash\nbrew tap moltinginstar/mongoctl\nbrew install mongoctl\n```\n\n### From source\n\n```bash\ngit clone https://github.com/moltinginstar/mongoctl.git\ncd mongoctl\ngo build -o mongoctl\n```\n\n## Quick start\n\n1. Create a profile:\n\n   ```bash\n   mongoctl profile create local \"mongodb://localhost:27017\"\n   ```\n\n   For authenticated connections, see the section on [secure password input](#secure-password-input).\n\n2. Open a MongoDB shell:\n\n   ```bash\n   mongoctl shell local\n   ```\n\n3. Or execute a query directly:\n\n   ```bash\n   mongoctl exec local \"db.users.find()\"\n   ```\n\n## Usage\n\n```bash\n# Create profiles for dev and prod\nmongoctl profile create dev \"mongodb://localhost:27017\"\n\n# Including authSource in the URL for use with tools like mongodump/mongorestore\nmongoctl profile create prod \"mongodb+srv://user:pass@cluster.mongodb.net/?authSource=admin\"\n\n# List all profiles\nmongoctl profile list\n\n# List profiles as JSON\nmongoctl profile list --output json\nmongoctl profile list -o json\n\n# Show profile details\nmongoctl profile get dev\n\n# Get profile details as JSON\nmongoctl profile get dev --output json\nmongoctl profile get dev -o json\n\n# Show the full URI (including credentials)\nmongoctl profile get prod --field uri --raw\nmongoctl profile get prod -f uri -R\n\n# Update the profile URI\nmongoctl profile set dev --field uri --value \"mongodb://localhost:27017\"\nmongoctl profile set dev -f uri -x \"mongodb://localhost:27017\"\n\n# Read new value from stdin\necho \"mongodb://localhost:27017\" | mongoctl profile set dev --field uri --value-stdin\necho \"mongodb://localhost:27017\" | mongoctl profile set dev -f uri -X\n\n# Prompt for new URI\nmongoctl profile set dev --field uri\nmongoctl profile set dev -f uri\n\n# Rename profile\nmongoctl profile set prod --field name --value production\nmongoctl profile set prod -f name -x production\n\n# Delete a profile\nmongoctl profile delete dev\n\n# Open MongoDB shell\nmongoctl shell prod\n\n# Open shell with a direct URI\nmongoctl shell \"mongodb://localhost:27017\"\n\n# Connect to specific database\nmongoctl shell prod --db analytics\nmongoctl shell prod -d analytics\n\n# Pass flags to mongosh\nmongoctl shell prod -- --quiet --eval \"db.stats()\"\n\n# Execute a query using a profile\nmongoctl exec prod \"db.stats()\"\n\n# Execute query against specific database\nmongoctl exec prod \"db.users.find()\" --db myapp\nmongoctl exec prod \"db.users.find()\" -d myapp\n\n# Execute query using a direct URI\nmongoctl exec \"mongodb://localhost:27017\" \"db.stats()\"\n\n# Execute query from file\nmongoctl exec prod --file query.js\nmongoctl exec prod -f query.js\n\n# Verbose mode for debugging\nmongoctl shell prod --verbose\nmongoctl shell prod -v\n```\n\n## Secure password input\n\nWhen creating profiles with authentication, `mongoctl` offers three options:\n\n#### 1. Interactive prompt (recommended)\n\nProvide URI with username only - you'll be prompted for the password:\n\n```bash\nmongoctl profile create prod \"mongodb://user@host/authSource=admin\"\n# Password for user (leave empty to skip): ****\n```\n\n#### 2. Read from stdin (useful for scripts)\n\n```bash\necho \"$MONGO_PASSWORD\" | mongoctl profile create prod \"mongodb://user@host/?authSource=admin\" --password-stdin\n```\n\n#### 3. Inline with `HIST_IGNORE_SPACE` (not recommended)\n\nConfigure your shell to ignore commands starting with space:\n\n```bash\n# In ~/.bashrc or ~/.zshrc\nexport HISTCONTROL=ignorespace # bash\nsetopt HIST_IGNORE_SPACE       # zsh\n\n# Then prefix command with space to avoid history\n mongoctl profile create prod \"mongodb://user:pass@host/?authSource=admin\"\n```\n\nThis will hide the password from your shell history but not from process lists.\n\n**Note:** Passwords are automatically extracted and stored in your OS keychain. Profiles (stored in [`~/.mongoctl/profiles/`](~/.mongoctl/profiles/)) do not contain plaintext passwords.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoltinginstar%2Fmongoctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoltinginstar%2Fmongoctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoltinginstar%2Fmongoctl/lists"}