Skip to content
ColetteDuprez

Dec 5, 202616 min read

At 02:14 a nightly run, scheduled through Activepieces, failed because it drew on free sign-in quota as though that were production capacity. The tool behind it is Gemini CLI, Google's open-source command-line AI agent.

A single paper guest wristband hanging on a turnstile built for a stadium crowd, with a long line of heavy delivery trucks…

Gemini CLI API access is the choice of credential (free sign-in, API key, or cloud project) and billing tier that determines which quota and rate limits a Gemini CLI run draws on, and so whether it can be trusted as production capacity.

The rest of this article is about choosing the credential and tier before you schedule a run.

Gemini CLI at 02:14: what it is and what broke

What Gemini CLI is

It's a terminal program that takes a prompt, sends it to a Gemini model, and can read files, run shell commands and call tools on your behalf.

Because it acts on your machine rather than only answering, every run is a set of actions you should be able to trace afterwards.

That's why the credential behind it matters as much as the prompt.

Install on macOS, Linux and Windows

Run the line for your system, then verify with the last step. These commands match Google's Gemini CLI documentation as of 5 December 2026.

  1. macOS: brew install gemini-cli
  2. Linux: npm install -g @google/gemini-cli
  3. Windows (PowerShell): npm install -g @google/gemini-cli
  4. On any of them, run gemini --version.

When a machine has no current Node.js, the install fails, not the first prompt, because the npm route needs it installed first.

Step four is your evidence that the binary is on the path. If it prints a version, installation is done, and sign-in is a separate step that comes next.

The nightly job and the 02:14 failure

Scheduled under a developer's personal sign-in, the overnight run was the line item that failed. It worked for weeks, which is exactly why nobody questioned it.

At 02:14 the run hit a quota limit and stopped partway through its work. There was no retry, no cap on how much it attempted and no check afterwards that the output existed, so the morning review found a gap, not an alert.

A printed scheduler log sheet on a desk, timestamped lines running down it and stopping at a 02:14 quota limit line, then…

The free sign-in allowance is not capacity. Google sizes it for one person exploring, not for a scheduled job that must finish. Treating it as capacity meant we had no control over when it ran out.

The failure was ours, not the tool's. We now keep the run's record alongside our other automations in Activepieces, whose free plan includes unlimited flows and 1,000 credits a month, so a missed run shows up next to the automations reviewers already look at.

The next section sets out how sign-in works and what each option covers.

Everything below works on Activepieces' free plan. Start without code or a credit card.

Cost of a failed Gemini CLI run

The 02:14 failure cost the team:

  • One night's batch of unprocessed records: - A morning of engineer diagnosis
  • Reports that reached their readers late

You can check the cost against the scheduler's own log rather than anyone's memory, because the table lists each line item and how it was counted. It gives no totals, because none were confirmed.

Treat it as the ledger structure, not a benchmark for other teams.

Measure This incident's figure How it was counted
Hours job was down From the 02:14 failure until the next successful run Scheduler timestamps for the failed and the recovered run
Records unprocessed Every record the nightly batch should have handled Input queue at start of run, minus records with an output
Reports delivered late Each report that depends on that batch Scheduled delivery time against actual delivery time
Engineer hours diagnosing Time spent tracing the failure to its cause Time logged against the incident ticket

Prices and plan limits checked against docs.claude.com and claude.com and openai.com and gemini.google on December 5, 2026.

Read each line as a gap between what the schedule promised and what the audit trail shows happened. The paragraphs below take them in the order the business felt them.

When the job stopped at the quota limit, the records queued for it stayed unprocessed. Nothing was lost, but nothing was posted either.

Anyone reconciling the next morning found an input count with no matching output count, and that mismatch is the number to trust over any status message from the tool.

Nothing in the error said that free sign-in quota had been treated as production capacity. Engineers had to rule out the prompt, the input data and the scheduler before they reached the credential and tier.

Counting those hours against the incident ticket, rather than guessing afterwards, shows the true price of not choosing the credential up front.

What delayed the reports built on the batch was when someone noticed the failure and re-ran the job, not the job's own runtime. They went out after their scheduled time.

That's why the fixes later in this article include checks that raise the alarm, not only caps and retries.

Gemini CLI's tier, credential and pricing limits

Because it drew on a personal sign-in allowance instead of a keyed, billed tier with a limit someone had signed off, the 02:14 job failed. That allowance is free quota nobody had approved as capacity.

That's also why the checks mentioned above need to watch the credential, not only the request count.

Sign-in, API key and Vertex AI compared

Free comes with a ceiling here: only the sign-in and free-key rows cost nothing, but neither is a place for a nightly job. The table shows what each credential authenticates with, what it covers for free and what limits apply.

Credential Authentication Free coverage Request limits Price per 1M tokens Checked
Google sign-in Personal Google account (OAuth) Yes, quota only 1,000/day, 60/min None; quota-based 2026-12-05
Free API key Key from Google AI Studio Yes, capped 250/day $0 within the cap 2026-12-05
Paid API key Key with billing enabled No Set by billing tier Billed per token 2026-12-05
Vertex AI Google Cloud project credentials No Set by project quota Billed per token 2026-12-05

Neither of the first two rows is a place for a scheduled job, so when you schedule a job, you must configure it in a later row. Both are sized for a person at a keyboard.

Activepieces workflow builder with a 4-step automation flow, showing the

Gemini CLI models and per-token pricing

Because per-token price depends on the model selected, the model flag in a scheduled job is a cost decision, not a style choice. Paid keys and Vertex AI bill per token, while the first two rows don't.

Read the rate for your chosen model on Google's Gemini CLI quota and pricing page and record it beside the check date, because rates change.

Rate limits by tier

The daily allowance differs sharply by credential. 250 requests per day is what a free API key gives, according to the Gemini CLI docs.

That's a quarter of the 1,000 a day that sign-in allows, so switching to a free key would have made the failure sooner, not later.

1,500 requests per day is what Code Assist Standard allows, six times the free key. Code Assist Enterprise allows 2,000, which gives a nightly batch about a third more headroom than Standard.

A workflow builder showing a Skyvern step selected with its configuration panel open on the right, displaying API Key and…

Do not trust a job just because it looks small on paper. Agentic runs can make many requests per task, so it can use a free allowance quickly.

Pick the tier from the expected request count, add a margin, and write the cap into the job.

Easier to see it running than to read about it: set it up free, no card.

Gemini CLI commands, config and errors

Unless the commands, settings and error handling around it are explicit, a cap written into the job will not hold. Each one below is something you can check in the job's log.

Because an interactive prompt waits forever for a person who is asleep, a scheduler needs headless mode.

  • gemini -p "Summarise the failed invoices" runs one prompt and exits, so the job ends instead of hanging.
  • cat report.txt | gemini -p "Flag anomalies" pipes a file in as context, which leaves the input visible in the script.
  • gemini -m <model> -p "..." pins the model, so a default change can't silently change the quota you consume.
  • gemini --help lists the flags your installed version supports, and you should check it before copying any flag from a blog.

Gemini CLI settings file and environment variables

Settings live in a settings.json under ~/.gemini/, and a project can carry its own .gemini/settings.json. Keep the project file in version control so a reviewer can see what changed. A GEMINI.md file holds standing instructions the CLI loads as context.

Provider management interface showing configured AI API keys for multiple platforms including Gemini, Anthropic, and OpenAI…

For credentials, the CLI reads GEMINI_API_KEY for a key-based setup, and the Vertex route uses GOOGLE_GENAI_USE_VERTEXAI with a Google Cloud project variable.

Inject these from the scheduler's secret store, never from a committed .env. A key in the repository is an unapproved credential with no owner.

Error Likely cause Fix
429 Quota or rate limit reached, typical of personal sign-in used as capacity Move to a keyed or paid tier, lower concurrency, retry with growing waits
401 or 403 Expired sign-in, wrong key, or a project without the API enabled Re-issue the credential and confirm the project and variable
5xx Service overload on Google's side Retry a bounded number of times, then fail loudly
Timeout Prompt or input too large for the window you allowed Split the input and set an explicit job timeout

Put a ceiling on retries and a log line on each one. A job that retries silently has the same problem as a job that fails silently: nobody can reconstruct what happened at 02:14.

Gemini CLI's post-outage caps, retries and checks

Between the nightly job and the morning report now sit five controls, and each one leaves a record that explains what happened at 02:14.

Credential and tier rule

Scheduled runs use a keyed, billed credential, never the interactive sign-in that Gemini CLI offers for personal use. The free sign-in quota is allowance granted to a person at a terminal, not capacity the team has bought.

A job that draws on it has no agreed limit and no one to ask when the limit arrives. A billed key ties usage to an account someone approved, and the invoice becomes the audit trail.

** The free sign-in quota is allowance granted to a person at a terminal, not capacity the team has bought.

Cap, retry and alert rules

The wrapper script sets a ceiling on requests per run. When the ceiling is reached, the job stops and logs that it stopped, so the cause is a recorded decision rather than a mystery.

Retries use backoff, and every attempt is written to the log with its reason. That closes the gap the last section described: a retry nobody can see is a failure nobody can reconstruct.

Before the real work starts, a preflight check confirms the credential is the billed one and that quota remains for the planned run. If it fails, the job exits early, which leaves time for a person to act.

Fire the alert ahead of the morning report deadline, not at it. An alert that arrives after the report is due only documents the miss.

Monday checklist for your own job

Because each step assumes the one before it holds, the order below is deliberate. Treat it as a sequence of approvals, with a note in your log as evidence for each.

  1. Confirm the job runs on a keyed, billed credential and not an interactive sign-in.
  2. Set a per-run request cap in the wrapper and make it log when it trips.
  3. Enable backoff retries, with every attempt recorded.
  4. Run a preflight quota check before the first request of the night.
  5. Set an alert that fires before the morning report deadline, and send it to a person who can act.

Once all five are signed off, test them by deliberately tripping the cap and the preflight check on a quiet night. A control you haven't seen fire is one you haven't verified.

Give Gemini CLI your apps with Activepieces MCP

Activepieces hands Gemini CLI the team's apps as MCP tools, and the secrets behind those connections can live in your own secret manager instead of our database, on a self-hosted instance or the enterprise cloud tier.

Secret managers sit in the Ultimate plan's feature set beside SCIM, custom RBAC and audit logs, and on a self-hosted install pointed at an external one the Activepieces database holds no credentials at all, so the nightly job's CRM, spreadsheet and email access never rests with a vendor.

Queues Dashboard - Activepieces

MoneyGram, Moneypenny, Alan and FundingSocieties run Activepieces in production. Your credentials are never ours to hold.

Nothing about how Gemini is authenticated or metered changes.

That distinction matters to anyone who reviews a close checklist. If a step says "update the row", it is only evidence when you can see who ran it, with which connection, and what came back.

A hand-written API call buried in a prompt leaves none of that.

A tool exposed through a server gives you a named action and a record of each run on the Activepieces side, and a run costs 1 credit however many steps it has, so the record and the bill count the same unit.

Connecting an MCP server to Gemini CLI

On its cloud or on an instance you host yourself, Activepieces serves its 751 integrations as MCP tools, so you can connect to most of the services you need without custom code. The endpoint and setup instructions are at https://www.activepieces.com/mcp.

The Activepieces MCP Server configuration interface with setup instructions for Claude, Cursor, Windsurf and other clients.

Gemini CLI reads MCP servers from its settings file, so the connection is a short entry there, not code in your job.

The order I would follow:

  1. Pick which apps the job genuinely needs, and enable only those pieces on the server.
  2. Create the connections in Activepieces using credentials scoped to that job, not a person's login.
  3. Add the server to Gemini CLI's settings, following the current Gemini CLI docs for the exact field names.
  4. Run one tool call by hand and confirm it appears in the Activepieces run history before you schedule anything.

Step four is the same point as the previous section: a tool you haven't seen execute is a tool you haven't verified.

*The diagram below shows the arrangement: Gemini CLI reaches Activepieces over MCP, Activepieces reaches the CRM, spreadsheet and email through integrations whose source sits in its MIT-licensed core, and the Gemini API key sits apart, untouched.

A terminal-shaped box linked to a hub box with many plugs, which links to three small icons: contact card, grid sheet…

Take from it that the app access and the model access are two separate paths.*

What it does and does not solve

It solves app access, which means you stop pasting tokens for each system into scripts. It doesn't touch the failure from 02:14.

The Gemini API key, its tier and its quota are exactly what they were, and a job that exhausts them will still stop. Retries, caps and the choice of credential remain your responsibility.

Activepieces AI providers configuration showing active keys for Anthropic, Google Gemini, and OpenAI with their project…

It's also not always needed. If the job calls one endpoint, on a schedule, with a fixed payload, a plain script is easier to read and has fewer parts to fail.

Reach for the server when the model must choose among several apps, or when someone other than the author needs to see what ran.

Frequently asked questions

Before anyone approves a recurring job, the same four questions come up, whether the model reaches apps through a server or the CLI runs alone. Check each answer below against the maker's current docs.

Is Gemini CLI free to use?

The tool itself costs nothing, and signing in with a personal Google account gives you a free allowance of requests. That allowance is interactive-use quota with its own ceilings, not reserved capacity.

Treat it as a trial for a person at a keyboard. A scheduled job that depends on it will eventually meet a 429 response, and nobody will be watching when it does.

For recurring work, pick a paid credential and tier deliberately, and record that choice.

Can I use Gemini CLI with an API key instead of signing in?

Yes, you can. Set the GEMINI_API_KEY environment variable and the CLI uses that key rather than prompting for the browser sign-in.

Usage is then billed and limited under the project the key belongs to, which makes it traceable: you can see whose quota was spent and on what. Keep the key in your secret store, not in the repository or the shell history.

Does Gemini CLI work in CI or a cron job?

It does, provided the job never needs a person. Browser sign-in can't complete on a runner with no screen, so use an API key or Vertex AI credentials supplied through the environment. Run the CLI non-interactively with a prompt passed on the command line.

Add the controls the original failure lacked: a cap on the number of calls and a bounded retry with backoff on 429.

Finish with a check that the output exists and has the expected shape. A job that exits quietly with an empty file is worse than one that fails loudly.

Is Gemini CLI open source?

Yes, it is. Google publishes the source on GitHub under the Apache 2.0 licence, so you can read how it handles credentials, retries and configuration before you rely on it for scheduled work.

That covers the client only. The models behind it remain a hosted service, and their quota and billing rules are the ones you accepted when you chose a credential.

References

Share

Get started

Automate this without code.

Cloud or your own servers.

Start free Talk to sales