Tips for getting started: 1. Ask questions, edit files, or run commands. 2. Be specific for the best results. 3. Create GEMINI.md files to customize your interactions with Gemini. 4. /help for more information.
╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │ > Type your message or @path/to/file │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯
~/workspace/blog (save*) no sandbox (see /docs) gemini-2.5-pro (100% context left)
首次运行时,它会引导完成几个设置步骤:
选择主题风格: 为界面选择一个喜欢的颜色主题。
授权登录: 它会提示您通过 Google 账户进行登录授权。这通常会生成一个链接,需要在浏览器中打开并授权。
授权后,就可以享受免费的调用额度(预览版期间每天有 1000 次请求)。
四、配置API登陆
如果你没有配置 API,每次运行 gemini-cli 都要重新登陆一次,可以配置 API 修改登录方式;
Basics: │ │ Add context: Use @ to specify files for context (e.g., @src/myFile.ts) to target specific │ │ files or folders. │ │ Shell mode: Execute shell commands via ! (e.g., !npm run start) or use natural language │ │ (e.g. start server). │ │ │ │ Commands: │ │ /clear - clear the screen and conversation history │ │ /help - forhelp on gemini-cli │ │ /memory - Commands for interacting with memory. │ │ show - Show the current memory contents. │ │ add - Add content to the memory. │ │ refresh - Refresh the memory from the source. │ │ /theme - change the theme │ │ /docs - open full Gemini CLI documentation in your browser │ │ /auth - change the auth method │ │ /editor - set external editor preference │ │ /privacy - display the privacy notice │ │ /stats - check session stats. Usage: /stats [model|tools] │ │ /mcp - list configured MCP servers and tools │ │ /extensions - list active extensions │ │ /tools - list available Gemini CLI tools │ │ /about - show version info │ │ /bug - submit a bug report │ │ /chat - Manage conversation history. Usage: /chat <list|save|resume> <tag> │ │ /quit - exit the cli │ │ /compress - Compresses the context by replacing it with a summary. │ │ ! - shell command │ │ │ │ Keyboard Shortcuts: │ │ Enter - Send message │ │ Ctrl+J - New line │ │ Up/Down - Cycle through your prompt history │ │ Alt+Left/Right - Jump through words in the input │ │ Shift+Tab - Toggle auto-accepting edits │ │ Ctrl+Y - Toggle YOLO mode │ │ Esc - Cancel operation │ │ Ctrl+C - Quit application