Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: Analyze and optimize Arm applications with Gemini CLI

minutes_to_complete: 60

who_is_this_for: This is an advanced topic for developers and platform engineers who want to use Gemini CLI to analyze, migrate, and optimize applications for Arm-based systems.

learning_objectives:
- Verify an existing Gemini CLI installation and authentication
- Configure Gemini CLI with persistent context for Arm development
- Integrate the Arm Model Context Protocol (MCP) server with Gemini CLI
- Use Gemini CLI to analyze code and workflows for Arm compatibility
- Apply Gemini CLI to common Arm migration and optimization scenarios

prerequisites:
- Gemini CLI installed and authenticated
- Familiarity with Linux or macOS command-line tools
- General understanding of Arm architecture concepts

author: Jason Andrews

##### Tags
skilllevels: Advanced
subjects: Performance and Architecture
tools_software_languages:
- Gemini CLI
- Docker
armips:
- Neoverse
operatingsystems:
- Linux
- macOS

# ================================================================================
# FIXED, DO NOT MODIFY
# ================================================================================
further_reading:
- resource:
title: Gemini API documentation
link: https://ai.google.dev/gemini-api/docs
type: documentation

- resource:
title: Gemini CLI documentation
link: https://ai.google.dev/gemini-api/docs/cli
type: documentation

- resource:
title: Arm Developer documentation
link: https://developer.arm.com/documentation
type: documentation

- resource:
title: Automate x86-to-Arm application migration using Arm MCP Server
link: https://learn.arm.com/learning-paths/servers-and-cloud-computing/arm-mcp-server/
type: documentation
weight: 1
layout: "learningpathall"
learning_path_main_page: "yes"
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# ================================================================================
# FIXED, DO NOT MODIFY THIS FILE
# ================================================================================
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
title: "Next Steps" # Always the same, html page title.
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

---
title: Use Gemini CLI for Arm code analysis and migration
weight: 7

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Overview

In this section, you use Gemini CLI to reason about Arm compatibility and migration considerations for existing codebases.

Gemini CLI provides guidance and analysis, not automated code transformation.

## Analyze code portability

Ask Gemini questions such as:

```text
Are there common x86 assumptions in this codebase?
```

```text
What should I check when migrating this application to Arm64?
```

Gemini can help identify:
- Architecture-specific dependencies
- Build system assumptions
- Potential portability risks

## Migration guidance

Use Gemini CLI to reason about:
- Compiler flags
- Dependency availability
- Runtime behavior differences

This guidance helps you plan migrations more effectively.

Next, you explore how Gemini CLI can assist with optimization-related questions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Get started with Gemini CLI for Arm development

weight: 2

layout: "learningpathall"
---

## Developing software for Arm platforms

Arm-based systems are widely used across cloud, edge, and embedded environments due to their performance, efficiency, and scalability. Developers targeting Arm platforms often work across a mix of Linux and macOS systems and need tooling that understands Arm architecture constraints and best practices.

As Arm adoption grows, developers often need to reason about portability, build system assumptions, dependency availability, and performance characteristics that differ from traditional x86 environments. These considerations are especially relevant when migrating existing applications or optimizing workloads to run efficiently on Arm-based systems.

## Gemini CLI

Gemini CLI is Google’s command-line interface for interacting with the Gemini AI assistant. It allows developers to ask questions, explore design options, and reason about code and systems directly from the terminal.

Gemini CLI is designed to run consistently across operating systems, including Arm Linux distributions and macOS on Arm. This makes it a practical command-line assistant for developers building, migrating, or optimizing software for Arm-based environments.

Gemini CLI supports tasks such as:
- Understanding unfamiliar codebases
- Reasoning about architecture and design decisions
- Exploring portability and migration considerations
- Assisting with development and troubleshooting workflows

In this Learning Path, you configure Gemini CLI with Arm-specific context and integrate additional tooling so that Gemini can provide more relevant guidance for Arm development tasks.

For more information, see the [Gemini CLI documentation](https://ai.google.dev/gemini-api/docs/cli).
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

---
title: Configure Gemini CLI context for Arm development
weight: 4

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Overview

In this section, you configure Gemini CLI with persistent context so it can provide more relevant guidance for Arm development tasks.

By defining your development environment, architecture preferences, and constraints, you help Gemini generate responses that are tailored to Arm-based systems.

## Create the Gemini configuration directory

Gemini CLI reads context files from the `.gemini` directory in your home folder.

Create the directory if it does not already exist:

```console
mkdir -p ~/.gemini
```

## Define Arm development context

Create a context file named `GEMINI.md` that describes your Arm development environment.

```console
cat > ~/.gemini/GEMINI.md << 'EOF'
I am an Arm Linux developer.
I primarily work on Arm64 systems and prefer Arm-native solutions.
Please avoid x86-specific assumptions unless explicitly requested.
EOF
```

This file provides Gemini with persistent context that is automatically applied to all future sessions.

## Verify that context is applied

Start Gemini CLI:

```console
gemini
```

Ask a question related to development tooling:

```text
What should I consider when building software for Arm?
```

If context is loaded correctly, Gemini responds with Arm-specific guidance.

Next, you learn how Gemini CLI can be extended using the Arm Model Context Protocol.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Verify and prepare Gemini CLI
weight: 3

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Overview

In this section, you verify that Gemini CLI is installed and authenticated, and confirm that it is ready for use in this Learning Path.

{{% notice Note %}}This Learning Path assumes that Gemini CLI has already been installed. Installation steps are provided separately in the [Gemini CLI install guide](/install-guides/gemini/).
{{% /notice %}}

## Before you begin

To continue with this Learning Path, ensure that:

- Gemini CLI is installed on your system
- You have completed authentication (for example, using Google OAuth or an API key)
- You can access a terminal on macOS or Arm Linux

## Verify Gemini CLI installation

Confirm that the Gemini CLI binary is available by checking the version:

```console
gemini --version
```

Output similar to the following indicates that Gemini CLI is installed correctly:

```output
0.20.0
```

## Verify authentication and start a session

Start an interactive Gemini CLI session:

```console
gemini
```

On first run, you are prompted to authenticate if authentication has not already been configured. After successful authentication, the interactive Gemini CLI session opens.

If authentication fails or you need to change your authentication method, follow the instructions in the
[Gemini CLI Install Guide](/install-guides/gemini-cli/).

## What you have accomplished and what is next

You have verified that Gemini CLI is installed and ready to use.

Next, you configure Gemini CLI with persistent context so it can provide more relevant guidance for Arm development tasks.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

---
title: Integrate the Arm MCP server with Gemini CLI
weight: 6

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Overview

In this section, you integrate the Arm Model Context Protocol (MCP) server with Gemini CLI.

This enables Gemini to access Arm-specific tools and documentation during interactive sessions.

## Prerequisites

Before continuing, ensure:
- Gemini CLI is installed and working
- Docker is installed and running on your system

## Pull the Arm MCP server image

Pull the latest Arm MCP server container image:

```console
docker pull armlimited/arm-mcp:latest
```

## Configure Gemini CLI to use MCP

Edit the Gemini CLI settings file:

```console
mkdir -p ~/.gemini
nano ~/.gemini/settings.json
```

Add the following configuration:

```json
{
"mcpServers": {
"arm_mcp_server": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v", "/path/to/your/code:/workspace",
"armlimited/arm-mcp:latest"
],
"timeout": 60000
}
}
}
```

Replace `/path/to/your/code` with the path to your local source directory.

## Verify MCP integration

Start Gemini CLI:

```console
gemini
```

List available tools:

```text
/tools
```

If the Arm MCP server is configured correctly, Arm-related tools appear in the output.

Next, you use Gemini CLI with MCP to analyze Arm code and migration scenarios.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

---
title: Use Gemini CLI for Arm optimization guidance
weight: 8

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Overview

In this section, you explore how Gemini CLI can assist with Arm optimization discussions and decision-making.

Gemini CLI complements traditional tools such as profilers and benchmarks.

## Ask optimization-focused questions

Examples include:

```text
What performance considerations are important on Arm?
```

```text
Where should I start when optimizing this workload for Arm?
```

Gemini can suggest:
- Areas to investigate
- Relevant Arm architecture concepts
- Appropriate tooling

## Set expectations

Gemini CLI does not replace:
- Performance profilers
- Benchmarks
- Hardware-specific tuning

Instead, it helps you ask better questions and focus your optimization efforts.

You have now completed the Gemini CLI Learning Path.
Loading