mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -07:00
feat(cli): add gemini --resume hint on exit (#16285)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Jack Wotherspoon <jackwoth@google.com>
This commit is contained in:
@@ -14,5 +14,9 @@ interface SessionSummaryDisplayProps {
|
|||||||
export const SessionSummaryDisplay: React.FC<SessionSummaryDisplayProps> = ({
|
export const SessionSummaryDisplay: React.FC<SessionSummaryDisplayProps> = ({
|
||||||
duration,
|
duration,
|
||||||
}) => (
|
}) => (
|
||||||
<StatsDisplay title="Agent powering down. Goodbye!" duration={duration} />
|
<StatsDisplay
|
||||||
|
title="Agent powering down. Goodbye!"
|
||||||
|
duration={duration}
|
||||||
|
footer="Tip: Resume a previous session using gemini --resume or /resume"
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ const ModelUsageTable: React.FC<{
|
|||||||
: `Model Usage`;
|
: `Model Usage`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box flexDirection="column" marginTop={1}>
|
<Box flexDirection="column" marginBottom={1}>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<Box alignItems="flex-end">
|
<Box alignItems="flex-end">
|
||||||
<Box width={nameWidth}>
|
<Box width={nameWidth}>
|
||||||
@@ -379,6 +379,7 @@ interface StatsDisplayProps {
|
|||||||
duration: string;
|
duration: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
quotas?: RetrieveUserQuotaResponse;
|
quotas?: RetrieveUserQuotaResponse;
|
||||||
|
footer?: string;
|
||||||
selectedAuthType?: string;
|
selectedAuthType?: string;
|
||||||
userEmail?: string;
|
userEmail?: string;
|
||||||
tier?: string;
|
tier?: string;
|
||||||
@@ -390,6 +391,7 @@ export const StatsDisplay: React.FC<StatsDisplayProps> = ({
|
|||||||
duration,
|
duration,
|
||||||
title,
|
title,
|
||||||
quotas,
|
quotas,
|
||||||
|
footer,
|
||||||
selectedAuthType,
|
selectedAuthType,
|
||||||
userEmail,
|
userEmail,
|
||||||
tier,
|
tier,
|
||||||
@@ -433,6 +435,13 @@ export const StatsDisplay: React.FC<StatsDisplayProps> = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const renderFooter = () => {
|
||||||
|
if (!footer) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return <ThemedGradient bold>{footer}</ThemedGradient>;
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
borderStyle="round"
|
borderStyle="round"
|
||||||
@@ -536,6 +545,7 @@ export const StatsDisplay: React.FC<StatsDisplayProps> = ({
|
|||||||
pooledLimit={pooledLimit}
|
pooledLimit={pooledLimit}
|
||||||
pooledResetTime={pooledResetTime}
|
pooledResetTime={pooledResetTime}
|
||||||
/>
|
/>
|
||||||
|
{renderFooter()}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,12 +17,13 @@ exports[`<SessionSummaryDisplay /> > renders the summary display with a title 1`
|
|||||||
│ » API Time: 50.2s (100.0%) │
|
│ » API Time: 50.2s (100.0%) │
|
||||||
│ » Tool Time: 0s (0.0%) │
|
│ » Tool Time: 0s (0.0%) │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
|
||||||
│ Model Usage │
|
│ Model Usage │
|
||||||
│ Model Reqs Input Tokens Cache Reads Output Tokens │
|
│ Model Reqs Input Tokens Cache Reads Output Tokens │
|
||||||
│ ──────────────────────────────────────────────────────────────────────────── │
|
│ ──────────────────────────────────────────────────────────────────────────── │
|
||||||
│ gemini-2.5-pro 10 500 500 2,000 │
|
│ gemini-2.5-pro 10 500 500 2,000 │
|
||||||
│ │
|
│ │
|
||||||
│ Savings Highlight: 500 (50.0%) of input tokens were served from the cache, reducing costs. │
|
│ Savings Highlight: 500 (50.0%) of input tokens were served from the cache, reducing costs. │
|
||||||
|
│ │
|
||||||
|
│ Tip: Resume a previous session using gemini --resume or /resume │
|
||||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -112,11 +112,11 @@ exports[`<StatsDisplay /> > Conditional Rendering Tests > hides Efficiency secti
|
|||||||
│ » API Time: 100ms (100.0%) │
|
│ » API Time: 100ms (100.0%) │
|
||||||
│ » Tool Time: 0s (0.0%) │
|
│ » Tool Time: 0s (0.0%) │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
|
||||||
│ Model Usage │
|
│ Model Usage │
|
||||||
│ Model Reqs Input Tokens Cache Reads Output Tokens │
|
│ Model Reqs Input Tokens Cache Reads Output Tokens │
|
||||||
│ ──────────────────────────────────────────────────────────────────────────── │
|
│ ──────────────────────────────────────────────────────────────────────────── │
|
||||||
│ gemini-2.5-pro 1 100 0 100 │
|
│ gemini-2.5-pro 1 100 0 100 │
|
||||||
|
│ │
|
||||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -155,7 +155,6 @@ exports[`<StatsDisplay /> > Quota Display > renders pooled quota information for
|
|||||||
│ » API Time: 0s (0.0%) │
|
│ » API Time: 0s (0.0%) │
|
||||||
│ » Tool Time: 0s (0.0%) │
|
│ » Tool Time: 0s (0.0%) │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
|
||||||
│ auto Usage │
|
│ auto Usage │
|
||||||
│ 65% usage remaining │
|
│ 65% usage remaining │
|
||||||
│ Usage limit: 1,100 │
|
│ Usage limit: 1,100 │
|
||||||
@@ -166,6 +165,7 @@ exports[`<StatsDisplay /> > Quota Display > renders pooled quota information for
|
|||||||
│ ──────────────────────────────────────────────────────────── │
|
│ ──────────────────────────────────────────────────────────── │
|
||||||
│ gemini-2.5-pro - │
|
│ gemini-2.5-pro - │
|
||||||
│ gemini-2.5-flash - │
|
│ gemini-2.5-flash - │
|
||||||
|
│ │
|
||||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -185,11 +185,11 @@ exports[`<StatsDisplay /> > Quota Display > renders quota information for unused
|
|||||||
│ » API Time: 0s (0.0%) │
|
│ » API Time: 0s (0.0%) │
|
||||||
│ » Tool Time: 0s (0.0%) │
|
│ » Tool Time: 0s (0.0%) │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
|
||||||
│ Model Usage │
|
│ Model Usage │
|
||||||
│ Model Reqs Usage remaining │
|
│ Model Reqs Usage remaining │
|
||||||
│ ──────────────────────────────────────────────────────────── │
|
│ ──────────────────────────────────────────────────────────── │
|
||||||
│ gemini-2.5-flash - 50.0% resets in 2h │
|
│ gemini-2.5-flash - 50.0% resets in 2h │
|
||||||
|
│ │
|
||||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -209,11 +209,11 @@ exports[`<StatsDisplay /> > Quota Display > renders quota information when quota
|
|||||||
│ » API Time: 100ms (100.0%) │
|
│ » API Time: 100ms (100.0%) │
|
||||||
│ » Tool Time: 0s (0.0%) │
|
│ » Tool Time: 0s (0.0%) │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
|
||||||
│ Model Usage │
|
│ Model Usage │
|
||||||
│ Model Reqs Usage remaining │
|
│ Model Reqs Usage remaining │
|
||||||
│ ──────────────────────────────────────────────────────────── │
|
│ ──────────────────────────────────────────────────────────── │
|
||||||
│ gemini-2.5-pro 1 75.0% resets in 1h 30m │
|
│ gemini-2.5-pro 1 75.0% resets in 1h 30m │
|
||||||
|
│ │
|
||||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -271,7 +271,6 @@ exports[`<StatsDisplay /> > renders a table with two models correctly 1`] = `
|
|||||||
│ » API Time: 19.5s (100.0%) │
|
│ » API Time: 19.5s (100.0%) │
|
||||||
│ » Tool Time: 0s (0.0%) │
|
│ » Tool Time: 0s (0.0%) │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
|
||||||
│ Model Usage │
|
│ Model Usage │
|
||||||
│ Model Reqs Input Tokens Cache Reads Output Tokens │
|
│ Model Reqs Input Tokens Cache Reads Output Tokens │
|
||||||
│ ──────────────────────────────────────────────────────────────────────────── │
|
│ ──────────────────────────────────────────────────────────────────────────── │
|
||||||
@@ -279,6 +278,7 @@ exports[`<StatsDisplay /> > renders a table with two models correctly 1`] = `
|
|||||||
│ gemini-2.5-flash 5 15,000 10,000 15,000 │
|
│ gemini-2.5-flash 5 15,000 10,000 15,000 │
|
||||||
│ │
|
│ │
|
||||||
│ Savings Highlight: 10,500 (40.4%) of input tokens were served from the cache, reducing costs. │
|
│ Savings Highlight: 10,500 (40.4%) of input tokens were served from the cache, reducing costs. │
|
||||||
|
│ │
|
||||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -299,13 +299,13 @@ exports[`<StatsDisplay /> > renders all sections when all data is present 1`] =
|
|||||||
│ » API Time: 100ms (44.8%) │
|
│ » API Time: 100ms (44.8%) │
|
||||||
│ » Tool Time: 123ms (55.2%) │
|
│ » Tool Time: 123ms (55.2%) │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
|
||||||
│ Model Usage │
|
│ Model Usage │
|
||||||
│ Model Reqs Input Tokens Cache Reads Output Tokens │
|
│ Model Reqs Input Tokens Cache Reads Output Tokens │
|
||||||
│ ──────────────────────────────────────────────────────────────────────────── │
|
│ ──────────────────────────────────────────────────────────────────────────── │
|
||||||
│ gemini-2.5-pro 1 50 50 100 │
|
│ gemini-2.5-pro 1 50 50 100 │
|
||||||
│ │
|
│ │
|
||||||
│ Savings Highlight: 50 (50.0%) of input tokens were served from the cache, reducing costs. │
|
│ Savings Highlight: 50 (50.0%) of input tokens were served from the cache, reducing costs. │
|
||||||
|
│ │
|
||||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user