26 पॉइंट द्वारा GN⁺ 2025-11-28 | 1 टिप्पणियां | WhatsApp पर शेयर करें
  • Gemini CLI Google के Gemini मॉडल को सीधे टर्मिनल में इस्तेमाल करने वाला एक open source AI सहायक है, जो natural language commands के जरिए code writing, debugging और automation tasks करने वाला interactive command-line tool है
  • लगभग 30 expert tips के माध्यम से persistent context management (GEMINI.md), custom commands, MCP server extensions, memory features, checkpoint restore जैसी advanced capabilities को कवर किया गया है
  • file·image references (@), YOLO mode (auto approval), headless execution, multi-directory work, IDE integration (VS Code) जैसी developer workflow optimization features प्रदान करता है
  • GitHub Action, extensions, telemetry, token caching जैसी automation·observability·extensibility पर केंद्रित नई सुविधाएँ शामिल हैं
  • Gemini CLI सिर्फ एक साधारण AI chat नहीं, बल्कि पूरे development environment को एकीकृत रूप से नियंत्रित करने वाला agentic development platform बनता जा रहा है

Gemini CLI अवलोकन

  • Gemini CLI Google Gemini मॉडल को सीधे टर्मिनल में इस्तेमाल करने के लिए एक AI-आधारित command-line interface है
    • Node.js/TypeScript आधारित, और सभी प्रमुख OS पर चलता है
    • natural language में command देने पर code generation, debugging, system configuration जैसे multi-step tasks कर सकता है
  • इंस्टॉल npm install -g @google/gemini-cli या npx @google/gemini-cli से किया जा सकता है
  • authentication के लिए Google account login (free) या API key (paid/enterprise) दोनों का समर्थन है
    • free account में लगभग प्रति मिनट 60 और प्रतिदिन 1,000 requests संभव हैं
    • API key के उपयोग पर data protection बेहतर होती है और log retention policy लागू होती है
  • basic execution gemini command से शुरू होती है, और / commands (session control) तथा ! commands (shell execution) का समर्थन करती है
    • system changes के समय user approval (Y/n) माँगने वाला safe mode डिफ़ॉल्ट रूप से enabled रहता है

Tip 1 — GEMINI.md के जरिए persistent context management

  • project-specific instructions या background information को GEMINI.md फ़ाइल में सहेजकर AI को हमेशा एक ही context में जवाब देने में मदद मिलती है
    • उदाहरण: coding style, architecture, function rules आदि
  • global (~/.gemini/GEMINI.md) और project-specific .gemini/GEMINI.md को hierarchical तरीके से merge किया जाता है
  • /memory show से अभी loaded context देखा जा सकता है, और /memory refresh से refresh किया जा सकता है
  • /init command से base template बनाया जा सकता है, और @include से multiple files लोड की जा सकती हैं

Tip 2 — custom slash commands बनाना

  • repeated tasks को automate करने वाले custom commands को TOML files में define किया जा सकता है
    • उदाहरण: /test:gen → requirements के आधार पर Jest tests generate करना
  • global (~/.gemini/commands/) या project-specific (.gemini/commands/) रूप में register किया जा सकता है
  • commands prompt templates के आधार पर काम करते हैं और टीमों के बीच साझा किए जा सकते हैं
  • consistent formatting, role assignment (जैसे /review:security) जैसी workflow standardization के लिए उपयोगी

Tip 3 — MCP server से Gemini का विस्तार

  • Model Context Protocol(MCP) server के जरिए external systems से integration किया जा सकता है
    • उदाहरण: Figma, Google Docs, Clipboard, internal DB आदि
  • gemini mcp add command से server register किया जाता है, और configuration settings.json में save होती है
  • /mcp command से registered servers और tools की सूची देखी जा सकती है
  • OAuth 2.0 support के कारण सुरक्षित API connections संभव हैं

Tip 4 — memory जोड़ना और बुलाना

  • /memory add "<text>" से महत्वपूर्ण जानकारी long-term memory में save की जा सकती है
    • उदाहरण: “RabbitMQ port 5673 है”
  • /memory show से पूरी memory देखी जा सकती है, और /memory refresh से उसे refresh किया जा सकता है
  • decision logs या personal preferences (जैसे बोलने का अंदाज़, नाम आदि) सहेजने में उपयोगी

Tip 5 — checkpoint और /restore restore feature

  • file changes से पहले automatic snapshots बनते हैं, और /restore से पिछली स्थिति में लौटा जा सकता है
  • --checkpointing option या settings file में इसे enable किया जा सकता है
  • /restore list से checkpoint सूची देखी जा सकती है, और /restore <id> से restore किया जा सकता है
  • Git के साथ इस्तेमाल करने पर यह AI tasks के लिए safety net की तरह काम करता है

Tip 6 — Google Docs·Sheets पढ़ना

  • Workspace MCP server configured होने पर Google Docs/Sheets links को सीधे पढ़कर उनका summary बनाया जा सकता है
  • OAuth authentication आवश्यक है, और /read_google_doc जैसी commands से access किया जा सकता है
  • document, sheet, Drive files को link के रूप में refer करके copy किए बिना context inject किया जा सकता है

Tip 7 — @ syntax से file·image references

  • @फ़ाइलपथ से code, documents, images को सीधे prompt में attach किया जा सकता है
    • उदाहरण: Explain this code: @./src/main.js
  • .gitignore और .geminiignore rules अपने-आप लागू होते हैं
  • image recognition (OCR सहित) और multiple file comparison का भी समर्थन है

Tip 8 — instant tool creation

  • ज़रूरत पड़ने पर Gemini temporary scripts या MCP servers खुद बना सकता है
    • उदाहरण: JSON parser, log analyzer आदि
  • generated code को diff में review करके approve किया जा सकता है
  • उपयोगी scripts को बाद में custom commands में बदला जा सकता है

Tip 9 — system troubleshooting और configuration

  • project के बाहर भी इस्तेमाल किया जा सकता है, और यह development environment management assistant की तरह काम करता है
    • उदाहरण: .bashrc modify करना, error logs analyze करना, Docker install automate करना
  • command execution से पहले हमेशा approval माँगता है, जिससे safe system adjustments संभव होते हैं

Tip 10 — YOLO mode (auto approval)

  • --yolo या Ctrl+Y से सभी tool executions अपने-आप approve हो जाते हैं
  • repeated tasks को तेज़ करने में उपयोगी, लेकिन जोखिम मौजूद है
  • केवल कुछ commands को auto-approve करने के लिए whitelist configure की जा सकती है

Tip 11 — headless और script mode

  • gemini -p "prompt" से non-interactive execution किया जा सकता है
  • GEMINI_SYSTEM_MD से system prompt बदला जा सकता है
  • JSON output (--format=json) और session summary file (--session-summary) का support है
  • CI/CD और automation scripts में integration के लिए उपयुक्त

Tip 12 — chat session save और resume

  • /chat save <name> से session save, और /chat resume <name> से restore किया जा सकता है
  • /chat list से सूची देखी जा सकती है, और /chat share से share किया जा सकता है
  • लंबे debugging sessions या multiple projects साथ-साथ चलाने में उपयोगी

Tip 13 — multi-directory workspace

  • --include-directories या settings file से कई folders को एक workspace में integrate किया जा सकता है
  • /directory show से अभी शामिल folders देखे जा सकते हैं
  • frontend·backend को एक साथ modify करने जैसे polyrepo environments के लिए उपयोगी

Tip 14 — AI-आधारित file organization

  • directory के भीतर files को type के अनुसार classify और move किया जा सकता है
    • उदाहरण: images→Images, PDF→Documents
  • image contents के आधार पर automatic renaming भी संभव है
  • execution से पहले command preview के जरिए safe review की सिफारिश की जाती है

Tip 15 — conversation compression से context बनाए रखना

  • /compress command लंबी बातचीत को summarize करके context space खाली करती है
  • केवल मुख्य जानकारी को बनाए रखते हुए session जारी रखा जा सकता है
  • automatic compression threshold भी configure किया जा सकता है

Tip 16 — ! से shell commands चलाना

  • !command से terminal commands सीधे execute किए जा सकते हैं
  • केवल ! दर्ज करने पर shell mode में प्रवेश होता है, और फिर ! से बाहर निकला जा सकता है
  • AI conversation और system commands को एक ही interface में एकीकृत करता है

Tip 17 — सभी CLI tools को Gemini tools की तरह उपयोग करना

  • $PATH के भीतर मौजूद सभी commands को AI call कर सकता है
    • उदाहरण: convert, docker, ffmpeg, git आदि
  • environment के अनुसार PATH restrictions या whitelist configuration की सिफारिश की जाती है

Tip 18 — multimodal input का उपयोग

  • images, PDF, audio files को @ के साथ attach करके analyze किया जा सकता है
    • उदाहरण: UI screenshot का वर्णन, error image analysis, OCR processing
  • visual materials के आधार पर code generation और data extraction का समर्थन

Tip 19 — $PATH और tool access control

  • restricted PATH के साथ execution करके stability और security बढ़ाई जा सकती है
  • settings.json के excludeTools से risky commands को block किया जा सकता है
  • --sandbox option से Docker-isolated environment में execution का समर्थन है

Tip 20 — token caching और usage tracking

  • API key या Vertex authentication के समय token reuse से cost कम की जा सकती है
  • /stats command से cache hit rate और token usage देखा जा सकता है
  • --session-summary से session-wise JSON report save की जा सकती है

Tip 21 — /copy से clipboard copy

  • आख़िरी output (जैसे code) को तुरंत clipboard में copy किया जा सकता है
  • macOS(pbcopy), Windows(clip), Linux(xclip) support उपलब्ध है

Tip 22 — Ctrl+C shortcut control

  • एक बार दबाने पर current task रुकता है, दो बार दबाने पर CLI बंद हो जाता है
  • shell mode में Ctrl+C या Esc से बाहर निकला जा सकता है

Tip 23 — settings.json से user settings

  • theme, sandbox, auto approval, Vim mode जैसी विस्तृत settings संभव हैं
  • /settings command से interactive editing support मिलता है
  • global (~/.gemini/) और project-specific settings merge की जाती हैं

Tip 24 — VS Code integration

  • VS Code extension (Companion Extension) के जरिए file, cursor, selection area की automatic recognition मिलती है
  • code change suggestions पर VS Code diff viewer अपने-आप खुलता है
  • /ide install, /ide enable, /ide status से इसे manage किया जा सकता है

Tip 25 — GitHub Action automation

  • Gemini CLI GitHub Action के जरिए issue classification, PR review automation संभव है
  • @gemini-cli mention से test code generation जैसी requests की जा सकती हैं
  • /setup-github command से workflow file अपने-आप generate की जा सकती है

Tip 26 — telemetry (Observability)

  • OpenTelemetry-आधारित session metrics, logs, traces collection संभव है
  • "telemetry.enabled": true setting या --telemetry flag से activate किया जा सकता है
  • local files, GCP, Prometheus जैसे कई backends को data भेजा जा सकता है

Tip 27 — roadmap monitoring

  • GitHub पर सार्वजनिक Gemini CLI roadmap में आने वाले features देखे जा सकते हैं
    • उदाहरण: background agents, model विस्तार, UI improvements आदि
  • community feedback और feature suggestions में भाग लिया जा सकता है

Tip 28 — extensions

  • gemini extensions install <URL> से external services का integration किया जा सकता है
    • उदाहरण: Cloud Run, BigQuery, Figma, Stripe आदि
  • extensions, MCP tools, commands और context जोड़ने वाली modular संरचना प्रदान करते हैं
  • /extensions command से active extensions की सूची देखी जा सकती है

अतिरिक्त फीचर — Corgi Mode 🐕

  • /corgi command से terminal में corgi animation चलाई जा सकती है
  • यह सिर्फ़ एक easter egg feature है, जो CLI इस्तेमाल के दौरान थोड़ा विराम देता है

निष्कर्ष

  • Gemini CLI code writing से लेकर system management, automation और collaboration तक को कवर करने वाला AI-आधारित development interface है
  • GEMINI.md, MCP, extensions, IDE integration आदि के जरिए persistent context और tool extensibility सुनिश्चित होती है
  • open source ecosystem और तेज़ updates के साथ यह developer workflow का केंद्रीय AI platform बनता जा रहा है

1 टिप्पणियां

 
GN⁺ 2025-11-28
Hacker News राय
  • मैं ऐसी सेटिंग्स बिल्कुल नहीं करता
    क्योंकि ये बहुत जल्दी पुरानी हो जाती हैं, और 80% तो ठीक से काम भी नहीं करतीं
    जब यह भी पक्का नहीं कि LLM उन्हें भरोसेमंद ढंग से कॉल करेगा, तो मुझे MCP सर्वर लिखने की ज़रूरत नहीं लगती
    मेरा नियम सरल है — अपने लिए documentation (templates, checklist आदि) खुद लिखो, और AI को एक बार कोशिश करने का मौका दो
    अगर वह एक बार में सही न करे, तो दस्तावेज़ सुधारो या फिर मैं खुद कर लेता हूँ

    • LLM को सांख्यिकीय दस्तावेज़ जनरेटर की तरह देखना मददगार रहा
      आखिरकार इसकी उपयोगिता training data और model evolution पर निर्भर है, और मुझे लगता है कि इसे औपचारिक grammar के बिना constraint programming की तरह संभालना सही है
      प्राकृतिक भाषा की व्यक्तिपरकता को देखते हुए, constraint वाक्यों को बार-बार निखारने वाली तेज iteration सबसे अच्छी है
      उदाहरण के तौर पर, मैंने Gemini पर 4 iteration करके एक पूरी तरह स्वचालित bash script हासिल की थी
      संबंधित अवधारणा के लिए Constraint programming देखें
    • हाल में agents में build-test-fix cycle खुद चलाने की क्षमता आई है, जो बहुत मददगार रही
      अब मैं उन्हें junior developer स्तर के काम दे सकता हूँ और खुद कुछ और कर सकता हूँ
    • AI agent को टीम के नए junior developer की तरह ट्रीट करना असरदार है
      अगर वह एक बार में फेल हो जाए, तो मैं documentation (.md फ़ाइल) बेहतर करता हूँ और फिर से कोशिश करता हूँ
      MCP को मैं security risk की वजह से ज़्यादा नहीं इस्तेमाल करता, लेकिन यह iterative loop काफ़ी efficient है
      इसके उलट, “एक बार में नहीं हुआ तो मैं खुद करूँगा” कहना ऐसा है जैसे नए hire को तुरंत निकाल देना
    • अभी ऐसा लग रहा है कि software development एक नए plateau की ओर बढ़ रहा है
      हम अभी उस बिंदु तक नहीं पहुँचे हैं, और जो skills अभी बना रहे हैं वे मानो ढलान पर खड़ी की जा रही हों
    • मुझे दोनों approaches उपयोगी लगती हैं
      1. नई session से शुरुआत करके context pollution से बचना, और
      2. अलग-अलग tools को जोड़कर काम आसान बनाना (Anthropic की हाल की पोस्ट देखें)
        मौजूदा prompt evaluation तरीक़े भरोसेमंद नहीं हैं, इसलिए मैं इसे बेहतर बनाने के लिए खुद agentic setting बना रहा हूँ
        कल मैंने Dagger-आधारित session time travel feature जोड़ा, और आज fork·clone·registry features जोड़ने वाला हूँ
  • Gemini CLI अभी जटिल coding tasks में कमज़ोर है
    इसकी वजह simple ReAct loop और कमज़ोर tool calling ability है
    फिर भी open source में इस पर तेज़ी से काम हो रहा है, इसलिए इसकी potential काफ़ी बड़ी है
    1M context window (जल्द 2M) और उदार free quota की वजह से मुझे लगता है कि इसे “खुलकर इस्तेमाल करना चाहिए (ABUSE IT)
    मैं इसे TUI/CLI orchestration tool की तरह इस्तेमाल कर रहा हूँ, और दूसरे tools द्वारा बनाए गए code को evaluate करने में भी यह काफ़ी काम आया
    हाल में मैंने Homebrew और MCP को जोड़ा है, और local LLM-आधारित Knowledge Manager (Nowledge Mem) के साथ integrate किया है
    मज़ेदार बात यह है कि मैंने Gemini CLI को SubAgent की तरह इस्तेमाल करके main context pollution से बचने का एक उदाहरण भी देखा
    संबंधित ट्वीट

    • Gemini CLI सच में एक जंगली जानवर जैसा है
      आप कहें “कोड मत बदलो, सिर्फ़ सुझाव दो”, फिर भी यह सीधे फ़ाइलें बदल देता है
      Pro 3 स्मार्ट है, लेकिन instruction following अभी भी अस्थिर है
    • मैंने Gemini 3 Pro का छोटा-सा टेस्ट किया, और यह बुनियादी coding tasks में भी संघर्ष करता दिखा
      मैंने Antigravity के ज़रिए कोशिश की, लेकिन सीमित quota की वजह से जटिल टेस्ट मुश्किल थे
      विस्तार से छाप के लिए यह लेख देखें
  • Addy Osmani Google Chrome और Gemini पर काम करने वाले आयरिश software engineer हैं, जिनके पास 25 साल का अनुभव है
    वे web performance सुधारने और AI-assisted development tools को लेकर उत्साही हैं, और 『Learning JavaScript Design Patterns』 सहित कई किताबें लिख चुके हैं

    • उन्होंने Patrick Collison से 2 साल पहले Irish Young Scientist प्रतियोगिता में पुरस्कार जीता था
      प्रतियोगिता लिंक
    • web performance community में उनकी बहुत ऊँची प्रतिष्ठा है
    • कहा जाता है कि उन्होंने पिछले 5 साल में 11 किताबें लिखी हैं, तो जिज्ञासा है कि क्या वे AI-assisted writing का उपयोग करते हैं
  • मैं चाहता हूँ कि LLM-agnostic coding agents ही standard बनें
    Codex या Gemini CLI की तरह हर कोई अपना पहिया फिर से बनाने के बजाय, काश LLM provider को plugin के रूप में बदला जा सकता
    अभी Claude Code सबसे अच्छा है, लेकिन लगता नहीं Anthropic उस दिशा में जाएगा
    शायद अब अगली पीढ़ी के open-source coding agents का इंतज़ार करना होगा

    • ऐसा tool पहले से मौजूद है: Aider (aider.chat)
      हालाँकि, ऐसे CLI असली tools से ज़्यादा subscription model के लिए interface जैसे लगते हैं
      नए models token इतना ज़्यादा खर्च करते हैं कि API billing से ज़्यादा monthly subscription व्यावहारिक लगती है
    • Opencode (SST द्वारा बनाया गया) उस विज़न का अच्छा उदाहरण है
      मैंने इसे पिछले कुछ दिनों में इस्तेमाल किया और काफ़ी संतुष्ट रहा
      GitHub लिंक
      Crush, Aider, Amp Code, Emacs+gptel, Editor Code Assistant जैसे कई alternatives भी हैं
      लेकिन LLM और coding agents की co-design अहम है, इसलिए पूरी तरह अलगाव अभी अव्यावहारिक है
    • मुझे लगता है Claude Code सबसे अच्छा इसीलिए है कि वह agnostic नहीं है
    • Cursor भी एक अच्छा विकल्प है
      विडंबना यह है कि अब उसने अपना खुद का LLM भी अपना लिया है
      Cursor Composer परिचय
    • model-agnostic tools में मैं Roo Code या उसके fork Kilo की सिफारिश करूँगा
  • मैं कई महीनों से Gemini CLI इस्तेमाल कर रहा हूँ
    कंपनी में free subscription है, इसलिए इसे लगातार चला रहा हूँ
    कहा जाता है कि यह GEMINI.md फ़ाइल पहचानता है, लेकिन व्यवहार में अक्सर उसे नज़रअंदाज़ कर देता है
    फिर भी Tip 12, Tip 16 जैसे सुझाव उपयोगी थे
    AI की hallucination समस्या अभी भी बनी हुई है, लेकिन पहली बार इसी ने AI को सच में ‘मज़ेदार’ महसूस कराया
    खासकर जब मैंने इसे K8s PoC cluster को स्वायत्त रूप से debug करने दिया, तब logs लाना और errors ढूँढना सच में चौंकाने वाला था
    कभी-कभी जब यह बहुत बेवकूफ़ी करता है, तो मैं /quit टाइप करके खुद संभाल लेता हूँ, लेकिन फिर भी इसे मज़े से इस्तेमाल कर रहा हूँ

    • Gemini CLI को K8s cluster real time में debug करते देखना सच में अवास्तविक-सा लगता है
      मैंने भी अभी-अभी एक RKE2 cluster बनाया है, और इसे ज़रूर आज़माना चाहता हूँ
  • मुझे AI बहुत पसंद है
    इंटरनेट या iPhone की तरह यह मुझे ज़्यादा efficient इंसान बनाने वाला ज़रूरी tool लगता है
    लेकिन “AI का इस्तेमाल कैसे करें” वाली tutorial fatigue बहुत ज़्यादा हो गई है
    ज़्यादातर सामग्री की quality कम होती है, और यह लेख फिर भी उनसे बेहतर है
    यह वैसा ही लगता है जैसे JS developers हर हफ़्ते कोई नया framework पेश करते हों

    • आजकल “LLM को ऐसे इस्तेमाल करो” तरह की पोस्टें सच में उबाऊ हो गई हैं
      चाहे कोई भी लिखे, दिल से लिखे या सिर्फ़ engagement के लिए, अब उनमें दिलचस्पी नहीं बची
  • सच कहूँ तो ऐसी जटिल सेटिंग्स ज़रूरत से ज़्यादा हैं
    मैं तो बस AI पर चिल्लाने जैसे prompts से भी काफ़ी अच्छा काम निकाल लेता हूँ
    LazyVim और कुछ tools (git, ask, ripgrep) ही मुझे काफ़ी productive बना देते हैं
    खासकर Gemini 3 की token density ऊँची है और context बड़ा है, इसलिए यह बहुत उपयोगी है
    जब context बहुत बढ़ जाता है, तो मैं उससे README.MD में summary लिखवाता हूँ और नया agent शुरू करता हूँ
    ask tool लिंक

    • मैं भी लगभग इसी तरह इस्तेमाल करता हूँ, और Gemini 3 कमाल का अच्छा है
      दूसरे models से उतनी productivity नहीं मिली, लेकिन अब जटिल कामों में भी 80% चीज़ें एक बार में हो जाती हैं
  • manual scripting और LLM-assisted workflow का contrast दिलचस्प है
    अगर constraints स्पष्ट न हों तो दोनों फेल होते हैं, लेकिन जब वे स्पष्ट हों, तो LLM आश्चर्यजनक रूप से भरोसेमंद ढंग से काम करता है

  • आजकल AI/Agentic/Vibe coding की समस्या इसकी बहुत तेज़ evolution speed है
    best practices स्थापित होने से पहले ही पुरानी पड़ जाती हैं
    language और framework बदलते रहते थे, फिर भी समस्याओं को तोड़ना और codebase को समझना अपेक्षाकृत स्थिर था,
    लेकिन अब समझ नहीं आता कि वह संतुलन बिंदु कहाँ होगा

  • मुझे Gemini CLI कुछ ख़ास नहीं लगता
    अगर इस्तेमाल करना ही हो, तो मैं Opencode की सिफारिश करूँगा
    Google को भी Codex की तरह CLI शुरुआत से फिर बनानी चाहिए

    • लोगों का अनुभव अलग हो सकता है, लेकिन मेरे लिए Gemini CLI तेज़ और स्थिर है, इसलिए वही मेरा मुख्य tool है
    • Opencode ने भी हाल में TUI को पूरी तरह बदल दिया है
      और फ़िलहाल Gemini 3, Copilot के ज़रिए Opencode में काम नहीं करता
      issue लिंक
    • Opencode चलाने के लिए कुछ खास terminal emulators (WezTerm, Alacritty, Ghostty, Kitty) चाहिए बताए गए हैं
      एक साधारण TUI के लिए ऐसी शर्तें क्यों हों, यह सवाल था
      official docs में Gemini का सीधा ज़िक्र नहीं है,
      और लगता है कि यह Google Vertex AI के ज़रिए दिया जाता है
      शायद Google Workspace subscription के ज़रिए Gemini जोड़ा जा सकता हो
    • सोचता हूँ Codex का क्या हुआ — क्या सच में उसे फिर से बनाया गया था?