{"id":31322781,"url":"https://github.com/ibrahimasry/shikamaru","last_synced_at":"2025-09-25T19:14:11.553Z","repository":{"id":313788160,"uuid":"1052388077","full_name":"ibrahimasry/shikamaru","owner":"ibrahimasry","description":"multi-repo dev environments","archived":false,"fork":false,"pushed_at":"2025-09-12T19:41:41.000Z","size":340,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-17T19:02:02.616Z","etag":null,"topics":["cli","docker","environment","frontend","javascript","library","postgres","rabbitmq","react","redis","timescaledb","tool","typescript"],"latest_commit_sha":null,"homepage":"https://maru.ibrahimasry.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibrahimasry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-09-08T01:25:17.000Z","updated_at":"2025-09-12T19:41:44.000Z","dependencies_parsed_at":"2025-09-08T14:20:37.609Z","dependency_job_id":"533b7589-5a63-49ca-a206-d59b8eda33b7","html_url":"https://github.com/ibrahimasry/shikamaru","commit_stats":null,"previous_names":["ibrahimasry/shikamaro"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ibrahimasry/shikamaru","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimasry%2Fshikamaru","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimasry%2Fshikamaru/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimasry%2Fshikamaru/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimasry%2Fshikamaru/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibrahimasry","download_url":"https://codeload.github.com/ibrahimasry/shikamaru/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimasry%2Fshikamaru/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276966723,"owners_count":25736854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-25T02:00:09.612Z","response_time":80,"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","docker","environment","frontend","javascript","library","postgres","rabbitmq","react","redis","timescaledb","tool","typescript"],"created_at":"2025-09-25T19:14:10.443Z","updated_at":"2025-09-25T19:14:11.541Z","avatar_url":"https://github.com/ibrahimasry.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 shikamaru CLI\n\n\u003e **Spin up multi-repo dev environments** with **env management**, **port allocation**, **Docker/Hybrid orchestration**, and **real-time log streaming** (terminal \u0026 web UI).\n\n[![npm version](https://img.shields.io/npm/v/shikamaru.svg?style=flat)](https://www.npmjs.com/package/shikamaru) ![Node \u003e=16](https://img.shields.io/badge/node-%3E%3D16-green) ![Docker required](https://img.shields.io/badge/docker-required-blue) ![Status](https://img.shields.io/badge/status-beta-yellow)\n\n---\n\n## 📑 Contents\n\n- [Overview](#overview)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Commands](#commands)\n- [Profiles \u0026 Project Discovery](#profiles--project-discovery)\n- [Configuration](#configuration)\n- [Environment Management](#environment-management)\n- [Infra: Docker vs External](#infra-docker-vs-external)\n- [Port Management](#port-management)\n- [Execution Modes](#execution-modes)\n- [Logging \u0026 Web UI](#logging--web-ui)\n- [Troubleshooting](#troubleshooting)\n- [Contributing](#contributing)\n- [License](#license)\n\n---\n\n## 🔎 Overview\n\n**shikamaru** makes local dev across multiple services painless:\n\n- 📂 Auto-detect \u0026 select repos\n- ⚙️ Generate `.env` from `.env.example`\n- 🔌 Assign ports \u0026 avoid conflicts\n- 🐳 Run in **local**, **docker**, or **hybrid** mode\n- 📡 Stream logs in terminal or web UI\n\n**Requirements**\n\n- Node.js ≥ 16\n- npm ≥ 8\n- Docker (for docker/hybrid modes)\n\n---\n\n## 🧩 Installation\n\n```bash\n# Global (recommended)\nnpm install -g shikamaru\n\n# Local (from repo)\nnpm install\nnpm run build\nnpm start\n```\n\n---\n\n## 🚀 Quick Start\n\n1. In your workspace, add `global.env` (backend vars) and `frontend.global.env` (frontend vars).  \n   To load Azure variable groups, set:\n\n   ```bash\n   ORG=\n   PROJECT=\n   AZURE_PERSONAL_ACCESS_TOKEN=\n   ```\n\n2. Run from your projects root:\n\n   ```bash\n   maru start\n   ```\n\n3. The CLI will:\n   - Check environment (Node, Docker, etc.)\n   - Prompt repo \u0026 mode selection\n   - Allocate/reuse ports\n   - Generate `.env` files\n   - Start services \u0026 log viewer\n\n👉 Open the provided web URL or watch logs in terminal.\n\n---\n\n## 🛠️ Commands\n\n| Command   | Description                  |\n| --------- | ---------------------------- |\n| `start`   | Start selected repos \u0026 infra |\n| `profile` | Manage saved profiles        |\n| `help`    | Show help                    |\n| `version` | Show CLI version             |\n\n**Global Options**\n\n- `-v, --verbose` → verbose logging\n- `--projects-dir \u003cpath\u003e` → base directory (default: `PROJECTS_DIR` or cwd)\n- `--skip-cloud` → ignore Azure/cloud vars\n- `-p, --profile \u003cname\u003e` → reuse a saved profile\n\nExamples:\n\n```bash\nmaru start --verbose\nmaru start --projects-dir ~/workspace\nmaru start --skip-cloud\nmaru start --profile \"frontend+api\"\n```\n\n---\n\n## 📂 Profiles \u0026 Project Discovery\n\n- CLI scans `--projects-dir` for repos\n- You pick repos \u0026 modes (local / docker / hybrid)\n- Save as a **profile** for reuse\n\nProfiles include:\n\n- Selected repos\n- Cloud env usage (on/off)\n- Execution modes\n- Logging mode (web/terminal)\n- Port allocations\n\n---\n\n## ⚙️ Configuration\n\nConfiguration is interactive. Under the hood, it manages:\n\n- Execution mode: `local` | `docker` | `hybrid`\n- Projects dir\n- Per-repo overrides\n- Logging (terminal / web)\n- Docker compose generation\n- Health checks \u0026 auto-stop\n\nArtifacts:\n\n- `.env` files per repo\n- `ports-map.json` (stable allocations)\n- `docker-compose.unified.yml` (docker/hybrid)\n\n---\n\n## 🌱 Environment Management\n\nEnv files are built from:\n\n1. **Global files**:\n   - `global.env` (backend)\n   - `frontend.global.env` (frontend)\n2. **Cloud vars**: (Azure, optional)\n3. **Local defaults** for infra:\n   - Postgres → `postgres:5432`\n   - TimescaleDB → `timescaledb:5432`\n   - Redis → `localhost:6379`\n   - RabbitMQ → `localhost:5672`\n\n➡️ Local values always override cloud.  \n➡️ If `.env.example` missing → skipped with warning.\n\n---\n\n## 🧠 Infra: Docker vs External\n\nshikamaru decides whether to spin up infra in Docker:\n\n| Service     | Provisioned in Docker when host is… | Example Docker default                                        |\n| ----------- | ----------------------------------- | ------------------------------------------------------------- |\n| Postgres    | empty / localhost / `postgres`      | `postgresql://default_user:default_password@postgres:5432`    |\n| TimescaleDB | empty / localhost / `timescaledb`   | `postgresql://default_user:default_password@timescaledb:5432` |\n| Redis       | empty / localhost / `redis`         | `redis://redis:6379`                                          |\n| RabbitMQ    | empty / localhost / `rabbitmq`      | `amqp://guest:guest@rabbitmq:5672`                            |\n\nTo force external: set a real host (corp/cloud).  \nTo force Docker: leave host blank or use docker hostname.\n\n---\n\n## 🔌 Port Management\n\n- Host ports allocated in **4000–5000** range\n- Stable across runs via `ports-map.json`\n- Auto-resolves conflicts\n\nExample `ports-map.json`:\n\n```json\n[\n  {\n    \"Service\": \"campaign-management\",\n    \"Internal Port\": 3000,\n    \"Host Port\": 4136,\n    \"Mode\": \"docker\"\n  }\n]\n```\n\n---\n\n## 🚦 Execution Modes\n\n- **Local** → runs services on host\n- **Docker** → unified compose file for all\n- **Hybrid** → some local, some docker\n\nWhen Docker/hybrid:\n\n1. Detects Dockerfiles\n2. Generates `docker-compose.unified.yml`\n3. Starts infra + services with health checks\n4. Streams logs\n\nStopping brings everything down cleanly.\n\n---\n\n## 📺 Logging \u0026 Web UI\n\n- **Terminal** → colored logs, interactive\n- **Web** → Express + Socket.IO + React UI\n\nWeb UI features:\n\n- Live log stream\n- Filters (service, level, search)\n- Pause / resume / clear\n- Stats per service\n\nDefault: `http://localhost:3001` (auto-increments if busy).\n\n---\n\n## 🧯 Troubleshooting\n\n- Ensure Node ≥ 16, Docker running\n- Port conflicts → CLI retries next available\n- Compose errors → check Dockerfiles, permissions\n- For fully local env → `--skip-cloud`\n\n---\n\n## 🤝 Contributing\n\nPRs/issues welcome. Keep code modular \u0026 clean.\n\n---\n\n## 📄 License\n\nMIT © 2025\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibrahimasry%2Fshikamaru","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibrahimasry%2Fshikamaru","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibrahimasry%2Fshikamaru/lists"}