CLI Agent License Comparison and Commercial Use Guide - Claude Code, Codex, Gemini CLI

Tadashi Shigeoka ·  Mon, January 19, 2026

We wanted to embed CLI Agents as part of our product, so we investigated the licenses of tools from three major AI platformers. This article explains the commercial use possibilities for each tool and key points to consider when integrating them.

Tools Under Investigation

We investigated the following three CLI Agent tools:

License Comparison Overview

In conclusion, the license types fall into two categories.

ToolLicenseCommercial UseSource ModificationRedistributionPatent Clause
Claude CodeProprietaryConditionalNone
CodexApache 2.0Yes
Gemini CLIApache 2.0Yes

Codex and Gemini CLI are provided under Apache 2.0, an open source license suitable for commercial use. On the other hand, only Claude Code has a proprietary license, and code modification and redistribution are generally prohibited.

Claude Code - Proprietary License

Although Claude Code’s source code is published on GitHub, this does not mean it is “open source.” The LICENSE file contains the following:

© Anthropic PBC. All rights reserved.
Use is subject to Anthropic's Commercial Terms of Service.

Explicitly Prohibited Activities

  • Code modification and redistribution: All rights reserved; no rights to modify or redistribute are granted
  • Developing competing products: Development of products or services that compete with Anthropic’s services
  • AI model training: Using Claude Code to train other AI/ML models
  • Reselling the service
  • Reverse engineering

Commercial Use is “Conditional”

While “using” Claude Code itself is possible by agreeing to the commercial terms of service, “embedding” or “modifying” it for your own product is generally not permitted.

Using Anthropic’s “Agent SDK” to invoke Claude Code’s CLI as a subprocess is presented as an “approved integration path.” However, even with SDK integration, designs that allow end users to directly use their own Claude.ai login credentials or rate limits risk violating the terms unless prior approval is obtained from Anthropic.

Ownership of Outputs

For commercial users, ownership of Outputs belongs to the customer. Anthropic also provides indemnification against copyright infringement claims for commercial customers.

Codex & Gemini CLI - Apache License 2.0

Both OpenAI Codex and Google Gemini CLI adopt Apache License 2.0. This license, like MIT, is permissive and suitable for commercial use.

Key Benefits of Apache 2.0

The most significant feature is the inclusion of an explicit patent grant clause. Contributors grant a perpetual, worldwide, royalty-free license for patents related to their contributions. This reduces the risk of patent infringement lawsuits.

Required Actions for Redistribution

RequirementDetails
Include LicenseInclude the full Apache 2.0 license text in your product
State ChangesClearly indicate modifications in changed files
Preserve CopyrightMaintain original copyright, patent, and attribution notices
NOTICE FileInclude in derivative works if present

Be Aware of the Patent Retaliation Clause

Apache 2.0 contains a patent retaliation clause. If you file a patent lawsuit against software covered by Apache 2.0, the patent license for that software is automatically terminated. Companies with significant patent strategies should consider this clause.

Trademark Use is Restricted

Section 6 of the license does not permit using trademarks such as “OpenAI,” “Codex,” “Google,” or “Gemini” in product names or marketing. Trademark use beyond describing the product’s origin requires separate permission.

Software License and API Terms of Service are Separate

Importantly, the software license and AI API service terms of service are separate matters. Even if the software itself is open source, each company’s terms apply to backend API usage.

ToolAPI ProviderApplicable Terms
Claude CodeAnthropic APIAnthropic Commercial Terms of Service
CodexOpenAI APIOpenAI Business Terms
Gemini CLIGoogle Gemini APIGemini API Terms of Service

Notably, OpenAI Business Terms restricts “using Output to develop AI models that compete with OpenAI.” Gemini API and Anthropic API also have their respective Usage Policies prohibiting illegal or harmful use.

Other OSS CLI Agent Tools

Beyond the three tools from major AI platformers above, many other OSS CLI Agent tools are available for commercial use.

Apache 2.0 License

ToolDescription
AiderCLI tool for AI pair programming in the terminal
ForgeCodeInteractive CLI pair programming tool supporting multiple LLM providers
GooseHighly extensible on-machine AI agent developed by Block

MIT License

ToolDescription
OpenCodeProvider-agnostic, supporting 75+ models. Avoids lock-in to specific providers
PlandexTerminal-based AI development tool designed for large-scale projects

All of these are available for commercial use.

Note that the MIT License does not include an explicit patent grant clause, so patent infringement protection is weaker than Apache 2.0.

Easiest to Integrate: OSS CLI Agents (MIT / Apache 2.0)

Legal risk is low and required actions are minimal. Simply including copyright notices and license text in your product allows free commercial use, modification, and redistribution.

In particular, OpenCode (MIT) is designed to be provider-agnostic, enabling “model routing” where you can use different models based on task difficulty. Combining inexpensive and high-performance models enables cost optimization. Note that MIT License lacks patent protection.

Balanced Option: Codex & Gemini CLI (Apache 2.0)

With patent grant clauses, these are suitable for business environments. As long as you properly meet attribution and change notification requirements, integration into proprietary products is acceptable. Don’t forget to check for NOTICE files.

For coding purposes, both Codex and Gemini CLI are viable options. For enterprise customers, combining Google Cloud Vertex AI with Gemini CLI, or OpenAI Enterprise with Codex, is appropriate. These combinations clear data residency and compliance certifications (SOC 2, etc.), minimizing sales barriers.

On the other hand, for general-purpose use cases (content generation, research, task management, etc.), Gemini CLI is the clear choice. Gemini CLI is designed to handle a wide range of tasks beyond coding, and supports script integration and batch processing through Headless Mode.

Not Suitable for Integration: Claude Code (Proprietary)

Since code modification and redistribution are prohibited, integration into your own product is essentially not possible.

If you want to leverage Claude AI capabilities, consider the following approaches:

  • Implement using Claude API directly
  • Subprocess invocation via Agent SDK (may require Anthropic approval)
  • Use via AWS Bedrock or Google Vertex AI (commercial contracts with respective cloud providers apply)

Cost Considerations

Agentic AI consumes significantly more tokens compared to simple chat-based AI. This is because each request sends the codebase structure, file contents, past execution results, and complex system prompts as context.

When designing commercial products, the choice of cost model directly impacts profitability:

  1. Bring Your Own API Key (BYO API Key): End users provide their own API keys. Zero cost risk for developers, but higher burden on users
  2. Managed API Model: Your company pays API fees and charges users a package price. Cost prediction is difficult, but provides a seamless experience

Summary

If your goal is to integrate as part of your own product, Codex/Gemini CLI (Apache 2.0) or OSS CLI Agents like OpenCode (MIT) are appropriate. Both have commercial-friendly licenses, and as long as proper attribution is provided, integration into proprietary software is permitted.

Although Claude Code’s source code is published, its proprietary license makes it unsuitable for integration use. If you want to leverage Claude AI capabilities, consider using it via API.

For final adoption decisions, we recommend confirming the following:

  • Coordination with your legal department
  • Detailed review of API terms of service
  • License check of dependent libraries
  • Cost estimation based on token consumption

That’s all from the Gemba on investigating CLI Agent tool licenses.

References