Coding
Build small apps in Canvas, get code that fits your repo, choose a CLI, and work with large codebases.
Code generation
Build small apps in Canvas, import your code so answers fit your repo, and choose between Gemini CLI and Antigravity CLI.
3 techniques →-
How Do You Build a Small App in Gemini Canvas? Click Add Files, then Canvas, and describe the app. Level 2: Context
- 1Use it in the preview
- 2Show console for errors
- 3Select & ask on one part
Then try the app again -
Gemini CLI or Antigravity CLI: Which Should You Use? If you're on a free account or Google AI Pro or Ultra, use Antigravity CLI, run with agy. Level 2: Context
- May 19, 2026Move announced
- Jun 18, 2026Gemini CLI cutoffstops serving Google AI Pro and Ultra
- Oct 13, 2026Antigravity in the macOS app
-
How Do You Get Gemini to Write Code That Fits Your Repo? Import the code rather than describing it, then ask for a plan that names real files before you ask for any code. Level 3: Workflows
- 1Import Code
- 2Ask for a plan
- 3Approve one change
- 4Paste and test
Large-context code
Find out how much code fits on your plan, import a repo instead of pasting it, put your question last, and cut repeat costs on the API.
4 techniques →- How Do You Cut the Cost of Repeat Questions About a Large Codebase? On the Gemini API, put the large code at the very start of each request and keep it identical, so you hit Gemini's implicit cache. Level 4: Multi-tool systems
- How Much Code Fits in Gemini's Context Window? In the app, it depends on your plan: 32k tokens with no plan, 128k on AI Plus and 1 million on AI Pro and Ultra. Level 2: Context
-
Can You Paste a Whole Codebase into Gemini? Only on some plans, and pasting isn't the best way. Level 3: Workflows
- 1Repo or folder per chat
- 5,000Files at most
- 100 MBTotal size at most
-
Where Should Your Question Go in a Long Gemini Prompt? At the end, after all the material. Level 3: Workflows
- 1Role, rules, output formatat the very start or in the system instruction
- 2All the code or documentswrapped in consistent tags
- 3"Based on the information above"a bridge to the question
- 4One specific questionlast
Can you code with Gemini?
Four questions on the right tool, context windows and API costs. You see each answer right away, with no account to create.
Pick the right tool first
Google now has several coding routes, and they do different jobs. The Gemini app reads code you import and answers questions about it. Canvas builds small one-page apps you can click through. Antigravity, with its agy command, is the agent that edits your files and runs commands. Gemini CLI remains for organizations on Gemini Code Assist and for paid API keys, but it stopped serving free and Google AI Pro users on June 18, 2026. Many tutorials still say otherwise.
Why the context window matters here
Coding is where the size of the window really shows. Google estimates that 1 million tokens holds roughly 30,000 lines of code in its app docs, and 50,000 lines in its API docs. That size is available only on Google AI Pro and Ultra, or on the API. On lower plans you'll need to choose the files that matter, and the lessons below show how to work out what fits.
Can Gemini read a GitHub repository?
Yes. In the Gemini app, click Add files, More Uploads, then Import Code, and enter a repository or branch URL. Google's limit is one repository per chat, with up to 5,000 files and 100 MB.
Is Gemini CLI still free?
Not for individuals who sign in with Google. Free and Google AI Pro and Ultra users were moved to Antigravity CLI on June 18, 2026. Gemini CLI itself is still open source, and it works with Code Assist Standard or Enterprise licenses and with paid API keys.
Which Gemini model is best for coding?
Google's models page describes Pro as suited to advanced coding and Argon as its top tier for complex workflows, both in the app. On the API, it recommends Gemini 3.8 Flash for long-horizon software engineering, and Gemini 4 Argon as its flagship reasoning model.
Does Google AI Pro include Gemini API access?
No. The API is billed separately per token through Google AI Studio. Google AI Pro does include entry rate limits for the agent model in Antigravity.